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

Unified Diff: chrome/browser/lifetime/keep_alive_registry.cc

Issue 2719813005: CrOS: Add print statements to help debug BrowserProcessImpl::Unpin crash. (Closed)
Patch Set: Added dumps. Created 3 years, 9 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/lifetime/keep_alive_registry.cc
diff --git a/chrome/browser/lifetime/keep_alive_registry.cc b/chrome/browser/lifetime/keep_alive_registry.cc
index f61ef82706df2cd271f97e0e78fa3266f35d7a13..09cc05dd6b32ae439766b4d384b427bc25f3926b 100644
--- a/chrome/browser/lifetime/keep_alive_registry.cc
+++ b/chrome/browser/lifetime/keep_alive_registry.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/lifetime/keep_alive_registry.h"
+#include <sstream>
+
#include "chrome/browser/browser_process.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/lifetime/keep_alive_state_observer.h"
@@ -67,6 +69,12 @@ bool KeepAliveRegistry::WouldRestartWithout(
return registered_count == restart_allowed_count;
}
+std::string KeepAliveRegistry::ToString() const {
+ std::stringstream stream;
+ stream << *this;
sky 2017/03/22 03:56:16 Are you sure this returns something helpful?
+ return stream.str();
+}
+
////////////////////////////////////////////////////////////////////////////////
// Private methods
@@ -74,7 +82,9 @@ KeepAliveRegistry::KeepAliveRegistry()
: registered_count_(0), restart_allowed_count_(0) {}
KeepAliveRegistry::~KeepAliveRegistry() {
- DLOG_IF(ERROR, registered_count_ > 0 || registered_keep_alives_.size() > 0)
+ // TODO(sammiequon): Change all VLOGS back to DVLOGS in this file once
+ // crbug.com/660962 is resolved.
+ VLOG_IF(1, registered_count_ > 0 || registered_keep_alives_.size() > 0)
sky 2017/03/22 03:56:16 !empty()
<< "KeepAliveRegistry not empty at destruction time. State:" << *this;
}
@@ -102,7 +112,7 @@ void KeepAliveRegistry::Register(KeepAliveOrigin origin,
if (new_restart_allowed != old_restart_allowed)
OnRestartAllowedChanged(new_restart_allowed);
- DVLOG(1) << "New state of the KeepAliveRegistry: " << *this;
+ VLOG(1) << "New state of the KeepAliveRegistry: " << *this;
}
void KeepAliveRegistry::Unregister(KeepAliveOrigin origin,
@@ -130,19 +140,19 @@ void KeepAliveRegistry::Unregister(KeepAliveOrigin origin,
if (new_restart_allowed != old_restart_allowed)
OnRestartAllowedChanged(new_restart_allowed);
- DVLOG(1) << "New state of the KeepAliveRegistry:" << *this;
+ VLOG(1) << "New state of the KeepAliveRegistry:" << *this;
}
void KeepAliveRegistry::OnKeepAliveStateChanged(bool new_keeping_alive) {
- DVLOG(1) << "Notifying KeepAliveStateObservers: KeepingAlive changed to: "
- << new_keeping_alive;
+ VLOG(1) << "Notifying KeepAliveStateObservers: KeepingAlive changed to: "
+ << new_keeping_alive;
for (KeepAliveStateObserver& observer : observers_)
observer.OnKeepAliveStateChanged(new_keeping_alive);
}
void KeepAliveRegistry::OnRestartAllowedChanged(bool new_restart_allowed) {
- DVLOG(1) << "Notifying KeepAliveStateObservers: Restart changed to: "
- << new_restart_allowed;
+ VLOG(1) << "Notifying KeepAliveStateObservers: Restart changed to: "
+ << new_restart_allowed;
for (KeepAliveStateObserver& observer : observers_)
observer.OnKeepAliveRestartStateChanged(new_restart_allowed);
}

Powered by Google App Engine
This is Rietveld 408576698