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

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

Issue 2973903002: [Extensions Bindings] Introduce a supportsLazyListeners property (Closed)
Patch Set: onMessage event fix Created 3 years, 5 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 (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 <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <unordered_map> 10 #include <unordered_map>
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 // |did_enqueue| should be true if the event was queued waiting for a process 227 // |did_enqueue| should be true if the event was queued waiting for a process
228 // to start, like an event page. 228 // to start, like an event page.
229 void ReportEvent(events::HistogramValue histogram_value, 229 void ReportEvent(events::HistogramValue histogram_value,
230 const Extension* extension, 230 const Extension* extension,
231 bool did_enqueue); 231 bool did_enqueue);
232 232
233 LazyEventDispatchUtil* lazy_event_dispatch_util() { 233 LazyEventDispatchUtil* lazy_event_dispatch_util() {
234 return &lazy_event_dispatch_util_; 234 return &lazy_event_dispatch_util_;
235 } 235 }
236 236
237 // Returns true if there is a registered lazy listener for the given
238 // |event_name|.
239 bool HasLazyEventListenerForTesting(const std::string& event_name);
240
237 private: 241 private:
238 friend class EventRouterFilterTest; 242 friend class EventRouterFilterTest;
239 friend class EventRouterTest; 243 friend class EventRouterTest;
240 244
241 enum class RegisteredEventType { 245 enum class RegisteredEventType {
242 kLazy, 246 kLazy,
243 kServiceWorker, 247 kServiceWorker,
244 }; 248 };
245 249
246 // TODO(gdk): Document this. 250 // TODO(gdk): Document this.
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 const std::string event_name; 447 const std::string event_name;
444 448
445 const std::string extension_id; 449 const std::string extension_id;
446 const GURL listener_url; 450 const GURL listener_url;
447 content::BrowserContext* const browser_context; 451 content::BrowserContext* const browser_context;
448 }; 452 };
449 453
450 } // namespace extensions 454 } // namespace extensions
451 455
452 #endif // EXTENSIONS_BROWSER_EVENT_ROUTER_H_ 456 #endif // EXTENSIONS_BROWSER_EVENT_ROUTER_H_
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/events/webview_events/test.js ('k') | extensions/browser/event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698