Chromium Code Reviews| 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..0c01a594378a791988a9f47f2f7ec1209e69b32f |
| --- /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 <stddef.h> |
|
Peter Beverloo
2016/01/26 12:35:18
What do we use stddef.h for?
We should include <s
harkness
2016/01/26 14:49:20
Done.
|
| + |
| +#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) { |
| + data_ = data; |
| + is_null_ = false; |
| + } |
| + |
| + // Data contained in the payload |
| + std::string data_; |
|
Peter Beverloo
2016/01/26 12:35:18
Sorry! Since this is a struct, we should not have
harkness
2016/01/26 14:49:20
Done.
|
| + // Whether the payload is null or not. Payloads can be valid with non-empty |
| + // content, valid with empty content, or null. |
| + bool is_null_; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_COMMON_PUSH_EVENT_PAYLOAD_H_ |