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

Unified Diff: extensions/browser/event_listener_map.h

Issue 2887293003: Modernize some extensions code. (Closed)
Patch Set: address comments Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/event_listener_map.h
diff --git a/extensions/browser/event_listener_map.h b/extensions/browser/event_listener_map.h
index c8a8275ee3196c9acb294d3979989978c541af91..cd694ac76baf86a8314bbe808a6a0f660506f5e9 100644
--- a/extensions/browser/event_listener_map.h
+++ b/extensions/browser/event_listener_map.h
@@ -138,20 +138,20 @@ class EventListenerMap {
void RemoveListenersForProcess(const content::RenderProcessHost* process);
// Returns true if there are any listeners on the event named |event_name|.
- bool HasListenerForEvent(const std::string& event_name);
+ bool HasListenerForEvent(const std::string& event_name) const;
// Returns true if there are any listeners on |event_name| from
// |extension_id|.
bool HasListenerForExtension(const std::string& extension_id,
- const std::string& event_name);
+ const std::string& event_name) const;
// Returns true if this map contains an EventListener that .Equals()
// |listener|.
- bool HasListener(const EventListener* listener);
+ bool HasListener(const EventListener* listener) const;
// Returns true if there is a listener for |extension_id| in |process|.
bool HasProcessListener(content::RenderProcessHost* process,
- const std::string& extension_id);
+ const std::string& extension_id) const;
// Removes any listeners that |extension_id| has added, both lazy and regular.
void RemoveListenersForExtension(const std::string& extension_id);
@@ -172,7 +172,7 @@ class EventListenerMap {
private:
// The key here is an event name.
- typedef std::map<std::string, ListenerList> ListenerMap;
+ using ListenerMap = std::map<std::string, ListenerList>;
void CleanupListener(EventListener* listener);
bool IsFilteredEvent(const Event& event) const;
@@ -180,7 +180,7 @@ class EventListenerMap {
base::DictionaryValue* filter_dict);
// Listens for removals from this map.
- Delegate* delegate_;
+ Delegate* const delegate_;
std::set<std::string> filtered_events_;
ListenerMap listeners_;

Powered by Google App Engine
This is Rietveld 408576698