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

Side by Side 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: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
(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 <stddef.h>
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.
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
17
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
18 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
19 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.
20 PushEventPayload() :
21 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
22 {}
23 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.
24 m_data(data),
25 m_isNull(false)
26 {}
27
28 ~PushEventPayload() {}
29
30 void setData(const std::string& data) {
31 m_data = data;
32 m_isNull = false;
33 }
34 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.
35
36 bool isNull() const { return m_isNull; }
37
38 // 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
39 std::string m_data;
40 bool m_isNull;
41
Peter Beverloo 2016/01/25 17:39:07 micro nit: no blank line
harkness 2016/01/26 12:07:20 Done.
42 };
43
44 } // namespace content
45
46 #endif // CONTENT_PUBLIC_COMMON_PUSH_EVENT_PAYLOAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698