OLD | NEW |
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_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_CONTEXT_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_CONTEXT_IMPL_H_ |
6 #define CONTENT_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_CONTEXT_IMPL_H_ | 6 #define CONTENT_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_CONTEXT_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // PlatformNotificationContext implementation. | 55 // PlatformNotificationContext implementation. |
56 void ReadNotificationData(int64_t notification_id, | 56 void ReadNotificationData(int64_t notification_id, |
57 const GURL& origin, | 57 const GURL& origin, |
58 const ReadResultCallback& callback) override; | 58 const ReadResultCallback& callback) override; |
59 void WriteNotificationData(const GURL& origin, | 59 void WriteNotificationData(const GURL& origin, |
60 const NotificationDatabaseData& database_data, | 60 const NotificationDatabaseData& database_data, |
61 const WriteResultCallback& callback) override; | 61 const WriteResultCallback& callback) override; |
62 void DeleteNotificationData(int64_t notification_id, | 62 void DeleteNotificationData(int64_t notification_id, |
63 const GURL& origin, | 63 const GURL& origin, |
64 const DeleteResultCallback& callback) override; | 64 const DeleteResultCallback& callback) override; |
| 65 void ReadAllNotificationDataForServiceWorkerRegistration( |
| 66 const GURL& origin, |
| 67 int64_t service_worker_registration_id, |
| 68 const ReadAllResultCallback& callback) override; |
65 | 69 |
66 // ServiceWorkerContextObserver implementation. | 70 // ServiceWorkerContextObserver implementation. |
67 void OnRegistrationDeleted(int64_t registration_id, | 71 void OnRegistrationDeleted(int64_t registration_id, |
68 const GURL& pattern) override; | 72 const GURL& pattern) override; |
69 void OnStorageWiped() override; | 73 void OnStorageWiped() override; |
70 | 74 |
71 private: | 75 private: |
72 friend class base::DeleteHelper<PlatformNotificationContextImpl>; | 76 friend class base::DeleteHelper<PlatformNotificationContextImpl>; |
73 friend class base::RefCountedThreadSafe<PlatformNotificationContextImpl, | 77 friend class base::RefCountedThreadSafe<PlatformNotificationContextImpl, |
74 BrowserThread::DeleteOnUIThread>; | 78 BrowserThread::DeleteOnUIThread>; |
(...skipping 18 matching lines...) Expand all Loading... |
93 void OpenDatabase(const base::Closure& success_closure, | 97 void OpenDatabase(const base::Closure& success_closure, |
94 const base::Closure& failure_closure); | 98 const base::Closure& failure_closure); |
95 | 99 |
96 // Actually reads the notification data from the database. Must only be | 100 // Actually reads the notification data from the database. Must only be |
97 // called on the |task_runner_| thread. |callback| will be invoked on the | 101 // called on the |task_runner_| thread. |callback| will be invoked on the |
98 // IO thread when the operation has completed. | 102 // IO thread when the operation has completed. |
99 void DoReadNotificationData(int64_t notification_id, | 103 void DoReadNotificationData(int64_t notification_id, |
100 const GURL& origin, | 104 const GURL& origin, |
101 const ReadResultCallback& callback); | 105 const ReadResultCallback& callback); |
102 | 106 |
| 107 // Actually reads all notification data from the database. Must only be |
| 108 // called on the |task_runner_| thread. |callback| will be invoked on the |
| 109 // IO thread when the operation has completed. |
| 110 void DoReadAllNotificationDataForServiceWorkerRegistration( |
| 111 const GURL& origin, |
| 112 int64_t service_worker_registration_id, |
| 113 const ReadAllResultCallback& callback); |
| 114 |
103 // Actually writes the notification database to the database. Must only be | 115 // Actually writes the notification database to the database. Must only be |
104 // called on the |task_runner_| thread. |callback| will be invoked on the | 116 // called on the |task_runner_| thread. |callback| will be invoked on the |
105 // IO thread when the operation has completed. | 117 // IO thread when the operation has completed. |
106 void DoWriteNotificationData(const GURL& origin, | 118 void DoWriteNotificationData(const GURL& origin, |
107 const NotificationDatabaseData& database_data, | 119 const NotificationDatabaseData& database_data, |
108 const WriteResultCallback& callback); | 120 const WriteResultCallback& callback); |
109 | 121 |
110 // Actually deletes the notification information from the database. Must only | 122 // Actually deletes the notification information from the database. Must only |
111 // be called on the |task_runner_| thread. |callback| will be invoked on the | 123 // be called on the |task_runner_| thread. |callback| will be invoked on the |
112 // IO thread when the operation has completed. | 124 // IO thread when the operation has completed. |
(...skipping 25 matching lines...) Expand all Loading... |
138 | 150 |
139 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 151 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
140 scoped_ptr<NotificationDatabase> database_; | 152 scoped_ptr<NotificationDatabase> database_; |
141 | 153 |
142 DISALLOW_COPY_AND_ASSIGN(PlatformNotificationContextImpl); | 154 DISALLOW_COPY_AND_ASSIGN(PlatformNotificationContextImpl); |
143 }; | 155 }; |
144 | 156 |
145 } // namespace content | 157 } // namespace content |
146 | 158 |
147 #endif // CONTENT_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_CONTEXT_IMPL_H_ | 159 #endif // CONTENT_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_CONTEXT_IMPL_H_ |
OLD | NEW |