| 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_BROWSER_EVENT_ROUTER_H_ | 5 #ifndef EXTENSIONS_BROWSER_EVENT_ROUTER_H_ |
| 6 #define EXTENSIONS_BROWSER_EVENT_ROUTER_H_ | 6 #define EXTENSIONS_BROWSER_EVENT_ROUTER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 // Reports UMA for an event dispatched to |extension| with histogram value | 191 // Reports UMA for an event dispatched to |extension| with histogram value |
| 192 // |histogram_value|. Must be called on the UI thread. | 192 // |histogram_value|. Must be called on the UI thread. |
| 193 // | 193 // |
| 194 // |did_enqueue| should be true if the event was queued waiting for a process | 194 // |did_enqueue| should be true if the event was queued waiting for a process |
| 195 // to start, like an event page. | 195 // to start, like an event page. |
| 196 void ReportEvent(events::HistogramValue histogram_value, | 196 void ReportEvent(events::HistogramValue histogram_value, |
| 197 const Extension* extension, | 197 const Extension* extension, |
| 198 bool did_enqueue); | 198 bool did_enqueue); |
| 199 | 199 |
| 200 private: | 200 private: |
| 201 friend class EventRouterFilterTest; |
| 201 friend class EventRouterTest; | 202 friend class EventRouterTest; |
| 202 | 203 |
| 203 // The extension and process that contains the event listener for a given | 204 // The extension and process that contains the event listener for a given |
| 204 // event. | 205 // event. |
| 205 struct ListenerProcess; | 206 struct ListenerProcess; |
| 206 | 207 |
| 207 // A map between an event name and a set of extensions that are listening | 208 // A map between an event name and a set of extensions that are listening |
| 208 // to that event. | 209 // to that event. |
| 209 typedef std::map<std::string, std::set<ListenerProcess> > ListenerMap; | 210 typedef std::map<std::string, std::set<ListenerProcess> > ListenerMap; |
| 210 | 211 |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 const std::string event_name; | 427 const std::string event_name; |
| 427 | 428 |
| 428 const std::string extension_id; | 429 const std::string extension_id; |
| 429 const GURL listener_url; | 430 const GURL listener_url; |
| 430 content::BrowserContext* browser_context; | 431 content::BrowserContext* browser_context; |
| 431 }; | 432 }; |
| 432 | 433 |
| 433 } // namespace extensions | 434 } // namespace extensions |
| 434 | 435 |
| 435 #endif // EXTENSIONS_BROWSER_EVENT_ROUTER_H_ | 436 #endif // EXTENSIONS_BROWSER_EVENT_ROUTER_H_ |
| OLD | NEW |