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 2a71c314e601a2423c18193429096e43d0edeb06..f46bea80e18773a089911dd49fa4431e450b2c1a 100644 |
| --- a/content/child/notifications/notification_manager.h |
| +++ b/content/child/notifications/notification_manager.h |
| @@ -8,9 +8,10 @@ |
| #include <stddef.h> |
| #include <stdint.h> |
| -#include <map> |
| #include <memory> |
| #include <set> |
| +#include <tuple> |
|
johnme
2016/09/02 15:07:44
Unnecessary?
Peter Beverloo
2016/09/05 15:11:01
Done.
|
| +#include <unordered_map> |
| #include <vector> |
| #include "base/id_map.h" |
| @@ -58,6 +59,7 @@ class NotificationManager : public blink::WebNotificationManager, |
| blink::WebNotificationGetCallbacks* callbacks) override; |
| void close(blink::WebNotificationDelegate* delegate) override; |
| void closePersistent(const blink::WebSecurityOrigin& origin, |
| + const blink::WebString& tag, |
| int64_t persistent_notification_id) override; |
| void notifyDelegateDestroyed( |
| blink::WebNotificationDelegate* delegate) override; |
| @@ -89,8 +91,21 @@ class NotificationManager : public blink::WebNotificationManager, |
| IDMap<blink::WebNotificationShowCallbacks, IDMapOwnPointer> |
| pending_show_notification_requests_; |
| + // Structure holding the information for active non-persistent notifications. |
| + struct ActiveNotificationData { |
| + ActiveNotificationData() = default; |
| + ActiveNotificationData(blink::WebNotificationDelegate* delegate, |
| + const GURL& origin, |
| + const std::string& tag); |
| + ~ActiveNotificationData(); |
| + |
| + blink::WebNotificationDelegate* delegate = nullptr; |
| + GURL origin; |
| + std::string tag; |
| + }; |
| + |
| // Map to store the delegate associated with a notification request Id. |
| - std::map<int, blink::WebNotificationDelegate*> active_page_notifications_; |
| + std::unordered_map<int, ActiveNotificationData> active_page_notifications_; |
| DISALLOW_COPY_AND_ASSIGN(NotificationManager); |
| }; |