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

Unified Diff: chrome/browser/services/gcm/gcm_profile_service.cc

Issue 846473003: Push API: Add temporary debug log to track down crash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@handlercount
Patch Set: Clear debug_instance in destructor Created 5 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/services/gcm/gcm_profile_service.cc
diff --git a/chrome/browser/services/gcm/gcm_profile_service.cc b/chrome/browser/services/gcm/gcm_profile_service.cc
index 0b898ab6881e848b08d5e77a9f68b40da2ae1a4f..7ae5c0d5c775c49ba2d349ea9552ac87a55dc23a 100644
--- a/chrome/browser/services/gcm/gcm_profile_service.cc
+++ b/chrome/browser/services/gcm/gcm_profile_service.cc
@@ -142,10 +142,31 @@ void GCMProfileService::RegisterProfilePrefs(
}
#if defined(OS_ANDROID)
+static GCMProfileService* debug_instance = nullptr;
+
GCMProfileService::GCMProfileService(Profile* profile)
: profile_(profile),
push_messaging_service_(this, profile) {
- DCHECK(!profile->IsOffTheRecord());
+ CHECK(!profile->IsOffTheRecord());
+
+ // TODO(johnme): Remove debug_instance and this logging code once
+ // crbug.com/437827 is fixed.
+ if (debug_instance != nullptr) {
+ LOG(FATAL) << "An instance of GCMProfileService already exists!"
+ << " Old profile: " << debug_instance->profile_ << " "
+ << debug_instance->profile_->GetDebugName() << " "
+ << debug_instance->profile_->GetProfileType() << " "
+ << debug_instance->profile_->IsSupervised() << " "
+ << debug_instance->profile_->IsNewProfile() << " "
+ << debug_instance->profile_->GetStartTime().ToInternalValue()
+ << ", new profile: " << profile << " "
+ << profile->GetDebugName() << " "
+ << profile->GetProfileType() << " "
+ << profile->IsSupervised() << " "
+ << profile->IsNewProfile() << " "
+ << profile->GetStartTime().ToInternalValue();
+ }
+ debug_instance = this;
driver_.reset(new GCMDriverAndroid);
}
@@ -173,6 +194,9 @@ GCMProfileService::GCMProfileService()
}
GCMProfileService::~GCMProfileService() {
+#if defined(OS_ANDROID)
+ debug_instance = nullptr;
+#endif
}
void GCMProfileService::Shutdown() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698