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

Side by Side Diff: content/public/browser/notification_database_data.h

Issue 2300093002: Make //content responsible for generating notification Ids (Closed)
Patch Set: rebase + comments Created 4 years, 3 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_PUBLIC_BROWSER_NOTIFICATION_DATABASE_DATA_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_NOTIFICATION_DATABASE_DATA_H_
6 #define CONTENT_PUBLIC_BROWSER_NOTIFICATION_DATABASE_DATA_H_ 6 #define CONTENT_PUBLIC_BROWSER_NOTIFICATION_DATABASE_DATA_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string>
9 10
11 #include "content/common/content_export.h"
10 #include "content/public/common/platform_notification_data.h" 12 #include "content/public/common/platform_notification_data.h"
11 #include "url/gurl.h" 13 #include "url/gurl.h"
12 14
13 namespace content { 15 namespace content {
14 16
15 // Stores information about a Web Notification as available in the notification 17 // Stores information about a Web Notification as available in the notification
16 // database. Beyond the notification's own data, its id and attribution need 18 // database. Beyond the notification's own data, its id and attribution need
17 // to be available for users of the database as well. 19 // to be available for users of the database as well.
18 struct NotificationDatabaseData { 20 struct CONTENT_EXPORT NotificationDatabaseData {
19 // Id of the notification as allocated by the NotificationDatabase. 21 NotificationDatabaseData();
20 int64_t notification_id = 0; 22 NotificationDatabaseData(const NotificationDatabaseData& other);
piman 2016/09/08 17:12:49 nit: worth adding a move constructor to avoid copy
Peter Beverloo 2016/09/08 18:56:03 I've added the assignment operator to this class.
23 ~NotificationDatabaseData();
24
25 // Id of the notification as assigned by the NotificationIdGenerator.
26 std::string notification_id;
21 27
22 // Origin of the website this notification is associated with. 28 // Origin of the website this notification is associated with.
23 GURL origin; 29 GURL origin;
24 30
25 // Id of the Service Worker registration this notification is associated with. 31 // Id of the Service Worker registration this notification is associated with.
26 int64_t service_worker_registration_id = 0; 32 int64_t service_worker_registration_id = 0;
27 33
28 // Platform data of the notification that's being stored. 34 // Platform data of the notification that's being stored.
29 PlatformNotificationData notification_data; 35 PlatformNotificationData notification_data;
30 }; 36 };
31 37
32 } // namespace content 38 } // namespace content
33 39
34 #endif // CONTENT_PUBLIC_BROWSER_NOTIFICATION_DATABASE_DATA_H_ 40 #endif // CONTENT_PUBLIC_BROWSER_NOTIFICATION_DATABASE_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698