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

Side by Side Diff: content/public/browser/platform_notification_context.h

Issue 1014703007: The platform notification context should observe the Service Worker Context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-db-ReadAllData
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 unified diff | Download patch
« no previous file with comments | « content/browser/storage_partition_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_CONTEXT_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_CONTEXT_H_
6 #define CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_CONTEXT_H_ 6 #define CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_CONTEXT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/memory/ref_counted.h"
12 11
13 class GURL; 12 class GURL;
14 13
15 namespace content { 14 namespace content {
16 15
17 struct NotificationDatabaseData; 16 struct NotificationDatabaseData;
18 17
19 // Represents the storage context for persistent Web Notifications, specific to 18 // Represents the storage context for persistent Web Notifications, specific to
20 // the storage partition owning the instance. All methods defined in this 19 // the storage partition owning the instance. All methods defined in this
21 // interface may only be used on the IO thread. 20 // interface may only be used on the IO thread.
22 class PlatformNotificationContext 21 class PlatformNotificationContext {
23 : public base::RefCountedThreadSafe<PlatformNotificationContext> {
24 public: 22 public:
25 using ReadResultCallback = 23 using ReadResultCallback =
26 base::Callback<void(bool /* success */, 24 base::Callback<void(bool /* success */,
27 const NotificationDatabaseData&)>; 25 const NotificationDatabaseData&)>;
28 26
29 using WriteResultCallback = 27 using WriteResultCallback =
30 base::Callback<void(bool /* success */, 28 base::Callback<void(bool /* success */,
31 int64_t /* notification_id */)>; 29 int64_t /* notification_id */)>;
32 30
33 using DeleteResultCallback = base::Callback<void(bool /* success */)>; 31 using DeleteResultCallback = base::Callback<void(bool /* success */)>;
(...skipping 14 matching lines...) Expand all
48 const WriteResultCallback& callback) = 0; 46 const WriteResultCallback& callback) = 0;
49 47
50 // Deletes all data associated with |notification_id| belonging to |origin| 48 // Deletes all data associated with |notification_id| belonging to |origin|
51 // from the database. |callback| will be invoked with the success status 49 // from the database. |callback| will be invoked with the success status
52 // when the operation has completed. 50 // when the operation has completed.
53 virtual void DeleteNotificationData(int64_t notification_id, 51 virtual void DeleteNotificationData(int64_t notification_id,
54 const GURL& origin, 52 const GURL& origin,
55 const DeleteResultCallback& callback) = 0; 53 const DeleteResultCallback& callback) = 0;
56 54
57 protected: 55 protected:
58 friend class base::RefCountedThreadSafe<PlatformNotificationContext>;
59
60 virtual ~PlatformNotificationContext() {} 56 virtual ~PlatformNotificationContext() {}
61 }; 57 };
62 58
63 } // namespace content 59 } // namespace content
64 60
65 #endif // CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_CONTEXT_H_ 61 #endif // CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_CONTEXT_H_
OLDNEW
« no previous file with comments | « content/browser/storage_partition_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698