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

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

Issue 8060042: Add downloads.onCreated apitest and fix a few bugs (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: merge Created 9 years, 2 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_request_handle.cc
diff --git a/content/browser/download/download_request_handle.cc b/content/browser/download/download_request_handle.cc
index e5d9b60d1cac3937d3252300518fe33f7ec4bf80..de6d5aa2206884a0760d1a040e2ad500ca8faa7c 100644
--- a/content/browser/download/download_request_handle.cc
+++ b/content/browser/download/download_request_handle.cc
@@ -61,15 +61,16 @@ TabContents* DownloadRequestHandle::GetTabContents() const {
}
DownloadManager* DownloadRequestHandle::GetDownloadManager() const {
- TabContents* contents = GetTabContents();
- if (!contents)
+ RenderViewHost* rvh = RenderViewHost::FromID(child_id_, render_view_id_);
+ if (rvh == NULL)
return NULL;
-
- content::BrowserContext* browser_context = contents->browser_context();
- if (!browser_context)
+ RenderProcessHost* rph = rvh->process();
+ if (rph == NULL)
return NULL;
-
- return browser_context->GetDownloadManager();
+ content::BrowserContext* context = rph->browser_context();
+ if (context == NULL)
+ return NULL;
+ return context->GetDownloadManager();
}
void DownloadRequestHandle::PauseRequest() const {
« no previous file with comments | « chrome/test/data/extensions/api_test/downloads/test.js ('k') | content/browser/download/mock_download_manager_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698