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

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

Issue 1099093003: Push API: Forced notifications should use Notifications database (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Peter's review nits Created 5 years, 7 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/notifications/platform_notification_context_impl.h ('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 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/memory/ref_counted.h"
13 #include "content/public/browser/browser_thread.h"
12 #include "content/public/browser/notification_database_data.h" 14 #include "content/public/browser/notification_database_data.h"
13 15
14 class GURL; 16 class GURL;
15 17
16 namespace content { 18 namespace content {
17 19
18 // Represents the storage context for persistent Web Notifications, specific to 20 // Represents the storage context for persistent Web Notifications, specific to
19 // the storage partition owning the instance. All methods defined in this 21 // the storage partition owning the instance. All methods defined in this
20 // interface may only be used on the IO thread. 22 // interface may only be used on the IO thread.
21 class PlatformNotificationContext { 23 class PlatformNotificationContext
24 : public base::RefCountedThreadSafe<PlatformNotificationContext,
25 BrowserThread::DeleteOnUIThread> {
22 public: 26 public:
23 using ReadResultCallback = 27 using ReadResultCallback =
24 base::Callback<void(bool /* success */, 28 base::Callback<void(bool /* success */,
25 const NotificationDatabaseData&)>; 29 const NotificationDatabaseData&)>;
26 30
27 using ReadAllResultCallback = 31 using ReadAllResultCallback =
28 base::Callback<void(bool /* success */, 32 base::Callback<void(bool /* success */,
29 const std::vector<NotificationDatabaseData>&)>; 33 const std::vector<NotificationDatabaseData>&)>;
30 34
31 using WriteResultCallback = 35 using WriteResultCallback =
(...skipping 26 matching lines...) Expand all
58 const WriteResultCallback& callback) = 0; 62 const WriteResultCallback& callback) = 0;
59 63
60 // Deletes all data associated with |notification_id| belonging to |origin| 64 // Deletes all data associated with |notification_id| belonging to |origin|
61 // from the database. |callback| will be invoked with the success status 65 // from the database. |callback| will be invoked with the success status
62 // when the operation has completed. 66 // when the operation has completed.
63 virtual void DeleteNotificationData(int64_t notification_id, 67 virtual void DeleteNotificationData(int64_t notification_id,
64 const GURL& origin, 68 const GURL& origin,
65 const DeleteResultCallback& callback) = 0; 69 const DeleteResultCallback& callback) = 0;
66 70
67 protected: 71 protected:
72 friend class base::DeleteHelper<PlatformNotificationContext>;
73 friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>;
74
68 virtual ~PlatformNotificationContext() {} 75 virtual ~PlatformNotificationContext() {}
69 }; 76 };
70 77
71 } // namespace content 78 } // namespace content
72 79
73 #endif // CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_CONTEXT_H_ 80 #endif // CONTENT_PUBLIC_BROWSER_PLATFORM_NOTIFICATION_CONTEXT_H_
OLDNEW
« no previous file with comments | « content/browser/notifications/platform_notification_context_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698