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

Side by Side Diff: extensions/browser/event_listener_map.h

Issue 2294653002: Some linked_ptr -> unique_ptr conversion in extensions/browser. (Closed)
Patch Set: address comments Created 4 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 EXTENSIONS_BROWSER_EVENT_LISTENER_MAP_H_ 5 #ifndef EXTENSIONS_BROWSER_EVENT_LISTENER_MAP_H_
6 #define EXTENSIONS_BROWSER_EVENT_LISTENER_MAP_H_ 6 #define EXTENSIONS_BROWSER_EVENT_LISTENER_MAP_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 std::unique_ptr<base::DictionaryValue> filter_; 99 std::unique_ptr<base::DictionaryValue> filter_;
100 EventFilter::MatcherID matcher_id_; // -1 if unset. 100 EventFilter::MatcherID matcher_id_; // -1 if unset.
101 101
102 DISALLOW_COPY_AND_ASSIGN(EventListener); 102 DISALLOW_COPY_AND_ASSIGN(EventListener);
103 }; 103 };
104 104
105 // Holds listeners for extension events and can answer questions about which 105 // Holds listeners for extension events and can answer questions about which
106 // listeners are interested in what events. 106 // listeners are interested in what events.
107 class EventListenerMap { 107 class EventListenerMap {
108 public: 108 public:
109 typedef std::vector<linked_ptr<EventListener> > ListenerList; 109 using ListenerList = std::vector<std::unique_ptr<EventListener>>;
110 110
111 class Delegate { 111 class Delegate {
112 public: 112 public:
113 virtual ~Delegate() {} 113 virtual ~Delegate() {}
114 virtual void OnListenerAdded(const EventListener* listener) = 0; 114 virtual void OnListenerAdded(const EventListener* listener) = 0;
115 virtual void OnListenerRemoved(const EventListener* listener) = 0; 115 virtual void OnListenerRemoved(const EventListener* listener) = 0;
116 }; 116 };
117 117
118 explicit EventListenerMap(Delegate* delegate); 118 explicit EventListenerMap(Delegate* delegate);
119 ~EventListenerMap(); 119 ~EventListenerMap();
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 std::map<EventFilter::MatcherID, EventListener*> listeners_by_matcher_id_; 190 std::map<EventFilter::MatcherID, EventListener*> listeners_by_matcher_id_;
191 191
192 EventFilter event_filter_; 192 EventFilter event_filter_;
193 193
194 DISALLOW_COPY_AND_ASSIGN(EventListenerMap); 194 DISALLOW_COPY_AND_ASSIGN(EventListenerMap);
195 }; 195 };
196 196
197 } // namespace extensions 197 } // namespace extensions
198 198
199 #endif // EXTENSIONS_BROWSER_EVENT_LISTENER_MAP_H_ 199 #endif // EXTENSIONS_BROWSER_EVENT_LISTENER_MAP_H_
OLDNEW
« no previous file with comments | « extensions/browser/declarative_user_script_manager.cc ('k') | extensions/browser/event_listener_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698