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

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

Issue 1057573002: Implement the ability to get all notifications in Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-db-Integrate
Patch Set: Created 5 years, 8 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/public/browser/platform_notification_context.h
diff --git a/content/public/browser/platform_notification_context.h b/content/public/browser/platform_notification_context.h
index 660ff19d018b5d43af7851f9bfc45878c91065ea..74dd47100144fec3f20e0d174528b26fc9b91b82 100644
--- a/content/public/browser/platform_notification_context.h
+++ b/content/public/browser/platform_notification_context.h
@@ -6,15 +6,15 @@
#define CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_CONTEXT_H_
#include <stdint.h>
+#include <vector>
#include "base/callback.h"
+#include "content/public/browser/notification_database_data.h"
class GURL;
namespace content {
-struct NotificationDatabaseData;
-
// Represents the storage context for persistent Web Notifications, specific to
// the storage partition owning the instance. All methods defined in this
// interface may only be used on the IO thread.
@@ -24,6 +24,10 @@ class PlatformNotificationContext {
base::Callback<void(bool /* success */,
const NotificationDatabaseData&)>;
+ using ReadAllResultCallback =
+ base::Callback<void(bool /* success */,
+ const std::vector<NotificationDatabaseData>&)>;
+
using WriteResultCallback =
base::Callback<void(bool /* success */,
int64_t /* notification_id */)>;
@@ -37,6 +41,14 @@ class PlatformNotificationContext {
const GURL& origin,
const ReadResultCallback& callback) = 0;
+ // Reads all data associated with |service_worker_registration_id| belonging
+ // to |origin| from the database. |callback| will be invoked with the success
+ // status and a vector with all read notification data when completed.
+ virtual void ReadAllNotificationDataForServiceWorkerRegistration(
+ const GURL& origin,
+ int64_t service_worker_registration_id,
+ const ReadAllResultCallback& callback) = 0;
+
// Writes the data associated with a notification to a database. When this
// action completed, |callback| will be invoked with the success status and
// the persistent notification id when written successfully.
« no previous file with comments | « content/browser/notifications/platform_notification_context_unittest.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698