Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 107 | 107 |
| 108 // static | 108 // static |
| 109 void GpuBlacklistUpdater::SetupOnUIThread() { | 109 void GpuBlacklistUpdater::SetupOnUIThread() { |
| 110 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 110 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 111 | 111 |
| 112 // Initialize GpuBlacklistUpdater, which loads the current blacklist; | 112 // Initialize GpuBlacklistUpdater, which loads the current blacklist; |
| 113 // then Schedule a GPU blacklist auto update. | 113 // then Schedule a GPU blacklist auto update. |
| 114 GpuBlacklistUpdater* updater = | 114 GpuBlacklistUpdater* updater = |
| 115 g_browser_process->gpu_blacklist_updater(); | 115 g_browser_process->gpu_blacklist_updater(); |
| 116 DCHECK(updater); | 116 DCHECK(updater); |
| 117 updater->StartAfterDelay(); | |
|
Ken Russell (switch to Gerrit)
2011/11/11 20:53:42
Is there a larger code simplification that can be
| |
| 118 } | 117 } |
| 119 | 118 |
| 120 void GpuBlacklistUpdater::Unpack(const DictionaryValue& parsed_json) { | 119 void GpuBlacklistUpdater::Unpack(const DictionaryValue& parsed_json) { |
| 121 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 120 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 122 prefs_->Set(prefs::kGpuBlacklist, parsed_json); | 121 prefs_->Set(prefs::kGpuBlacklist, parsed_json); |
| 123 UpdateGpuBlacklist(parsed_json, false); | 122 UpdateGpuBlacklist(parsed_json, false); |
| 124 } | 123 } |
| 125 | 124 |
| 126 void GpuBlacklistUpdater::InitializeGpuBlacklist() { | 125 void GpuBlacklistUpdater::InitializeGpuBlacklist() { |
| 127 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 126 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 149 | 148 |
| 150 scoped_ptr<GpuBlacklist> gpu_blacklist( | 149 scoped_ptr<GpuBlacklist> gpu_blacklist( |
| 151 new GpuBlacklist(GetChromeVersionString())); | 150 new GpuBlacklist(GetChromeVersionString())); |
| 152 bool success = gpu_blacklist->LoadGpuBlacklist( | 151 bool success = gpu_blacklist->LoadGpuBlacklist( |
| 153 gpu_blacklist_cache, GpuBlacklist::kCurrentOsOnly); | 152 gpu_blacklist_cache, GpuBlacklist::kCurrentOsOnly); |
| 154 if (success) { | 153 if (success) { |
| 155 GpuDataManager::GetInstance()->UpdateGpuBlacklist( | 154 GpuDataManager::GetInstance()->UpdateGpuBlacklist( |
| 156 gpu_blacklist.release(), preliminary); | 155 gpu_blacklist.release(), preliminary); |
| 157 } | 156 } |
| 158 } | 157 } |
| OLD | NEW |