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

Unified Diff: content/browser/notifications/notification_database.h

Issue 2300093002: Make //content responsible for generating notification Ids (Closed)
Patch Set: Make //content responsible for generating notification Ids 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/notifications/notification_database.h
diff --git a/content/browser/notifications/notification_database.h b/content/browser/notifications/notification_database.h
index c08dbfeba7a32615603e92a5eecd301bb743446f..0de91faf5c7560c041f8a734b472488fb601a131 100644
--- a/content/browser/notifications/notification_database.h
+++ b/content/browser/notifications/notification_database.h
@@ -79,10 +79,10 @@ class CONTENT_EXPORT NotificationDatabase {
Status Open(bool create_if_missing);
// Reads the notification data for the notification identified by
- // |notification_id| and belonging to |origin| from the database, and stores
- // it in |notification_database_data|. Returns the status code.
+ // |persistent_notification_id| and belonging to |origin| from the database,
+ // and stores it in |notification_database_data|. Returns the status code.
Status ReadNotificationData(
- int64_t notification_id,
+ int64_t persistent_notification_id,
const GURL& origin,
NotificationDatabaseData* notification_database_data) const;
@@ -107,17 +107,19 @@ class CONTENT_EXPORT NotificationDatabase {
// Writes the |notification_database_data| for a new notification belonging to
// |origin| to the database, and returns the status code of the writing
- // operation. The id of the new notification will be set in |notification_id|.
+ // operation. The id of the new notification will be written to
+ // |persistent_notification_id|.
Status WriteNotificationData(
const GURL& origin,
const NotificationDatabaseData& notification_database_data,
- int64_t* notification_id);
+ int64_t* persistent_notification_id);
// Deletes all data associated with the notification identified by
- // |notification_id| belonging to |origin| from the database. Returns the
- // status code of the deletion operation. Note that it is not considered a
- // failure if the to-be-deleted notification does not exist.
- Status DeleteNotificationData(int64_t notification_id, const GURL& origin);
+ // |persistent_notification_id| belonging to |origin| from the database.
+ // Returns the status code of the deletion operation. Note that it is not
+ // considered a failure if the to-be-deleted notification does not exist.
+ Status DeleteNotificationData(int64_t persistent_notification_id,
+ const GURL& origin);
// Deletes all data associated with |origin| from the database, optionally
// filtered by the |tag|, and appends the deleted notification ids to
@@ -137,6 +139,19 @@ class CONTENT_EXPORT NotificationDatabase {
int64_t service_worker_registration_id,
std::set<int64_t>* deleted_notification_set);
+ // Stores an association of |notification_id| to |persistent_notification_id|
+ // to the database. Returns the status code of the operation.
+ Status StoreIdAssociation(const std::string& notification_id,
+ int64_t persistent_notification_id);
+
+ // Reads the |*persistent_notification_id| that is associated with the
+ // |notification_id|. Returns the status code of the operation.
+ Status ReadIdAssociation(const std::string& notification_id,
+ int64_t* persistent_notification_id);
+
+ // Removes the association stored for the given |notification_id|.
+ Status DeleteIdAssociation(const std::string& notification_id);
+
// Completely destroys the contents of this database.
Status Destroy();

Powered by Google App Engine
This is Rietveld 408576698