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

Unified Diff: chrome/browser/download/download_request_limiter.cc

Issue 6713008: Don't destroy a request while it is being processed (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebased. Created 9 years, 9 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/download/download_request_limiter.cc
diff --git a/chrome/browser/download/download_request_limiter.cc b/chrome/browser/download/download_request_limiter.cc
index 0a828a14aaa008e5fea3ab59b9b6591b37f09729..579c172c490d53ab5ac4f69b881b4964f6d28af1 100644
--- a/chrome/browser/download/download_request_limiter.cc
+++ b/chrome/browser/download/download_request_limiter.cc
@@ -190,6 +190,7 @@ DownloadRequestLimiter::DownloadStatus
void DownloadRequestLimiter::CanDownloadOnIOThread(int render_process_host_id,
int render_view_id,
+ int request_id,
Callback* callback) {
// This is invoked on the IO thread. Schedule the task to run on the UI
// thread so that we can query UI state.
@@ -197,7 +198,8 @@ void DownloadRequestLimiter::CanDownloadOnIOThread(int render_process_host_id,
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this, &DownloadRequestLimiter::CanDownload,
- render_process_host_id, render_view_id, callback));
+ render_process_host_id, render_view_id, request_id,
+ callback));
}
void DownloadRequestLimiter::OnUserGesture(TabContents* tab) {
@@ -233,6 +235,7 @@ DownloadRequestLimiter::TabDownloadState* DownloadRequestLimiter::
void DownloadRequestLimiter::CanDownload(int render_process_host_id,
int render_view_id,
+ int request_id,
Callback* callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -243,16 +246,17 @@ void DownloadRequestLimiter::CanDownload(int render_process_host_id,
ScheduleNotification(callback, false);
return;
}
- CanDownloadImpl(originating_tab, callback);
+ CanDownloadImpl(originating_tab, request_id, callback);
}
void DownloadRequestLimiter::CanDownloadImpl(
TabContents* originating_tab,
+ int request_id,
Callback* callback) {
// FYI: Chrome Frame overrides CanDownload in ExternalTabContainer in order
// to cancel the download operation in chrome and let the host browser
// take care of it.
- if (!originating_tab->CanDownload(callback->GetRequestId())) {
+ if (!originating_tab->CanDownload(request_id)) {
ScheduleNotification(callback, false);
return;
}
« no previous file with comments | « chrome/browser/download/download_request_limiter.h ('k') | chrome/browser/download/download_request_limiter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698