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

Unified Diff: content/public/common/push_event_payload.h

Issue 1636483002: Update the PushEvent to have a nullable PushMessageData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review comments and include Created 4 years, 11 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
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..a560cdac69b10a725176ea22ff15718b23f41f57
--- /dev/null
+++ b/content/public/common/push_event_payload.h
@@ -0,0 +1,37 @@
+// 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.
+ std::string data;
+
+ // 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_
« no previous file with comments | « content/public/browser/browser_context.h ('k') | content/renderer/service_worker/service_worker_context_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698