summaryrefslogtreecommitdiffstats
path: root/google_apis
diff options
context:
space:
mode:
authorjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-20 01:18:59 +0000
committerjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-20 01:18:59 +0000
commitb16a7c54c238a22e5f63026ff6a791c33d5ecd49 (patch)
treecfee1626510570d9a4cfadf10b8d9a480e613211 /google_apis
parent6812e4624cd3b42422b806046539d19c38b5579c (diff)
downloadchromium_src-b16a7c54c238a22e5f63026ff6a791c33d5ecd49.zip
chromium_src-b16a7c54c238a22e5f63026ff6a791c33d5ecd49.tar.gz
chromium_src-b16a7c54c238a22e5f63026ff6a791c33d5ecd49.tar.bz2
[GCM] Implement GCMProfileService with threading support.
1) Implement most methods of GCMProfileService with right threading support. 2) Define GCMEventRouter interface for event routing purpose. 3) Add a mock version of GCMClient for testing purpose. BUG=284553 TEST=new tests added R=fgorski@chromium.org, zea@chromium.org Review URL: https://codereview.chromium.org/69953009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236086 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'google_apis')
-rw-r--r--google_apis/gcm/gcm_client.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/google_apis/gcm/gcm_client.h b/google_apis/gcm/gcm_client.h
index 4336732..0080f1c 100644
--- a/google_apis/gcm/gcm_client.h
+++ b/google_apis/gcm/gcm_client.h
@@ -25,6 +25,11 @@ class GCM_EXPORT GCMClient {
enum Result {
// Successful operation.
SUCCESS,
+ // Invalid parameter.
+ INVALID_PARAMETER,
+ // Previous asynchronous operation is still pending to finish. Certain
+ // operation, like register, is only allowed one at a time.
+ ASYNC_OPERATION_PENDING,
// Network socket error.
NETWORK_ERROR,
// Problem at the server.
@@ -36,10 +41,10 @@ class GCM_EXPORT GCMClient {
};
// Message data consisting of key-value pairs.
- typedef const std::map<std::string, std::string> MessageData;
+ typedef std::map<std::string, std::string> MessageData;
// Message to be delivered to the other party.
- struct OutgoingMessage {
+ struct GCM_EXPORT OutgoingMessage {
OutgoingMessage();
~OutgoingMessage();
@@ -51,7 +56,7 @@ class GCM_EXPORT GCMClient {
};
// Message being received from the other party.
- struct IncomingMessage {
+ struct GCM_EXPORT IncomingMessage {
IncomingMessage();
~IncomingMessage();
@@ -59,7 +64,7 @@ class GCM_EXPORT GCMClient {
};
// The check-in info for the user. Returned by the server.
- struct CheckInInfo {
+ struct GCM_EXPORT CheckInInfo {
CheckInInfo() : android_id(0), secret(0) {}
bool IsValid() const { return android_id != 0 && secret != 0; }
@@ -102,10 +107,8 @@ class GCM_EXPORT GCMClient {
// Called when a message has been received.
// |app_id|: application ID.
- // |sender_id|: the registration ID of the sender.
// |message|: message received.
virtual void OnMessageReceived(const std::string& app_id,
- const std::string& sender_id,
const IncomingMessage& message) = 0;
// Called when some messages have been deleted from the server.