Index: content/public/common/push_event_payload.h |
diff --git a/content/public/common/push_event_payload.h b/content/public/common/push_event_payload.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..732e45e72376dbbe9aacffef016b71851756ed45 |
--- /dev/null |
+++ b/content/public/common/push_event_payload.h |
@@ -0,0 +1,36 @@ |
+// Copyright 2016 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 CONTENT_PUBLIC_COMMON_PUSH_EVENT_PAYLOAD_H_ |
+#define CONTENT_PUBLIC_COMMON_PUSH_EVENT_PAYLOAD_H_ |
+ |
+#include <string> |
+ |
+#include "content/common/content_export.h" |
+ |
+namespace content { |
+ |
+// Structure representing the payload delivered as part of a push message. |
+// This struct contains the decrypted information sent from the push |
+// service as part of a PushEvent as well as metadata about the information. |
+struct CONTENT_EXPORT PushEventPayload { |
+ PushEventPayload() : is_null(true) {} |
+ ~PushEventPayload() {} |
+ |
+ // Method to both set the data string and update the null status. |
+ void setData(const std::string& data_in) { |
+ data = data_in; |
+ is_null = false; |
+ } |
+ |
+ // Data contained in the payload |
Avi (use Gerrit)
2016/01/27 02:51:42
full sentences end in a .
harkness
2016/01/27 11:52:18
Done.
|
+ std::string data; |
+ // Whether the payload is null or not. Payloads can be valid with non-empty |
Avi (use Gerrit)
2016/01/27 02:51:42
blank line separating variables.
harkness
2016/01/27 11:52:18
Done.
|
+ // content, valid with empty content, or null. |
+ bool is_null; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_PUBLIC_COMMON_PUSH_EVENT_PAYLOAD_H_ |