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

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

Issue 266913015: Enable auto-refreshing of the gcm-internals page whenever a GCM activity is recorded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing Jian's comments. 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
« no previous file with comments | « no previous file | google_apis/gcm/gcm_client.h » ('j') | google_apis/gcm/gcm_client.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/services/gcm/gcm_service.cc
diff --git a/chrome/browser/services/gcm/gcm_service.cc b/chrome/browser/services/gcm/gcm_service.cc
index 0b5c74dc601e0143b80e6e65927317069ebc740f..59f18ef3062b5e68be269b5f9b77ff1a8743d3a8 100644
--- a/chrome/browser/services/gcm/gcm_service.cc
+++ b/chrome/browser/services/gcm/gcm_service.cc
@@ -146,6 +146,7 @@ class GCMService::IOWorker : public GCMClient::Delegate {
const std::string& app_id,
const GCMClient::SendErrorDetails& send_error_details) OVERRIDE;
virtual void OnGCMReady() OVERRIDE;
+ virtual void OnActivityRecorded() OVERRIDE;
// Called on IO thread.
void Initialize(scoped_ptr<GCMClientFactory> gcm_client_factory,
@@ -296,6 +297,13 @@ void GCMService::IOWorker::OnGCMReady() {
service_));
}
+void GCMService::IOWorker::OnActivityRecorded() {
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
+ // When an activity is recorded, get all the stats and refresh the UI of
+ // gcm-internals page.
+ GetGCMStatistics(false);
+}
+
void GCMService::IOWorker::Load(const base::WeakPtr<GCMService>& service) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
« no previous file with comments | « no previous file | google_apis/gcm/gcm_client.h » ('j') | google_apis/gcm/gcm_client.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698