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

Side by Side Diff: google_apis/gcm/gcm_client.h

Issue 176823009: Show device information in chrome://gcm-internals page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Display android id as well. Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef GOOGLE_APIS_GCM_GCM_CLIENT_H_ 5 #ifndef GOOGLE_APIS_GCM_GCM_CLIENT_H_
6 #define GOOGLE_APIS_GCM_GCM_CLIENT_H_ 6 #define GOOGLE_APIS_GCM_GCM_CLIENT_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 }; 71 };
72 72
73 // Message being received from the other party. 73 // Message being received from the other party.
74 struct GCM_EXPORT IncomingMessage { 74 struct GCM_EXPORT IncomingMessage {
75 IncomingMessage(); 75 IncomingMessage();
76 ~IncomingMessage(); 76 ~IncomingMessage();
77 77
78 MessageData data; 78 MessageData data;
79 }; 79 };
80 80
81 // Internal states and activity statistics of a GCM client.
82 struct GCM_EXPORT GCMStatistics {
83 public:
84 GCMStatistics();
85 ~GCMStatistics();
86
87 bool gcm_client_created;
88 std::string gcm_client_state;
89 bool connection_client_created;
90 std::string connection_state;
91 uint64 android_id;
92 };
93
81 // A delegate interface that allows the GCMClient instance to interact with 94 // A delegate interface that allows the GCMClient instance to interact with
82 // its caller, i.e. notifying asynchronous event. 95 // its caller, i.e. notifying asynchronous event.
83 class Delegate { 96 class Delegate {
84 public: 97 public:
85 // Called when the registration completed successfully or an error occurs. 98 // Called when the registration completed successfully or an error occurs.
86 // |app_id|: application ID. 99 // |app_id|: application ID.
87 // |registration_id|: non-empty if the registration completed successfully. 100 // |registration_id|: non-empty if the registration completed successfully.
88 // |result|: the type of the error if an error occured, success otherwise. 101 // |result|: the type of the error if an error occured, success otherwise.
89 virtual void OnRegisterFinished(const std::string& app_id, 102 virtual void OnRegisterFinished(const std::string& app_id,
90 const std::string& registration_id, 103 const std::string& registration_id,
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 virtual void Unregister(const std::string& app_id) = 0; 189 virtual void Unregister(const std::string& app_id) = 0;
177 190
178 // Sends a message to a given receiver. Delegate::OnSendFinished will be 191 // Sends a message to a given receiver. Delegate::OnSendFinished will be
179 // called asynchronously upon completion. 192 // called asynchronously upon completion.
180 // |app_id|: application ID. 193 // |app_id|: application ID.
181 // |receiver_id|: registration ID of the receiver party. 194 // |receiver_id|: registration ID of the receiver party.
182 // |message|: message to be sent. 195 // |message|: message to be sent.
183 virtual void Send(const std::string& app_id, 196 virtual void Send(const std::string& app_id,
184 const std::string& receiver_id, 197 const std::string& receiver_id,
185 const OutgoingMessage& message) = 0; 198 const OutgoingMessage& message) = 0;
199
200 // Gets internal states and statistics.
201 virtual GCMStatistics GetStatistics() const = 0;
186 }; 202 };
187 203
188 } // namespace gcm 204 } // namespace gcm
189 205
190 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_H_ 206 #endif // GOOGLE_APIS_GCM_GCM_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698