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

Unified Diff: chrome/browser/extensions/extension_host.cc

Issue 10412061: Fix crashes in DownloadRequestLimiter when extension popups/bubbles initiate downloads automatically (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test Created 8 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
Index: chrome/browser/extensions/extension_host.cc
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc
index f72fbcedf017fec80ea738f429393547eb3d800f..f8126480dad12594316db3ed7cde71440895b5a3 100644
--- a/chrome/browser/extensions/extension_host.cc
+++ b/chrome/browser/extensions/extension_host.cc
@@ -59,6 +59,7 @@
using WebKit::WebDragOperation;
using WebKit::WebDragOperationsMask;
+using content::DownloadItem;
using content::NativeWebKeyboardEvent;
using content::OpenURLParams;
using content::RenderViewHost;
@@ -410,6 +411,17 @@ void ExtensionHost::CloseContents(WebContents* contents) {
}
}
+void ExtensionHost::OnStartDownload(
+ WebContents* source, DownloadItem* download) {
+ Profile* profile = Profile::FromBrowserContext(source->GetBrowserContext());
+ Browser* browser = browser::FindTabbedBrowser(
+ profile, false); // Match incognito exactly.
+ if (!browser && view())
+ browser = view()->browser();
+ if (browser)
+ browser->OnStartDownload(source, download);
+}
+
void ExtensionHost::WillRunJavaScriptDialog() {
ExtensionProcessManager* pm =
ExtensionSystem::Get(profile_)->process_manager();

Powered by Google App Engine
This is Rietveld 408576698