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

Side by Side Diff: chrome/browser/web_resource/gpu_blacklist_updater.cc

Issue 7633038: Relax software rendering list parsing. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/web_resource/gpu_blacklist_updater.h" 5 #include "chrome/browser/web_resource/gpu_blacklist_updater.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 void GpuBlacklistUpdater::InitializeGpuBlacklist() { 98 void GpuBlacklistUpdater::InitializeGpuBlacklist() {
99 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 99 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
100 100
101 // We first load it from the browser resources. 101 // We first load it from the browser resources.
102 const base::StringPiece gpu_blacklist_json( 102 const base::StringPiece gpu_blacklist_json(
103 ResourceBundle::GetSharedInstance().GetRawDataResource( 103 ResourceBundle::GetSharedInstance().GetRawDataResource(
104 IDR_GPU_BLACKLIST)); 104 IDR_GPU_BLACKLIST));
105 GpuBlacklist* built_in_list = new GpuBlacklist(GetChromeVersionString()); 105 GpuBlacklist* built_in_list = new GpuBlacklist(GetChromeVersionString());
106 bool succeed = built_in_list->LoadGpuBlacklist( 106 bool succeed = built_in_list->LoadGpuBlacklist(
107 gpu_blacklist_json.as_string(), true); 107 gpu_blacklist_json.as_string(),
108 GpuBlacklist::kCurrentOsOnly,
109 GpuBlacklist::kIgnoreExceptionWithUnknownField);
108 DCHECK(succeed); 110 DCHECK(succeed);
109 GpuDataManager::GetInstance()->SetBuiltInGpuBlacklist(built_in_list); 111 GpuDataManager::GetInstance()->SetBuiltInGpuBlacklist(built_in_list);
110 112
111 // Then we check if the cached version is more up-to-date. 113 // Then we check if the cached version is more up-to-date.
112 const DictionaryValue* gpu_blacklist_cache = 114 const DictionaryValue* gpu_blacklist_cache =
113 prefs_->GetDictionary(prefs::kGpuBlacklist); 115 prefs_->GetDictionary(prefs::kGpuBlacklist);
114 DCHECK(gpu_blacklist_cache); 116 DCHECK(gpu_blacklist_cache);
115 UpdateGpuBlacklist(*gpu_blacklist_cache, true); 117 UpdateGpuBlacklist(*gpu_blacklist_cache, true);
116 } 118 }
117 119
118 void GpuBlacklistUpdater::UpdateGpuBlacklist( 120 void GpuBlacklistUpdater::UpdateGpuBlacklist(
119 const DictionaryValue& gpu_blacklist_cache, bool preliminary) { 121 const DictionaryValue& gpu_blacklist_cache, bool preliminary) {
120 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 122 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
121 123
122 scoped_ptr<GpuBlacklist> gpu_blacklist( 124 scoped_ptr<GpuBlacklist> gpu_blacklist(
123 new GpuBlacklist(GetChromeVersionString())); 125 new GpuBlacklist(GetChromeVersionString()));
124 if (gpu_blacklist->LoadGpuBlacklist(gpu_blacklist_cache, true)) { 126 bool success = gpu_blacklist->LoadGpuBlacklist(
127 gpu_blacklist_cache,
128 GpuBlacklist::kCurrentOsOnly,
129 GpuBlacklist::kIgnoreExceptionWithUnknownField);
130 if (success) {
125 GpuDataManager::GetInstance()->UpdateGpuBlacklist( 131 GpuDataManager::GetInstance()->UpdateGpuBlacklist(
126 gpu_blacklist.release(), preliminary); 132 gpu_blacklist.release(), preliminary);
127 } 133 }
128 } 134 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/gpu/gpu_blacklist.h » ('j') | content/browser/gpu/gpu_blacklist.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698