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

Unified Diff: extensions/browser/event_router.h

Issue 2898383002: [Extensions] Make Event::restrict_to_browser_context const. (Closed)
Patch Set: sync @tott 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
« no previous file with comments | « extensions/browser/api/idle/idle_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/event_router.h
diff --git a/extensions/browser/event_router.h b/extensions/browser/event_router.h
index 83bc635e38ba4cacfbb1814b8339ce90a1f11ccf..20d9d1455f2183e4d733c9b21c634e3057e3885e 100644
--- a/extensions/browser/event_router.h
+++ b/extensions/browser/event_router.h
@@ -366,10 +366,10 @@ struct Event {
// Arguments to send to the event listener.
std::unique_ptr<base::ListValue> event_args;
- // If non-NULL, then the event will not be sent to other BrowserContexts
+ // If non-null, then the event will not be sent to other BrowserContexts
// unless the extension has permission (e.g. incognito tab update -> normal
// tab only works if extension is allowed incognito access).
- content::BrowserContext* restrict_to_browser_context;
+ content::BrowserContext* const restrict_to_browser_context;
// If not empty, the event is only sent to extensions with host permissions
// for this url.
@@ -391,6 +391,11 @@ struct Event {
// this event to be dispatched to non-extension processes, like WebUI.
WillDispatchCallback will_dispatch_callback;
+ // TODO(lazyboy): This sets |restrict_to_browser_context| to nullptr, this
+ // will dispatch the event to unrelated profiles, not just incognito. Audit
+ // and limit usages of this constructor and introduce "include incognito"
+ // option to a constructor version for clients that need to disptach events to
+ // related browser_contexts. See https://crbug.com/726022.
Event(events::HistogramValue histogram_value,
const std::string& event_name,
std::unique_ptr<base::ListValue> event_args);
« no previous file with comments | « extensions/browser/api/idle/idle_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698