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

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,9 +64,11 @@
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) {
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kSkipGpuDataLoading))
+ return;
+
content::GPUInfo gpu_info;
gpu_info_collector::CollectPreliminaryGraphicsInfo(&gpu_info);
#if defined(ARCH_CPU_X86_FAMILY)
@@ -72,10 +76,26 @@
gpu_info.finalized = true;
#endif
- Initialize(browser_version_string, gpu_blacklist_json, gpu_info);
+ 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(
+ const std::string& gpu_blacklist_json,
+ const content::GPUInfo& gpu_info) {
+ // This function is for testing only, so disable histograms.
+ update_histograms_ = false;
+
+ Initialize("0", gpu_blacklist_json, gpu_info);
+}
+
+void GpuDataManagerImpl::Initialize(
const std::string& browser_version_string,
const std::string& gpu_blacklist_json,
const content::GPUInfo& gpu_info) {
@@ -87,9 +107,6 @@
gpu_info_ = empty_gpu_info;
}
- // This function is for testing only, so disable histograms.
- update_histograms_ = false;
-
if (!gpu_blacklist_json.empty()) {
CHECK(!browser_version_string.empty());
gpu_blacklist_.reset(new GpuBlacklist());

Powered by Google App Engine
This is Rietveld 408576698