| 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 fb83530036b1a2689245190a69dcf66fa2ebc21c..76ea02e237b14fa35021b6f80fc1f9528a1d6344 100644
|
| --- a/chrome/browser/download/download_request_limiter.cc
|
| +++ b/chrome/browser/download/download_request_limiter.cc
|
| @@ -279,22 +279,6 @@ DownloadRequestLimiter::GetDownloadStatus(content::WebContents* web_contents) {
|
| return state ? state->download_status() : ALLOW_ONE_DOWNLOAD;
|
| }
|
|
|
| -void DownloadRequestLimiter::CanDownloadOnIOThread(
|
| - int render_process_host_id,
|
| - int render_view_id,
|
| - const GURL& url,
|
| - const std::string& request_method,
|
| - const 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.
|
| - DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
| - BrowserThread::PostTask(
|
| - BrowserThread::UI, FROM_HERE,
|
| - base::Bind(&DownloadRequestLimiter::CanDownload, this,
|
| - render_process_host_id, render_view_id, url,
|
| - request_method, callback));
|
| -}
|
| -
|
| DownloadRequestLimiter::TabDownloadState*
|
| DownloadRequestLimiter::GetDownloadState(
|
| content::WebContents* web_contents,
|
| @@ -325,12 +309,12 @@ void DownloadRequestLimiter::CanDownload(int render_process_host_id,
|
| tab_util::GetWebContentsByID(render_process_host_id, render_view_id);
|
| if (!originating_contents) {
|
| // The WebContents was closed, don't allow the download.
|
| - ScheduleNotification(callback, false);
|
| + callback.Run(false);
|
| return;
|
| }
|
|
|
| if (!originating_contents->GetDelegate()) {
|
| - ScheduleNotification(callback, false);
|
| + callback.Run(false);
|
| return;
|
| }
|
|
|
| @@ -360,7 +344,7 @@ void DownloadRequestLimiter::OnCanDownloadDecided(
|
| content::WebContents* originating_contents =
|
| tab_util::GetWebContentsByID(render_process_host_id, render_view_id);
|
| if (!originating_contents || !allow) {
|
| - ScheduleNotification(orig_callback, false);
|
| + orig_callback.Run(false);
|
| return;
|
| }
|
|
|
| @@ -388,18 +372,18 @@ void DownloadRequestLimiter::CanDownloadImpl(
|
| if (state->download_count() && !(state->download_count() %
|
| DownloadRequestLimiter::kMaxDownloadsAtOnce))
|
| state->set_download_status(PROMPT_BEFORE_DOWNLOAD);
|
| - ScheduleNotification(callback, true);
|
| + callback.Run(true);
|
| state->increment_download_count();
|
| break;
|
|
|
| case ALLOW_ONE_DOWNLOAD:
|
| state->set_download_status(PROMPT_BEFORE_DOWNLOAD);
|
| - ScheduleNotification(callback, true);
|
| + callback.Run(true);
|
| state->increment_download_count();
|
| break;
|
|
|
| case DOWNLOADS_NOT_ALLOWED:
|
| - ScheduleNotification(callback, false);
|
| + callback.Run(false);
|
| break;
|
|
|
| case PROMPT_BEFORE_DOWNLOAD: {
|
| @@ -419,7 +403,7 @@ void DownloadRequestLimiter::CanDownloadImpl(
|
| originating_contents);
|
| if (settings)
|
| settings->SetDownloadsBlocked(false);
|
| - ScheduleNotification(callback, true);
|
| + callback.Run(true);
|
| state->increment_download_count();
|
| return;
|
| }
|
| @@ -429,7 +413,7 @@ void DownloadRequestLimiter::CanDownloadImpl(
|
| originating_contents);
|
| if (settings)
|
| settings->SetDownloadsBlocked(true);
|
| - ScheduleNotification(callback, false);
|
| + callback.Run(false);
|
| return;
|
| }
|
| case CONTENT_SETTING_DEFAULT:
|
|
|