OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_PUBLIC_COMMON_PUSH_EVENT_PAYLOAD_H_ |
| 6 #define CONTENT_PUBLIC_COMMON_PUSH_EVENT_PAYLOAD_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "content/common/content_export.h" |
| 11 |
| 12 namespace content { |
| 13 |
| 14 // Structure representing the payload delivered as part of a push message. |
| 15 // This struct contains the decrypted information sent from the push |
| 16 // service as part of a PushEvent as well as metadata about the information. |
| 17 struct CONTENT_EXPORT PushEventPayload { |
| 18 PushEventPayload() : is_null(true) {} |
| 19 ~PushEventPayload() {} |
| 20 |
| 21 // Method to both set the data string and update the null status. |
| 22 void setData(const std::string& data_in) { |
| 23 data = data_in; |
| 24 is_null = false; |
| 25 } |
| 26 |
| 27 // Data contained in the payload. |
| 28 std::string data; |
| 29 |
| 30 // Whether the payload is null or not. Payloads can be valid with non-empty |
| 31 // content, valid with empty content, or null. |
| 32 bool is_null; |
| 33 }; |
| 34 |
| 35 } // namespace content |
| 36 |
| 37 #endif // CONTENT_PUBLIC_COMMON_PUSH_EVENT_PAYLOAD_H_ |
OLD | NEW |