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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/notifications/notification_database_data.h
diff --git a/content/browser/notifications/notification_database_data.h b/content/browser/notifications/notification_database_data.h
new file mode 100644
index 0000000000000000000000000000000000000000..53f3fba3096361b260f73c7026a9dde494354046
--- /dev/null
+++ b/content/browser/notifications/notification_database_data.h
@@ -0,0 +1,48 @@
+// Copyright 2015 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_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_DATA_H_
+#define CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_DATA_H_
+
+#include <stdint.h>
+
+#include "content/common/content_export.h"
+#include "content/public/common/platform_notification_data.h"
+#include "url/gurl.h"
+
+namespace content {
+
+class NotificationDatabaseDataProto;
+
+// Stores information about a Web Notification as available in the notification
+// database. Beyond the notification's own data, its id and attribution need
+// to be available for users of the database as well.
+struct CONTENT_EXPORT NotificationDatabaseData {
+ NotificationDatabaseData();
+ ~NotificationDatabaseData();
+
+ // Id of the notification as allocated by the NotificationDatabase.
+ int64_t notification_id;
+
+ // Origin of the website this notification is associated with.
+ GURL origin;
+
+ // Id of the Service Worker registration this notification is associated with.
+ int64_t service_worker_registration_id;
+
+ // Platform data of the notification that's being stored.
+ PlatformNotificationData notification_data;
+};
+
+// Converts a NotificationDatabaseData object to the protocol buffer message.
+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
+ const NotificationDatabaseData& database_data);
+
+// Converts a NotificationDatabaseDataProto object to the normal C++ structure.
+CONTENT_EXPORT NotificationDatabaseData ToNotificationDatabaseData(
+ const NotificationDatabaseDataProto& database_data_proto);
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_DATA_H_

Powered by Google App Engine
This is Rietveld 408576698