summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/gpu_data_manager.cc4
-rw-r--r--chrome/browser/gpu_data_manager.h3
-rw-r--r--chrome/browser/web_resource/gpu_blacklist_updater.cc5
3 files changed, 5 insertions, 7 deletions
diff --git a/chrome/browser/gpu_data_manager.cc b/chrome/browser/gpu_data_manager.cc
index d708f3d..f86253d 100644
--- a/chrome/browser/gpu_data_manager.cc
+++ b/chrome/browser/gpu_data_manager.cc
@@ -31,8 +31,7 @@ GpuDataManager::GpuDataManager()
// we handle the case where local_state == NULL for certain tests.
if (local_state) {
local_state->RegisterDictionaryPref(prefs::kGpuBlacklist);
- gpu_blacklist_cache_ =
- local_state->GetMutableDictionary(prefs::kGpuBlacklist);
+ gpu_blacklist_cache_ = local_state->GetDictionary(prefs::kGpuBlacklist);
DCHECK(gpu_blacklist_cache_);
gpu_blacklist_updater_ = new GpuBlacklistUpdater();
@@ -281,4 +280,3 @@ GpuBlacklist* GpuDataManager::GetGpuBlacklist() {
return NULL;
return gpu_blacklist_.get();
}
-
diff --git a/chrome/browser/gpu_data_manager.h b/chrome/browser/gpu_data_manager.h
index 5646307..8d9b096 100644
--- a/chrome/browser/gpu_data_manager.h
+++ b/chrome/browser/gpu_data_manager.h
@@ -99,7 +99,7 @@ class GpuDataManager {
scoped_refptr<GpuBlacklistUpdater> gpu_blacklist_updater_;
// This is the version cached in local state that's automatically updated
// from the web.
- DictionaryValue* gpu_blacklist_cache_;
+ const DictionaryValue* gpu_blacklist_cache_;
// Map of callbacks.
std::set<Callback0::Type*> gpu_info_update_callbacks_;
@@ -110,4 +110,3 @@ class GpuDataManager {
};
#endif // CHROME_BROWSER_GPU_DATA_MANAGER_H_
-
diff --git a/chrome/browser/web_resource/gpu_blacklist_updater.cc b/chrome/browser/web_resource/gpu_blacklist_updater.cc
index a12f6fd..3c5897be 100644
--- a/chrome/browser/web_resource/gpu_blacklist_updater.cc
+++ b/chrome/browser/web_resource/gpu_blacklist_updater.cc
@@ -7,6 +7,7 @@
#include "base/values.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/prefs/pref_service.h"
+#include "chrome/browser/prefs/scoped_user_pref_update.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/pref_names.h"
@@ -41,8 +42,8 @@ GpuBlacklistUpdater::~GpuBlacklistUpdater() { }
void GpuBlacklistUpdater::Unpack(const DictionaryValue& parsed_json) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DictionaryValue* gpu_blacklist_cache =
- prefs_->GetMutableDictionary(prefs::kGpuBlacklist);
+ DictionaryPrefUpdate update(prefs_, prefs::kGpuBlacklist);
+ DictionaryValue* gpu_blacklist_cache = update.Get();
DCHECK(gpu_blacklist_cache);
gpu_blacklist_cache->Clear();
gpu_blacklist_cache->MergeDictionary(&parsed_json);