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

Unified Diff: base/prefs/pref_service.cc

Issue 839143002: Roll Chrome into Mojo. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rebase Created 5 years, 11 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
« no previous file with comments | « base/prefs/json_pref_store.cc ('k') | base/profiler/tracked_time.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/prefs/pref_service.cc
diff --git a/base/prefs/pref_service.cc b/base/prefs/pref_service.cc
index 7a3b4347c9e76b0a1dc4c236a386742b5d56e915..5afb5ea7c67496fcbc22148af7f77d51fd702ca9 100644
--- a/base/prefs/pref_service.cc
+++ b/base/prefs/pref_service.cc
@@ -53,6 +53,12 @@ PrefService::PrefService(
read_error_callback_(read_error_callback) {
pref_notifier_->SetPrefService(this);
+ // TODO(battre): This is a check for crbug.com/435208 to make sure that
+ // access violations are caused by a use-after-free bug and not by an
+ // initialization bug.
+ CHECK(pref_registry_);
+ CHECK(pref_value_store_);
+
InitFromStorage(async);
}
@@ -562,6 +568,14 @@ bool PrefService::Preference::IsExtensionModifiable() const {
const base::Value* PrefService::GetPreferenceValue(
const std::string& path) const {
DCHECK(CalledOnValidThread());
+
+ // TODO(battre): This is a check for crbug.com/435208. After analyzing some
+ // crash dumps it looks like the PrefService is accessed even though it has
+ // been cleared already.
+ CHECK(pref_registry_);
+ CHECK(pref_registry_->defaults());
+ CHECK(pref_value_store_);
+
const base::Value* default_value = NULL;
if (pref_registry_->defaults()->GetValue(path, &default_value)) {
const base::Value* found_value = NULL;
« no previous file with comments | « base/prefs/json_pref_store.cc ('k') | base/profiler/tracked_time.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698