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..143bf4750ab48d4cfa266ecfc8c1e22574e987f4 |
--- /dev/null |
+++ b/content/public/common/push_event_payload.h |
@@ -0,0 +1,46 @@ |
+// 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 <stddef.h> |
+ |
+#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. |
Peter Beverloo
2016/01/25 17:39:07
Another thing that would be worthwhile to document
harkness
2016/01/26 12:07:19
I've added a brief description of the fact that we
|
+ |
Peter Beverloo
2016/01/25 17:39:06
micro nit: no need for the blank line
I think you
harkness
2016/01/26 12:07:20
Interestingly, I tried a cl format on this file an
|
+struct CONTENT_EXPORT PushEventPayload { |
Peter Beverloo
2016/01/25 17:39:06
An alternative name for this structure could be "P
harkness
2016/01/26 12:07:20
My goal for the structure was for it to be a possi
|
+public: |
Peter Beverloo
2016/01/25 17:39:07
micro nit: one space indent for the visibility ide
harkness
2016/01/26 12:07:20
Removed, as it was no longer necessary.
|
+ PushEventPayload() : |
+ m_isNull(true) |
Peter Beverloo
2016/01/25 17:39:06
naming: Blink style prefixes members with "m_", an
Peter Beverloo
2016/01/25 17:39:07
micro nit: format the constructor like this:
clas
harkness
2016/01/26 12:07:20
Done.
harkness
2016/01/26 12:07:20
This is actually counter to the Google coding styl
|
+ {} |
+ PushEventPayload(const std::string& data) : |
Peter Beverloo
2016/01/25 17:39:07
We only use this constructor for the service_worke
harkness
2016/01/26 12:07:20
Removed it and updated the test file.
|
+ m_data(data), |
+ m_isNull(false) |
+ {} |
+ |
+ ~PushEventPayload() {} |
+ |
+ void setData(const std::string& data) { |
+ m_data = data; |
+ m_isNull = false; |
+ } |
+ const std::string& getData() const { return m_data; } |
Peter Beverloo
2016/01/25 17:39:06
micro nit: blank line above here
harkness
2016/01/26 12:07:20
Done.
|
+ |
+ bool isNull() const { return m_isNull; } |
+ |
+ // Data contained in the payload |
Peter Beverloo
2016/01/25 17:39:07
I don't mind too strongly, but given that this str
harkness
2016/01/26 12:07:20
Unfortunately, using private members makes IPC una
|
+ std::string m_data; |
+ bool m_isNull; |
+ |
Peter Beverloo
2016/01/25 17:39:07
micro nit: no blank line
harkness
2016/01/26 12:07:20
Done.
|
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_PUBLIC_COMMON_PUSH_EVENT_PAYLOAD_H_ |