Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: content/browser/gpu/gpu_data_manager_impl.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/gpu/gpu_data_manager_impl.h" 5 #include "content/browser/gpu/gpu_data_manager_impl.h"
6 6
7 #if defined(OS_MACOSX) 7 #if defined(OS_MACOSX)
8 #include <ApplicationServices/ApplicationServices.h> 8 #include <ApplicationServices/ApplicationServices.h>
9 #endif // OS_MACOSX 9 #endif // OS_MACOSX
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 GpuDataManagerImpl* GpuDataManagerImpl::GetInstance() { 110 GpuDataManagerImpl* GpuDataManagerImpl::GetInstance() {
111 return Singleton<GpuDataManagerImpl>::get(); 111 return Singleton<GpuDataManagerImpl>::get();
112 } 112 }
113 113
114 void GpuDataManagerImpl::InitializeForTesting( 114 void GpuDataManagerImpl::InitializeForTesting(
115 const std::string& gpu_blacklist_json, 115 const std::string& gpu_blacklist_json,
116 const GPUInfo& gpu_info) { 116 const GPUInfo& gpu_info) {
117 // This function is for testing only, so disable histograms. 117 // This function is for testing only, so disable histograms.
118 update_histograms_ = false; 118 update_histograms_ = false;
119 119
120 InitializeImpl(gpu_blacklist_json, "", "", gpu_info); 120 InitializeImpl(gpu_blacklist_json, std::string(), std::string(), gpu_info);
121 } 121 }
122 122
123 bool GpuDataManagerImpl::IsFeatureBlacklisted(int feature) const { 123 bool GpuDataManagerImpl::IsFeatureBlacklisted(int feature) const {
124 if (software_rendering_) { 124 if (software_rendering_) {
125 // Skia's software rendering is probably more efficient than going through 125 // Skia's software rendering is probably more efficient than going through
126 // software emulation of the GPU, so use that. 126 // software emulation of the GPU, so use that.
127 if (feature == GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS) 127 if (feature == GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS)
128 return true; 128 return true;
129 return false; 129 return false;
130 } 130 }
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 gpu_info_collector::MergeGPUInfo(&gpu_info_, gpu_info); 343 gpu_info_collector::MergeGPUInfo(&gpu_info_, gpu_info);
344 complete_gpu_info_already_requested_ = 344 complete_gpu_info_already_requested_ =
345 complete_gpu_info_already_requested_ || gpu_info_.finalized; 345 complete_gpu_info_already_requested_ || gpu_info_.finalized;
346 my_gpu_info = gpu_info_; 346 my_gpu_info = gpu_info_;
347 } 347 }
348 348
349 GetContentClient()->SetGpuInfo(my_gpu_info); 349 GetContentClient()->SetGpuInfo(my_gpu_info);
350 350
351 if (gpu_blacklist_.get()) { 351 if (gpu_blacklist_.get()) {
352 std::set<int> features = gpu_blacklist_->MakeDecision( 352 std::set<int> features = gpu_blacklist_->MakeDecision(
353 GpuControlList::kOsAny, "", my_gpu_info); 353 GpuControlList::kOsAny, std::string(), my_gpu_info);
354 if (update_histograms_) 354 if (update_histograms_)
355 UpdateStats(gpu_blacklist_.get(), features); 355 UpdateStats(gpu_blacklist_.get(), features);
356 356
357 UpdateBlacklistedFeatures(features); 357 UpdateBlacklistedFeatures(features);
358 } 358 }
359 if (gpu_switching_list_.get()) { 359 if (gpu_switching_list_.get()) {
360 std::set<int> option = gpu_switching_list_->MakeDecision( 360 std::set<int> option = gpu_switching_list_->MakeDecision(
361 GpuControlList::kOsAny, "", my_gpu_info); 361 GpuControlList::kOsAny, std::string(), my_gpu_info);
362 if (option.size() == 1) { 362 if (option.size() == 1) {
363 // Blacklist decision should not overwrite commandline switch from users. 363 // Blacklist decision should not overwrite commandline switch from users.
364 CommandLine* command_line = CommandLine::ForCurrentProcess(); 364 CommandLine* command_line = CommandLine::ForCurrentProcess();
365 if (!command_line->HasSwitch(switches::kGpuSwitching)) 365 if (!command_line->HasSwitch(switches::kGpuSwitching))
366 gpu_switching_ = static_cast<GpuSwitchingOption>(*(option.begin())); 366 gpu_switching_ = static_cast<GpuSwitchingOption>(*(option.begin()));
367 } 367 }
368 } 368 }
369 if (gpu_driver_bug_list_.get()) 369 if (gpu_driver_bug_list_.get())
370 gpu_driver_bugs_ = gpu_driver_bug_list_->MakeDecision( 370 gpu_driver_bugs_ = gpu_driver_bug_list_->MakeDecision(
371 GpuControlList::kOsAny, "", my_gpu_info); 371 GpuControlList::kOsAny, std::string(), my_gpu_info);
372 372
373 // We have to update GpuFeatureType before notify all the observers. 373 // We have to update GpuFeatureType before notify all the observers.
374 NotifyGpuInfoUpdate(); 374 NotifyGpuInfoUpdate();
375 } 375 }
376 376
377 void GpuDataManagerImpl::UpdateVideoMemoryUsageStats( 377 void GpuDataManagerImpl::UpdateVideoMemoryUsageStats(
378 const GPUVideoMemoryUsageStats& video_memory_usage_stats) { 378 const GPUVideoMemoryUsageStats& video_memory_usage_stats) {
379 observer_list_->Notify(&GpuDataManagerObserver::OnVideoMemoryUsageStatsUpdate, 379 observer_list_->Notify(&GpuDataManagerObserver::OnVideoMemoryUsageStatsUpdate,
380 video_memory_usage_stats); 380 video_memory_usage_stats);
381 } 381 }
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 892
893 void GpuDataManagerImpl::Notify3DAPIBlocked(const GURL& url, 893 void GpuDataManagerImpl::Notify3DAPIBlocked(const GURL& url,
894 int render_process_id, 894 int render_process_id,
895 int render_view_id, 895 int render_view_id,
896 ThreeDAPIType requester) { 896 ThreeDAPIType requester) {
897 observer_list_->Notify(&GpuDataManagerObserver::DidBlock3DAPIs, 897 observer_list_->Notify(&GpuDataManagerObserver::DidBlock3DAPIs,
898 url, render_process_id, render_view_id, requester); 898 url, render_process_id, render_view_id, requester);
899 } 899 }
900 900
901 } // namespace content 901 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_control_list_version_info_unittest.cc ('k') | content/browser/gpu/gpu_memory_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698