OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_COMMON_EVENT_FILTER_H_ | 5 #ifndef EXTENSIONS_COMMON_EVENT_FILTER_H_ |
6 #define EXTENSIONS_COMMON_EVENT_FILTER_H_ | 6 #define EXTENSIONS_COMMON_EVENT_FILTER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 DISALLOW_COPY_AND_ASSIGN(EventMatcherEntry); | 87 DISALLOW_COPY_AND_ASSIGN(EventMatcherEntry); |
88 }; | 88 }; |
89 | 89 |
90 // Maps from a matcher id to an event matcher entry. | 90 // Maps from a matcher id to an event matcher entry. |
91 using EventMatcherMap = | 91 using EventMatcherMap = |
92 std::map<MatcherID, std::unique_ptr<EventMatcherEntry>>; | 92 std::map<MatcherID, std::unique_ptr<EventMatcherEntry>>; |
93 | 93 |
94 // Maps from event name to the map of matchers that are registered for it. | 94 // Maps from event name to the map of matchers that are registered for it. |
95 using EventMatcherMultiMap = std::map<std::string, EventMatcherMap>; | 95 using EventMatcherMultiMap = std::map<std::string, EventMatcherMap>; |
96 | 96 |
97 // Adds the list of URL filters in |matcher| to the URL matcher, having | 97 // Adds the list of URL filters in |matcher| to the URL matcher. |
98 // matches for those URLs map to |id|. | |
99 bool CreateConditionSets( | 98 bool CreateConditionSets( |
100 MatcherID id, | |
101 EventMatcher* matcher, | 99 EventMatcher* matcher, |
102 url_matcher::URLMatcherConditionSet::Vector* condition_sets); | 100 url_matcher::URLMatcherConditionSet::Vector* condition_sets); |
103 | 101 |
104 bool AddDictionaryAsConditionSet( | 102 bool AddDictionaryAsConditionSet( |
105 base::DictionaryValue* url_filter, | 103 base::DictionaryValue* url_filter, |
106 url_matcher::URLMatcherConditionSet::Vector* condition_sets); | 104 url_matcher::URLMatcherConditionSet::Vector* condition_sets); |
107 | 105 |
108 url_matcher::URLMatcher url_matcher_; | 106 url_matcher::URLMatcher url_matcher_; |
109 EventMatcherMultiMap event_matchers_; | 107 EventMatcherMultiMap event_matchers_; |
110 | 108 |
(...skipping 11 matching lines...) Expand all Loading... |
122 | 120 |
123 // Maps from event matcher ids to the name of the event they match on. | 121 // Maps from event matcher ids to the name of the event they match on. |
124 std::map<MatcherID, std::string> id_to_event_name_; | 122 std::map<MatcherID, std::string> id_to_event_name_; |
125 | 123 |
126 DISALLOW_COPY_AND_ASSIGN(EventFilter); | 124 DISALLOW_COPY_AND_ASSIGN(EventFilter); |
127 }; | 125 }; |
128 | 126 |
129 } // namespace extensions | 127 } // namespace extensions |
130 | 128 |
131 #endif // EXTENSIONS_COMMON_EVENT_FILTER_H_ | 129 #endif // EXTENSIONS_COMMON_EVENT_FILTER_H_ |
OLD | NEW |