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

Unified Diff: chrome/browser/prefs/pref_notifier_impl.cc

Issue 7574002: Be able to print items that do window.print(); window.close() (airline tix e.g.) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 9 years, 4 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: chrome/browser/prefs/pref_notifier_impl.cc
diff --git a/chrome/browser/prefs/pref_notifier_impl.cc b/chrome/browser/prefs/pref_notifier_impl.cc
index 2dd454f948092ed223eeaf2916302ae64ff8a561..bf44dede42aad2191f0b2ab0cb534e24c08d7ba3 100644
--- a/chrome/browser/prefs/pref_notifier_impl.cc
+++ b/chrome/browser/prefs/pref_notifier_impl.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/prefs/pref_notifier_impl.h"
+#include "base/debug/stack_trace.h"
#include "base/stl_util.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/common/chrome_notification_types.h"
@@ -17,11 +18,16 @@ PrefNotifierImpl::PrefNotifierImpl(PrefService* service)
PrefNotifierImpl::~PrefNotifierImpl() {
DCHECK(CalledOnValidThread());
+ bool already_printed_stacktrace = false;
// Verify that there are no pref observers when we shut down.
for (PrefObserverMap::iterator it = pref_observers_.begin();
it != pref_observers_.end(); ++it) {
NotificationObserverList::Iterator obs_iterator(*(it->second));
if (obs_iterator.GetNext()) {
+ if (!already_printed_stacktrace) {
+ already_printed_stacktrace = true;
+ base::debug::StackTrace().PrintBacktrace();
+ }
LOG(WARNING) << "pref observer found at shutdown " << it->first;
}
}

Powered by Google App Engine
This is Rietveld 408576698