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

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

Issue 23496076: WIP - Refactor programmatic downloads Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 32c5b987799d510d79fb6e12c4327784498fdd86..35aa7cf4a8870ac0f838517ec07eda94505c0d22 100644
--- a/content/browser/download/download_request_handle.cc
+++ b/content/browser/download/download_request_handle.cc
@@ -4,86 +4,8 @@
#include "content/browser/download/download_request_handle.h"
-#include "base/bind.h"
-#include "base/strings/stringprintf.h"
-#include "content/browser/renderer_host/render_view_host_impl.h"
-#include "content/browser/web_contents/web_contents_impl.h"
-#include "content/public/browser/browser_context.h"
-#include "content/public/browser/browser_thread.h"
-
namespace content {
-DownloadRequestHandle::~DownloadRequestHandle() {
-}
-
-DownloadRequestHandle::DownloadRequestHandle()
- : child_id_(-1),
- render_view_id_(-1),
- request_id_(-1) {
-}
-
-DownloadRequestHandle::DownloadRequestHandle(
- const base::WeakPtr<DownloadResourceHandler>& handler,
- int child_id,
- int render_view_id,
- int request_id)
- : handler_(handler),
- child_id_(child_id),
- render_view_id_(render_view_id),
- request_id_(request_id) {
- DCHECK(handler_.get());
-}
-
-WebContents* DownloadRequestHandle::GetWebContents() const {
- RenderViewHostImpl* render_view_host =
- RenderViewHostImpl::FromID(child_id_, render_view_id_);
- if (!render_view_host)
- return NULL;
-
- return render_view_host->GetDelegate()->GetAsWebContents();
-}
-
-DownloadManager* DownloadRequestHandle::GetDownloadManager() const {
- RenderViewHostImpl* rvh = RenderViewHostImpl::FromID(
- child_id_, render_view_id_);
- if (rvh == NULL)
- return NULL;
- RenderProcessHost* rph = rvh->GetProcess();
- if (rph == NULL)
- return NULL;
- BrowserContext* context = rph->GetBrowserContext();
- if (context == NULL)
- return NULL;
- return BrowserContext::GetDownloadManager(context);
-}
-
-void DownloadRequestHandle::PauseRequest() const {
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(&DownloadResourceHandler::PauseRequest, handler_));
-}
-
-void DownloadRequestHandle::ResumeRequest() const {
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(&DownloadResourceHandler::ResumeRequest, handler_));
-}
-
-void DownloadRequestHandle::CancelRequest() const {
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(&DownloadResourceHandler::CancelRequest, handler_));
-}
-
-std::string DownloadRequestHandle::DebugString() const {
- return base::StringPrintf("{"
- " child_id = %d"
- " render_view_id = %d"
- " request_id = %d"
- "}",
- child_id_,
- render_view_id_,
- request_id_);
-}
+DownloadRequestHandle::~DownloadRequestHandle() {}
} // namespace content
« no previous file with comments | « content/browser/download/download_request_handle.h ('k') | content/browser/download/download_request_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698