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

Side by Side Diff: content/browser/download/url_downloader.cc

Issue 1728583002: Simplify DownloadRequestHandle by using WebContentsGetter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: default callback constructor Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « content/browser/download/save_package.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/download/url_downloader.h" 5 #include "content/browser/download/url_downloader.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/threading/sequenced_task_runner_handle.h" 10 #include "base/threading/sequenced_task_runner_handle.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 FROM_HERE, base::Bind(&UrlDownloader::PauseRequest, downloader_)); 53 FROM_HERE, base::Bind(&UrlDownloader::PauseRequest, downloader_));
54 } 54 }
55 void ResumeRequest() const override { 55 void ResumeRequest() const override {
56 downloader_task_runner_->PostTask( 56 downloader_task_runner_->PostTask(
57 FROM_HERE, base::Bind(&UrlDownloader::ResumeRequest, downloader_)); 57 FROM_HERE, base::Bind(&UrlDownloader::ResumeRequest, downloader_));
58 } 58 }
59 void CancelRequest() const override { 59 void CancelRequest() const override {
60 downloader_task_runner_->PostTask( 60 downloader_task_runner_->PostTask(
61 FROM_HERE, base::Bind(&UrlDownloader::CancelRequest, downloader_)); 61 FROM_HERE, base::Bind(&UrlDownloader::CancelRequest, downloader_));
62 } 62 }
63 std::string DebugString() const override { return std::string(); }
64 63
65 private: 64 private:
66 base::WeakPtr<UrlDownloader> downloader_; 65 base::WeakPtr<UrlDownloader> downloader_;
67 base::WeakPtr<DownloadManagerImpl> download_manager_impl_; 66 base::WeakPtr<DownloadManagerImpl> download_manager_impl_;
68 scoped_refptr<base::SequencedTaskRunner> downloader_task_runner_; 67 scoped_refptr<base::SequencedTaskRunner> downloader_task_runner_;
69 68
70 DISALLOW_COPY_AND_ASSIGN(RequestHandle); 69 DISALLOW_COPY_AND_ASSIGN(RequestHandle);
71 }; 70 };
72 71
73 // static 72 // static
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 Destroy(); 249 Destroy();
251 } 250 }
252 251
253 void UrlDownloader::Destroy() { 252 void UrlDownloader::Destroy() {
254 BrowserThread::PostTask( 253 BrowserThread::PostTask(
255 BrowserThread::UI, FROM_HERE, 254 BrowserThread::UI, FROM_HERE,
256 base::Bind(&DownloadManagerImpl::RemoveUrlDownloader, manager_, this)); 255 base::Bind(&DownloadManagerImpl::RemoveUrlDownloader, manager_, this));
257 } 256 }
258 257
259 } // namespace content 258 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/save_package.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698