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

Unified Diff: components/gcm_driver/gcm_client.h

Issue 2578583002: Provide a mechanism for the GCM driver to send message receipts to GCM.
Patch Set: Created 4 years 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: components/gcm_driver/gcm_client.h
diff --git a/components/gcm_driver/gcm_client.h b/components/gcm_driver/gcm_client.h
index c4dd12adc914375e3c8cf118e114589f292a7df5..5eb8938134c5c7555be88c94f68e1785d7f5c16f 100644
--- a/components/gcm_driver/gcm_client.h
+++ b/components/gcm_driver/gcm_client.h
@@ -71,6 +71,19 @@ class GCMClient {
UNKNOWN_ERROR
};
+ // Enumeration to be used for describing the final status of a GCM message.
+ enum GCMMessageStatus {
Peter Beverloo 2016/12/15 19:24:24 Let's move this to its own file. It's not clear to
harkness 2016/12/21 17:23:37 currently still in the GCMClient, but I'm planning
+ // 0 reserved for success.
+ GCM_SUCCESS = 0,
+
+ // 1 - 99 reserved for GCMClient and GCMDriver error status.
Peter Beverloo 2016/12/15 19:24:24 nit: Let's make sure that we pull this separate fr
harkness 2016/12/21 17:23:37 Done.
+ GCM_INVALID_SUBTYPE = 1,
+ GCM_ENCRYPTION_FAILURE = 2,
+ GCM_UNKNOWN_MESSAGE_TYPE = 3,
+ GCM_NO_APP_HANDLER = 4,
+ GCM_INVALID_MESSAGE_TAG = 5,
+ };
+
enum ChromePlatform {
PLATFORM_WIN,
PLATFORM_MAC,
@@ -176,6 +189,14 @@ class GCMClient {
virtual void OnMessageReceived(const std::string& app_id,
const IncomingMessage& message) = 0;
+ // Called when there is an error processing a received message.
+ // |app_id|: application ID.
+ // |message_id|: id of the message received.
+ // |status|: error type.
+ virtual void OnMessageReceivedError(const std::string& app_id,
+ const std::string& message_id,
+ int status) = 0;
+
// Called when some messages have been deleted from the server.
// |app_id|: application ID.
virtual void OnMessagesDeleted(const std::string& app_id) = 0;

Powered by Google App Engine
This is Rietveld 408576698