Index: content/browser/gpu/gpu_data_manager.cc |
=================================================================== |
--- content/browser/gpu/gpu_data_manager.cc (revision 112547) |
+++ content/browser/gpu/gpu_data_manager.cc (working copy) |
@@ -196,6 +196,7 @@ |
GpuDataManager::GpuDataManager() |
: complete_gpu_info_already_requested_(false), |
+ complete_gpu_info_available_(false), |
observer_list_(new GpuDataManagerObserverList), |
software_rendering_(false) { |
Initialize(); |
@@ -208,7 +209,10 @@ |
if (!user_flags_.skip_gpu_data_loading()) { |
content::GPUInfo gpu_info; |
gpu_info_collector::CollectPreliminaryGraphicsInfo(&gpu_info); |
- UpdateGpuInfo(gpu_info); |
+ { |
+ base::AutoLock auto_lock(gpu_info_lock_); |
+ gpu_info_ = gpu_info; |
+ } |
} |
#if defined(OS_MACOSX) |
@@ -229,7 +233,7 @@ |
void GpuDataManager::RequestCompleteGpuInfoIfNeeded() { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
- if (complete_gpu_info_already_requested_) |
+ if (complete_gpu_info_already_requested_ || complete_gpu_info_available_) |
return; |
complete_gpu_info_already_requested_ = true; |
@@ -240,20 +244,18 @@ |
} |
void GpuDataManager::UpdateGpuInfo(const content::GPUInfo& gpu_info) { |
+ complete_gpu_info_available_ = true; |
+ complete_gpu_info_already_requested_ = true; |
{ |
base::AutoLock auto_lock(gpu_info_lock_); |
if (!Merge(&gpu_info_, gpu_info)) |
return; |
- } |
- |
- NotifyGpuInfoUpdate(); |
- |
- { |
- base::AutoLock auto_lock(gpu_info_lock_); |
content::GetContentClient()->SetGpuInfo(gpu_info_); |
} |
UpdateGpuFeatureFlags(); |
+ // We have to update GpuFeatureFlags before notify all the observers. |
+ NotifyGpuInfoUpdate(); |
} |
const content::GPUInfo& GpuDataManager::gpu_info() const { |