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

Unified Diff: google_apis/gcm/gcm_client_impl.cc

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
« google_apis/gcm/gcm_client.cc ('K') | « google_apis/gcm/gcm_client_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/gcm_client_impl.cc
diff --git a/google_apis/gcm/gcm_client_impl.cc b/google_apis/gcm/gcm_client_impl.cc
index d039fdc7a62e652aadb2693a95ffb889d195bdb4..559f86c7aa8797d2a1a2b6489e2e2b2aa1b48592 100644
--- a/google_apis/gcm/gcm_client_impl.cc
+++ b/google_apis/gcm/gcm_client_impl.cc
@@ -401,6 +401,30 @@ bool GCMClientImpl::IsReady() const {
return state_ == READY;
}
+std::string GCMClientImpl::GetStateString(gcm::GCMClientImpl::State state)
+ const {
+ switch(state) {
+ case gcm::GCMClientImpl::UNINITIALIZED:
+ return "UNINITIALIZED";
+ case gcm::GCMClientImpl::LOADING:
+ return "LOADING";
+ case gcm::GCMClientImpl::INITIAL_DEVICE_CHECKIN:
+ return "INITIAL_DEVICE_CHECKIN";
+ case gcm::GCMClientImpl::READY:
+ return "READY";
+ }
+ return std::string();
+}
+
+void GCMClientImpl::GetStatistics(GCMStatistics* stats) const {
+ if (!stats)
+ return;
+// stats->gcm_client_state = GetStateString(state_);
fgorski 2014/02/28 19:52:47 ??
juyik 2014/03/01 00:21:57 This has been fixed in my newer patch.
+ stats->connection_client_created = (mcs_client_.get() != NULL);
+ stats->connection_state = MCSClient::GetStateString(mcs_client_->state());
fgorski 2014/02/28 19:52:47 can MCSClient be NULL here?
juyik 2014/03/01 00:21:57 Fixed in my newer patch.
+ // TODO(juyik): add more statistics such as message metadata list, etc.
+}
+
void GCMClientImpl::OnMessageReceivedFromMCS(const gcm::MCSMessage& message) {
switch (message.tag()) {
case kLoginResponseTag:
« google_apis/gcm/gcm_client.cc ('K') | « google_apis/gcm/gcm_client_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698