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

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

Issue 1003843002: Add the NotificationDatabaseData structure and protobuf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-db-GetNextNotificationId
Patch Set: Created 5 years, 9 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 2015 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_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_DATA_H_
6 #define CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_DATA_H_
7
8 #include <stdint.h>
9
10 #include "content/common/content_export.h"
11 #include "content/public/common/platform_notification_data.h"
12 #include "url/gurl.h"
13
14 namespace content {
15
16 class NotificationDatabaseDataProto;
17
18 // Stores information about a Web Notification as available in the notification
19 // database. Beyond the notification's own data, its id and attribution need
20 // to be available for users of the database as well.
21 struct CONTENT_EXPORT NotificationDatabaseData {
22 NotificationDatabaseData();
23 ~NotificationDatabaseData();
24
25 // Id of the notification as allocated by the NotificationDatabase.
26 int64_t notification_id;
27
28 // Origin of the website this notification is associated with.
29 GURL origin;
30
31 // Id of the Service Worker registration this notification is associated with.
32 int64_t service_worker_registration_id;
33
34 // Platform data of the notification that's being stored.
35 PlatformNotificationData notification_data;
36 };
37
38 // Converts a NotificationDatabaseData object to the protocol buffer message.
39 CONTENT_EXPORT NotificationDatabaseDataProto ToNotificationDatabaseDataProto(
Bernhard Bauer 2015/03/12 18:11:14 Another thing to think about: Do we even need to e
Bernhard Bauer 2015/03/12 18:11:14 Could you make these methods on the struct, so the
Peter Beverloo 2015/03/12 21:09:52 Done.
Peter Beverloo 2015/03/12 21:09:52 Eventually I envision the NotificationDatabaseData
40 const NotificationDatabaseData& database_data);
41
42 // Converts a NotificationDatabaseDataProto object to the normal C++ structure.
43 CONTENT_EXPORT NotificationDatabaseData ToNotificationDatabaseData(
44 const NotificationDatabaseDataProto& database_data_proto);
45
46 } // namespace content
47
48 #endif // CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698