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

Unified Diff: content/browser/gpu/gpu_data_manager_impl.cc

Issue 10911315: Move gpu blacklist data file to content side. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/gpu/gpu_data_manager_impl.cc
===================================================================
--- content/browser/gpu/gpu_data_manager_impl.cc (revision 156701)
+++ content/browser/gpu/gpu_data_manager_impl.cc (working copy)
@@ -8,6 +8,7 @@
#include "base/bind_helpers.h"
#include "base/command_line.h"
#include "base/file_util.h"
+#include "base/string_piece.h"
#include "base/stringprintf.h"
#include "base/sys_info.h"
#include "base/values.h"
@@ -20,6 +21,7 @@
#include "content/public/browser/gpu_data_manager_observer.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
+#include "grit/content_resources.h"
#include "ui/base/ui_base_switches.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_switches.h"
@@ -62,17 +64,22 @@
BlacklistCard();
}
-void GpuDataManagerImpl::Initialize(
- const std::string& browser_version_string,
- const std::string& gpu_blacklist_json) {
+void GpuDataManagerImpl::Initialize(const std::string& browser_version_string) {
content::GPUInfo gpu_info;
gpu_info_collector::CollectPreliminaryGraphicsInfo(&gpu_info);
#if defined(ARCH_CPU_X86_FAMILY)
if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id)
gpu_info.finalized = true;
#endif
-
- Initialize(browser_version_string, gpu_blacklist_json, gpu_info);
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ std::string gpu_blacklist_string;
+ if (!command_line->HasSwitch(switches::kIgnoreGpuBlacklist)) {
+ const base::StringPiece gpu_blacklist_json =
+ content::GetContentClient()->GetDataResource(
+ IDR_GPU_BLACKLIST, ui::SCALE_FACTOR_NONE);
+ gpu_blacklist_string = gpu_blacklist_json.as_string();
+ }
+ Initialize(browser_version_string, gpu_blacklist_string, gpu_info);
}
void GpuDataManagerImpl::Initialize(

Powered by Google App Engine
This is Rietveld 408576698