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

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: Minor improvements 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
Index: base/prefs/pref_service.cc
diff --git a/base/prefs/pref_service.cc b/base/prefs/pref_service.cc
index a8e56d0b370680f9400e8432014d08b357fc4179..e62d1ee25741861033eb3f456c126e092d5ba08b 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,12 @@ 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 stacktrace = base::debug::StackTrace().ToString();
+ pref_notifier_->SetPrefServiceDestructionTrace(stacktrace);
+
// Reset pointers so accesses after destruction reliably crash.
pref_value_store_.reset();
pref_registry_ = NULL;

Powered by Google App Engine
This is Rietveld 408576698