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

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

Issue 1008003003: Teach the PlatformNotificationContext how to delete notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-db-PlatformNotificationContext
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
« no previous file with comments | « no previous file | content/browser/notifications/platform_notification_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/notifications/platform_notification_context.h
diff --git a/content/browser/notifications/platform_notification_context.h b/content/browser/notifications/platform_notification_context.h
index 0f0255cdea2ea431606548aec51968b2be47b26d..cdb39d704ed372c1dc2c12b60b92fd5f399e766f 100644
--- a/content/browser/notifications/platform_notification_context.h
+++ b/content/browser/notifications/platform_notification_context.h
@@ -44,6 +44,8 @@ class CONTENT_EXPORT PlatformNotificationContext
base::Callback<void(bool /* success */,
int64_t /* notification_id */)>;
+ using DeleteResultCallback = base::Callback<void(bool /* success */)>;
+
// Reads the data associated with |notification_id| belonging to |origin|
// from the database. |callback| will be invoked with the success status
// and a reference to the notification database data when completed.
@@ -58,6 +60,13 @@ class CONTENT_EXPORT PlatformNotificationContext
const NotificationDatabaseData& database_data,
const WriteResultCallback& callback);
+ // Deletes all data associated with |notification_id| belonging to |origin|
+ // from the database. |callback| will be invoked with the success status
+ // when the operation has completed.
+ void DeleteNotificationData(int64_t notification_id,
+ const GURL& origin,
+ const DeleteResultCallback& callback);
+
private:
friend class base::RefCountedThreadSafe<PlatformNotificationContext>;
friend class PlatformNotificationContextTest;
@@ -78,19 +87,26 @@ class CONTENT_EXPORT PlatformNotificationContext
const base::Closure& failure_closure);
// Actually reads the notification data from the database. Must only be
- // called on the |task_runner_| thread. Will post a task to |callback| on
- // the IO thread when the operation has completed.
+ // called on the |task_runner_| thread. |callback| will be invoked on the
+ // IO thread when the operation has completed.
void DoReadNotificationData(int64_t notification_id,
const GURL& origin,
const ReadResultCallback& callback);
// Actually writes the notification database to the database. Must only be
- // called on the |task_runner_| thread. Will post a task to |callback| on
- // the IO thread when the operation has completed.
+ // called on the |task_runner_| thread. |callback| will be invoked on the
+ // IO thread when the operation has completed.
void DoWriteNotificationData(const GURL& origin,
const NotificationDatabaseData& database_data,
const WriteResultCallback& callback);
+ // Actually deletes the notification information from the database. Must only
+ // be called on the |task_runner_| thread. |callback| will be invoked on the
+ // IO thread when the operation has completed.
+ void DoDeleteNotificationData(int64_t notification_id,
+ const GURL& origin,
+ const DeleteResultCallback& callback);
+
// Returns the path in which the database should be initialized. May be empty.
base::FilePath GetDatabasePath() const;
« no previous file with comments | « no previous file | content/browser/notifications/platform_notification_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698