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

Unified Diff: google_apis/gcm/public/gcm_types.h

Issue 270873002: Extract GCMClient data types into separate gcm_types.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reupload Created 6 years, 7 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
« no previous file with comments | « google_apis/gcm/gcm_client_impl_unittest.cc ('k') | google_apis/gcm/public/gcm_types.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/public/gcm_types.h
diff --git a/google_apis/gcm/public/gcm_types.h b/google_apis/gcm/public/gcm_types.h
new file mode 100644
index 0000000000000000000000000000000000000000..211393d851802d8118cfe507bc3df2fcfb77034b
--- /dev/null
+++ b/google_apis/gcm/public/gcm_types.h
@@ -0,0 +1,72 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GOOGLE_APIS_GCM_PUBLIC_GCM_TYPES_H_
+#define GOOGLE_APIS_GCM_PUBLIC_GCM_TYPES_H_
+
+#include <map>
+#include <string>
+
+#include "google_apis/gcm/base/gcm_export.h"
+
+namespace gcm {
+
+enum Result {
+ // Successful operation.
+ RESULT_SUCCESS,
+ // Invalid parameter.
+ RESULT_INVALID_PARAMETER,
+ // Profile not signed in.
+ RESULT_NOT_SIGNED_IN,
+ // Previous asynchronous operation is still pending to finish. Certain
+ // operation, like register, is only allowed one at a time.
+ RESULT_ASYNC_OPERATION_PENDING,
+ // Network socket error.
+ RESULT_NETWORK_ERROR,
+ // Problem at the server.
+ RESULT_SERVER_ERROR,
+ // Exceeded the specified TTL during message sending.
+ RESULT_TTL_EXCEEDED,
+ // Other errors.
+ RESULT_UNKNOWN_ERROR
+};
+
+// Message data consisting of key-value pairs.
+typedef std::map<std::string, std::string> MessageData;
+
+// Message to be delivered to the other party.
+struct GCM_EXPORT OutgoingMessage {
+ OutgoingMessage();
+ ~OutgoingMessage();
+
+ // Message ID.
+ std::string id;
+ // In seconds.
+ int time_to_live;
+ MessageData data;
+};
+
+// Message being received from the other party.
+struct GCM_EXPORT IncomingMessage {
+ IncomingMessage();
+ ~IncomingMessage();
+
+ MessageData data;
+ std::string collapse_key;
+ std::string sender_id;
+};
+
+// Detailed information of the Send Error event.
+struct GCM_EXPORT SendErrorDetails {
+ SendErrorDetails();
+ ~SendErrorDetails();
+
+ std::string message_id;
+ MessageData additional_data;
+ Result result;
+};
+
+} // namespace gcm
+
+#endif // GOOGLE_APIS_GCM_PUBLIC_GCM_TYPES_H_
« no previous file with comments | « google_apis/gcm/gcm_client_impl_unittest.cc ('k') | google_apis/gcm/public/gcm_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698