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

Unified Diff: chrome/browser/browser_process_impl.cc

Issue 9375037: Add some instrumentation to BrowserProcessImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 | « chrome/browser/browser_process_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_process_impl.cc
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 3e861a14f00d3608bb3cf6556a57ea8f5824596e..6c5a17b4ad2956f4fec6de59fcd1af25ae996b75 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -11,6 +11,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/command_line.h"
+#include "base/debug/alias.h"
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/synchronization/waitable_event.h"
@@ -244,7 +245,16 @@ static void Signal(base::WaitableEvent* event) {
unsigned int BrowserProcessImpl::AddRefModule() {
DCHECK(CalledOnValidThread());
- CHECK(!IsShuttingDown());
+
+ // CHECK(!IsShuttingDown());
+ if (IsShuttingDown()) {
+ // Copy the stacktrace which released the final reference onto our stack so
+ // it will be available in the crash report for inspection.
+ base::debug::StackTrace callstack = release_last_reference_callstack_;
+ base::debug::Alias(&callstack);
+ CHECK(false);
+ }
+
did_start_ = true;
module_ref_count_++;
return module_ref_count_;
@@ -255,6 +265,8 @@ unsigned int BrowserProcessImpl::ReleaseModule() {
DCHECK_NE(0u, module_ref_count_);
module_ref_count_--;
if (0 == module_ref_count_) {
+ release_last_reference_callstack_ = base::debug::StackTrace();
+
CHECK(MessageLoop::current()->is_running());
// Allow UI and IO threads to do blocking IO on shutdown, since we do a lot
// of it on shutdown for valid reasons.
« no previous file with comments | « chrome/browser/browser_process_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698