Index: content/browser/browser_plugin/browser_plugin_guest.cc |
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc |
index b1ca054488c5db69d3f66f25cf398be5dcdb4779..40638e0f3200155f9d5d9075d0a776b505f93abd 100644 |
--- a/content/browser/browser_plugin/browser_plugin_guest.cc |
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc |
@@ -153,20 +153,6 @@ std::string WindowOpenDispositionToString( |
} |
} |
-// Called on IO thread. |
-static GURL RetrieveDownloadURLFromRequestId( |
- int render_process_id, |
- int url_request_id) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
- |
- GlobalRequestID global_id(render_process_id, url_request_id); |
- net::URLRequest* url_request = |
- ResourceDispatcherHostImpl::Get()->GetURLRequest(global_id); |
- if (url_request) |
- return url_request->url(); |
lazyboy
2014/05/13 01:33:51
Note that this can be different then the original
Fady Samuel
2014/05/13 14:33:12
That's fine. I don't believe there's any change in
|
- return GURL(); |
-} |
- |
} // namespace |
class BrowserPluginGuest::EmbedderWebContentsObserver |
@@ -613,22 +599,15 @@ void BrowserPluginGuest::AddNewContents(WebContents* source, |
void BrowserPluginGuest::CanDownload( |
RenderViewHost* render_view_host, |
- int request_id, |
+ const GURL& url, |
const std::string& request_method, |
const base::Callback<void(bool)>& callback) { |
- if (!delegate_) { |
+ if (!delegate_ || !url.is_valid()) { |
callback.Run(false); |
return; |
} |
- BrowserThread::PostTaskAndReplyWithResult( |
- BrowserThread::IO, FROM_HERE, |
- base::Bind(&RetrieveDownloadURLFromRequestId, |
- render_view_host->GetProcess()->GetID(), request_id), |
- base::Bind(&BrowserPluginGuest::DidRetrieveDownloadURLFromRequestId, |
- weak_ptr_factory_.GetWeakPtr(), |
- request_method, |
- callback)); |
+ delegate_->CanDownload(request_method, url, callback); |
} |
void BrowserPluginGuest::LoadProgressChanged(WebContents* contents, |
@@ -1556,16 +1535,4 @@ void BrowserPluginGuest::OnImeCompositionRangeChanged( |
} |
#endif |
-void BrowserPluginGuest::DidRetrieveDownloadURLFromRequestId( |
- const std::string& request_method, |
- const base::Callback<void(bool)>& callback, |
- const GURL& url) { |
- if (!url.is_valid()) { |
- callback.Run(false); |
- return; |
- } |
- |
- delegate_->CanDownload(request_method, url, callback); |
-} |
- |
} // namespace content |