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

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

Issue 6905044: Refactor preference syncing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + comments Created 9 years, 7 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/logging.h" 7 #include "base/logging.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
(...skipping 24 matching lines...) Expand all
35 35
36 GpuBlacklistUpdater::GpuBlacklistUpdater() 36 GpuBlacklistUpdater::GpuBlacklistUpdater()
37 : WebResourceService(ProfileManager::GetDefaultProfile(), 37 : WebResourceService(ProfileManager::GetDefaultProfile(),
38 g_browser_process->local_state(), 38 g_browser_process->local_state(),
39 GpuBlacklistUpdater::kDefaultGpuBlacklistURL, 39 GpuBlacklistUpdater::kDefaultGpuBlacklistURL,
40 false, // don't append locale to URL 40 false, // don't append locale to URL
41 NotificationType::NOTIFICATION_TYPE_COUNT, 41 NotificationType::NOTIFICATION_TYPE_COUNT,
42 prefs::kGpuBlacklistUpdate, 42 prefs::kGpuBlacklistUpdate,
43 kStartGpuBlacklistFetchDelay, 43 kStartGpuBlacklistFetchDelay,
44 kCacheUpdateDelay) { 44 kCacheUpdateDelay) {
45 prefs_->RegisterDictionaryPref(prefs::kGpuBlacklist); 45 prefs_->RegisterDictionaryPref(prefs::kGpuBlacklist,
46 false /* don't sync pref */);
46 const DictionaryValue* gpu_blacklist_cache = 47 const DictionaryValue* gpu_blacklist_cache =
47 prefs_->GetDictionary(prefs::kGpuBlacklist); 48 prefs_->GetDictionary(prefs::kGpuBlacklist);
48 LoadGpuBlacklist(*gpu_blacklist_cache); 49 LoadGpuBlacklist(*gpu_blacklist_cache);
49 } 50 }
50 51
51 GpuBlacklistUpdater::~GpuBlacklistUpdater() { } 52 GpuBlacklistUpdater::~GpuBlacklistUpdater() { }
52 53
53 void GpuBlacklistUpdater::Unpack(const DictionaryValue& parsed_json) { 54 void GpuBlacklistUpdater::Unpack(const DictionaryValue& parsed_json) {
54 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 55 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
55 prefs_->Set(prefs::kGpuBlacklist, parsed_json); 56 prefs_->Set(prefs::kGpuBlacklist, parsed_json);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 103 }
103 } 104 }
104 } 105 }
105 } 106 }
106 107
107 // Need to initialize GpuDataManager to load the current GPU blacklist, 108 // Need to initialize GpuDataManager to load the current GPU blacklist,
108 // collect preliminary GPU info, and run through GPU blacklist. 109 // collect preliminary GPU info, and run through GPU blacklist.
109 GpuDataManager* gpu_data_manager = GpuDataManager::GetInstance(); 110 GpuDataManager* gpu_data_manager = GpuDataManager::GetInstance();
110 gpu_data_manager->UpdateGpuBlacklist(gpu_blacklist.release()); 111 gpu_data_manager->UpdateGpuBlacklist(gpu_blacklist.release());
111 } 112 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698