Chromium Code Reviews| Index: content/child/notifications/notification_manager.h |
| diff --git a/content/child/notifications/notification_manager.h b/content/child/notifications/notification_manager.h |
| index 0f383fa5073c998d3c28c64362814ac46526f6f2..4cd15f377cfa7358b935b6d2ed3864649ffc7363 100644 |
| --- a/content/child/notifications/notification_manager.h |
| +++ b/content/child/notifications/notification_manager.h |
| @@ -9,15 +9,14 @@ |
| #include <stdint.h> |
| #include <map> |
| +#include <memory> |
| #include <set> |
| #include <vector> |
| #include "base/id_map.h" |
| #include "base/macros.h" |
| #include "base/memory/ref_counted.h" |
| -#include "base/single_thread_task_runner.h" |
| #include "content/child/notifications/notification_dispatcher.h" |
| -#include "content/child/notifications/pending_notifications_tracker.h" |
| #include "content/common/platform_notification_messages.h" |
| #include "content/public/child/worker_thread.h" |
| #include "third_party/WebKit/public/platform/modules/notifications/WebNotificationManager.h" |
| @@ -37,19 +36,28 @@ class NotificationManager : public blink::WebNotificationManager, |
| // calling this leads to construction. |
| static NotificationManager* ThreadSpecificInstance( |
| ThreadSafeSender* thread_safe_sender, |
| - base::SingleThreadTaskRunner* main_thread_task_runner, |
| NotificationDispatcher* notification_dispatcher); |
| // WorkerThread::Observer implementation. |
| void WillStopCurrentWorkerThread() override; |
| // blink::WebNotificationManager implementation. |
| - void show(const blink::WebSecurityOrigin& origin, |
| - const blink::WebNotificationData& notification_data, |
| - blink::WebNotificationDelegate* delegate) override; |
| + // Shows a page notification. Will inform the browser process about all |
| + // available data. The |delegate|, owned by Blink, will be used to feed back |
| + // events associated with the notification to the JavaScript object. |
| + void show( |
| + const blink::WebSecurityOrigin& origin, |
| + const blink::WebNotificationData& notification_data, |
| + std::unique_ptr<blink::WebNotificationResources> notification_resources, |
| + blink::WebNotificationDelegate* delegate) override; |
| + // Shows a persistent notification. Will inform the browser process about all |
| + // available data. The |callbacks| will be used to inform the Promise pending |
| + // in Blink that the notification has been sent to the browser process to be |
| + // displayed. |
|
Peter Beverloo
2016/04/15 11:07:29
This seems like an odd place to document behaviour
Michael van Ouwerkerk
2016/04/18 11:26:53
Let's not then. Done.
|
| void showPersistent( |
| const blink::WebSecurityOrigin& origin, |
| const blink::WebNotificationData& notification_data, |
| + std::unique_ptr<blink::WebNotificationResources> notification_resources, |
| blink::WebServiceWorkerRegistration* service_worker_registration, |
| blink::WebNotificationShowCallbacks* callbacks) override; |
| void getNotifications( |
| @@ -70,7 +78,6 @@ class NotificationManager : public blink::WebNotificationManager, |
| private: |
| NotificationManager(ThreadSafeSender* thread_safe_sender, |
| - base::SingleThreadTaskRunner* main_thread_task_runner, |
| NotificationDispatcher* notification_dispatcher); |
| // IPC message handlers. |
| @@ -82,34 +89,9 @@ class NotificationManager : public blink::WebNotificationManager, |
| int request_id, |
| const std::vector<PersistentNotificationInfo>& notification_infos); |
| - // To be called when a page notification is ready to be displayed. Will |
| - // inform the browser process about all available data. The |delegate|, |
| - // owned by Blink, will be used to feed back events associated with the |
| - // notification to the JavaScript object. |
| - void DisplayPageNotification( |
| - const blink::WebSecurityOrigin& origin, |
| - const blink::WebNotificationData& notification_data, |
| - blink::WebNotificationDelegate* delegate, |
| - const NotificationResources& notification_resources); |
| - |
| - // To be called when a persistent notification is ready to be displayed. Will |
| - // inform the browser process about all available data. The |callbacks| will |
| - // be used to inform the Promise pending in Blink that the notification has |
| - // been send to the browser process to be displayed. |
| - void DisplayPersistentNotification( |
| - const blink::WebSecurityOrigin& origin, |
| - const blink::WebNotificationData& notification_data, |
| - int64_t service_worker_registration_id, |
| - std::unique_ptr<blink::WebNotificationShowCallbacks> callbacks, |
| - const NotificationResources& notification_resources); |
| - |
| scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
| scoped_refptr<NotificationDispatcher> notification_dispatcher_; |
| - // Tracker which stores all pending Notifications, both page and persistent |
| - // ones, until all their associated resources have been fetched. |
| - PendingNotificationsTracker notifications_tracker_; |
| - |
| // Tracks pending requests for getting a list of notifications. |
| IDMap<blink::WebNotificationGetCallbacks, IDMapOwnPointer> |
| pending_get_notification_requests_; |