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

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

Issue 176823009: Show device information in chrome://gcm-internals page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 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
Index: chrome/browser/services/gcm/gcm_profile_service.h
diff --git a/chrome/browser/services/gcm/gcm_profile_service.h b/chrome/browser/services/gcm/gcm_profile_service.h
index 633a6e8c7356953d3f57ef91c964a75b60e4cec7..3d982077f487dbc67a7a854cd75ea894e0b6afa8 100644
--- a/chrome/browser/services/gcm/gcm_profile_service.h
+++ b/chrome/browser/services/gcm/gcm_profile_service.h
@@ -46,6 +46,8 @@ class GCMProfileService : public BrowserContextKeyedService,
GCMClient::Result result)> RegisterCallback;
typedef base::Callback<void(const std::string& message_id,
GCMClient::Result result)> SendCallback;
+ typedef base::Callback<void(const GCMClient::GCMStatistics& stats)>
+ RequestGCMStatisticsCallback;
// For testing purpose.
class TestingDelegate {
@@ -92,6 +94,19 @@ class GCMProfileService : public BrowserContextKeyedService,
testing_delegate_ = testing_delegate;
}
+ // Returns true if the profile is signed in.
+ bool IsSignedIn() const;
+
+ // Returns true if the gcm client instance has been created.
+ bool IsGCMClientCreated() const;
+
+ // Returns true if the gcm client is ready.
+ bool IsGCMClientReady() const;
+
+ // Get GCM client internal states and statistics. If it has not been created
+ // then stats won't be modified.
+ void RequestGCMStatistics(RequestGCMStatisticsCallback callback);
+
protected:
// Flag that could be set by the testing code to enable GCM. Otherwise,
// tests from official build will fail.
@@ -173,6 +188,7 @@ class GCMProfileService : public BrowserContextKeyedService,
scoped_ptr<base::Value> value);
bool ParsePersistedRegistrationInfo(scoped_ptr<base::Value> value,
RegistrationInfo* registration_info);
+ void RequestGCMStatisticsFinished(GCMClient::GCMStatistics stats);
// Returns the key used to identify the registration info saved into the
// app's state store. Used for testing purpose.
@@ -203,6 +219,9 @@ class GCMProfileService : public BrowserContextKeyedService,
// Callback map (from <app_id, message_id> to callback) for Send.
std::map<std::pair<std::string, std::string>, SendCallback> send_callbacks_;
+ // Callback for RequestGCMStatistics.
+ RequestGCMStatisticsCallback request_gcm_statistics_callback_;
+
// Map from app_id to registration info (sender ids & registration ID).
typedef std::map<std::string, RegistrationInfo> RegistrationInfoMap;
RegistrationInfoMap registration_info_map_;

Powered by Google App Engine
This is Rietveld 408576698