Chromium Code Reviews| Index: chrome/browser/extensions/api/downloads/downloads_api.cc |
| diff --git a/chrome/browser/extensions/api/downloads/downloads_api.cc b/chrome/browser/extensions/api/downloads/downloads_api.cc |
| index 725dc57dc3d118b302462ebf9801662bf9063e48..dab655002bfd6d921758811eed2c422735792641 100644 |
| --- a/chrome/browser/extensions/api/downloads/downloads_api.cc |
| +++ b/chrome/browser/extensions/api/downloads/downloads_api.cc |
| @@ -1886,15 +1886,16 @@ void ExtensionDownloadsEventRouter::DispatchEvent( |
| args->Append(std::move(arg)); |
| std::string json_args; |
| base::JSONWriter::Write(*args, &json_args); |
| - std::unique_ptr<Event> event( |
| - new Event(histogram_value, event_name, std::move(args))); |
| // The downloads system wants to share on-record events with off-record |
| // extension renderers even in incognito_split_mode because that's how |
| // chrome://downloads works. The "restrict_to_profile" mechanism does not |
| // anticipate this, so it does not automatically prevent sharing off-record |
| // events with on-record extension renderers. |
|
Devlin
2017/05/24 16:08:18
This makes sense (at least, somewhat), but it's st
lazyboy
2017/05/24 19:19:32
Added a crbug. Added TODO here and in Event constr
|
| - event->restrict_to_browser_context = |
| + Profile* restrict_to_browser_context = |
| (include_incognito && !profile_->IsOffTheRecord()) ? NULL : profile_; |
| + auto event = |
| + base::MakeUnique<Event>(histogram_value, event_name, std::move(args), |
| + restrict_to_browser_context); |
| event->will_dispatch_callback = will_dispatch_callback; |
| EventRouter::Get(profile_)->BroadcastEvent(std::move(event)); |
| DownloadsNotificationSource notification_source; |