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

Side by Side Diff: content/renderer/active_notification_tracker.h

Issue 740543003: Remove the old Web Notification code-path (Chromium) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unittest references Created 6 years, 1 month 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/renderer/BUILD.gn ('k') | content/renderer/active_notification_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_ACTIVE_NOTIFICATION_TRACKER_H_
6 #define CONTENT_RENDERER_ACTIVE_NOTIFICATION_TRACKER_H_
7
8 #include <map>
9
10 #include "base/basictypes.h"
11 #include "base/containers/hash_tables.h"
12 #include "base/id_map.h"
13 #include "content/common/content_export.h"
14 #include "third_party/WebKit/public/web/WebNotification.h"
15
16 namespace content {
17
18 // This class manages the set of active Notification objects in either
19 // a render or worker process. This class should be accessed only on
20 // the main thread.
21 class CONTENT_EXPORT ActiveNotificationTracker {
22 public:
23 ActiveNotificationTracker();
24 ~ActiveNotificationTracker();
25
26 // Methods for tracking active notification objects.
27 int RegisterNotification(const blink::WebNotification& notification);
28 void UnregisterNotification(int id);
29 bool GetId(const blink::WebNotification& notification, int& id);
30 bool GetNotification(int id, blink::WebNotification* notification);
31
32 // Clears out all active notifications. Useful on page navigation.
33 void Clear();
34
35 private:
36 typedef std::map<blink::WebNotification, int> ReverseTable;
37
38 // Tracking maps for active notifications.
39 IDMap<blink::WebNotification> notification_table_;
40 ReverseTable reverse_notification_table_;
41
42 DISALLOW_COPY_AND_ASSIGN(ActiveNotificationTracker);
43 };
44
45 } // namespace content
46
47 #endif // CONTENT_RENDERER_ACTIVE_NOTIFICATION_TRACKER_H_
OLDNEW
« no previous file with comments | « content/renderer/BUILD.gn ('k') | content/renderer/active_notification_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698