From 27901c85de3683b96e187d5b05a676297d3e84f6 Mon Sep 17 00:00:00 2001 From: jdufault Date: Mon, 11 Jan 2016 16:49:16 -0800 Subject: Lazily allocate CastConfigDelegate to fix profile construction race. Checking if the MediaRouter is enabled requires a Profile instance. This check happens early in the initialization cycle, before the Profile has been constructed. Instead, lazily construct the CastConfigDelegate instance so we don't accidentally create two profiles at the same time. BUG=574246 Review URL: https://codereview.chromium.org/1562923002 Cr-Commit-Position: refs/heads/master@{#368739} --- ash/system/tray/system_tray_delegate.cc | 2 +- ash/system/tray/system_tray_delegate.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'ash/system') diff --git a/ash/system/tray/system_tray_delegate.cc b/ash/system/tray/system_tray_delegate.cc index fe081c0..b0228ec 100644 --- a/ash/system/tray/system_tray_delegate.cc +++ b/ash/system/tray/system_tray_delegate.cc @@ -222,7 +222,7 @@ bool SystemTrayDelegate::GetBluetoothDiscovering() { void SystemTrayDelegate::ChangeProxySettings() { } -CastConfigDelegate* SystemTrayDelegate::GetCastConfigDelegate() const { +CastConfigDelegate* SystemTrayDelegate::GetCastConfigDelegate() { return nullptr; } diff --git a/ash/system/tray/system_tray_delegate.h b/ash/system/tray/system_tray_delegate.h index 1d2e0c2..df6ac0e 100644 --- a/ash/system/tray/system_tray_delegate.h +++ b/ash/system/tray/system_tray_delegate.h @@ -284,7 +284,7 @@ class ASH_EXPORT SystemTrayDelegate { virtual void ChangeProxySettings(); // Returns CastConfigDelegate. May return nullptr. - virtual CastConfigDelegate* GetCastConfigDelegate() const; + virtual CastConfigDelegate* GetCastConfigDelegate(); // Returns NetworkingConfigDelegate. May return nullptr. virtual NetworkingConfigDelegate* GetNetworkingConfigDelegate() const; -- cgit v1.1