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

Unified Diff: content/browser/download/download_resource_handler.cc

Issue 2251643003: Remove the BeginSaveFile and BeginDownload methods from ResourceDispatcherHostImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix browser test redness by ensuring that the ResourceDispatcherHostDelegate is notified in CreateR… Created 4 years, 4 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: content/browser/download/download_resource_handler.cc
diff --git a/content/browser/download/download_resource_handler.cc b/content/browser/download/download_resource_handler.cc
index 05d22a8ee73cfe46f093aa7503646ed3a2bb6f98..e3c15303132063e137b0c2607f1c4bc75e69e88c 100644
--- a/content/browser/download/download_resource_handler.cc
+++ b/content/browser/download/download_resource_handler.cc
@@ -106,19 +106,6 @@ DownloadResourceHandler::DownloadResourceHandler(net::URLRequest* request)
: ResourceHandler(request),
tab_info_(new DownloadTabInfo()),
core_(request, this) {
- // Do UI thread initialization for tab_info_ asap after
- // DownloadResourceHandler creation since the tab could be navigated
- // before StartOnUIThread gets called. This is safe because deletion
- // will occur via PostTask() as well, which will serialized behind this
- // PostTask()
- const ResourceRequestInfoImpl* request_info = GetRequestInfo();
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE,
- base::Bind(
- &InitializeDownloadTabInfoOnUIThread,
- DownloadRequestHandle(AsWeakPtr(),
- request_info->GetWebContentsGetterForRequest()),
- tab_info_.get()));
}
DownloadResourceHandler::~DownloadResourceHandler() {
@@ -146,6 +133,19 @@ bool DownloadResourceHandler::OnResponseStarted(
}
bool DownloadResourceHandler::OnWillStart(const GURL& url, bool* defer) {
+ // Do UI thread initialization for tab_info_ asap after
svaldez 2016/08/19 17:05:14 Comment should be updated.
ananta 2016/08/19 19:02:14 Done.
+ // DownloadResourceHandler creation since the tab could be navigated
+ // before StartOnUIThread gets called. This is safe because deletion
+ // will occur via PostTask() as well, which will serialized behind this
+ // PostTask()
+ const ResourceRequestInfoImpl* request_info = GetRequestInfo();
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(
+ &InitializeDownloadTabInfoOnUIThread,
+ DownloadRequestHandle(AsWeakPtr(),
+ request_info->GetWebContentsGetterForRequest()),
+ tab_info_.get()));
return true;
}

Powered by Google App Engine
This is Rietveld 408576698