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

Unified Diff: base/prefs/pref_service.cc

Issue 290083006: Store a stacktrace of PrefService destruction in PrefChangeRegistrar (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compilation Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/prefs/pref_observer.h ('k') | base/prefs/pref_value_store_unittest.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 a8e56d0b370680f9400e8432014d08b357fc4179..bdc0b399beadec4efabc092e2bb5d2c18ab2bcb8 100644
--- a/base/prefs/pref_service.cc
+++ b/base/prefs/pref_service.cc
@@ -7,6 +7,8 @@
#include <algorithm>
#include "base/bind.h"
+// TODO(battre): Delete this. See crbug.com/373435.
+#include "base/debug/stack_trace.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
@@ -59,6 +61,13 @@ PrefService::PrefService(
PrefService::~PrefService() {
DCHECK(CalledOnValidThread());
+ // TODO(battre): Remove the following code. It's purpose is to understand
+ // whether a crash in PrefChangeRegistrar::~PrefChangeRegistrar() is caused
+ // by a PrefService already being dead. See crbug.com/373435.
+ std::string stack_trace = base::debug::StackTrace().ToString();
+ static_cast<PrefNotifier*>(pref_notifier_.get())
+ ->BroadcastPrefServiceDestructionTrace(stack_trace);
+
// Reset pointers so accesses after destruction reliably crash.
pref_value_store_.reset();
pref_registry_ = NULL;
« no previous file with comments | « base/prefs/pref_observer.h ('k') | base/prefs/pref_value_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698