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

Unified Diff: content/browser/download/download_file_impl.h

Issue 2890853002: Downloads: replace BrowserThread::FILE with task scheduler. (Closed)
Patch Set: Address Avi's comments. Created 3 years, 5 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
« no previous file with comments | « content/browser/download/download_file.h ('k') | content/browser/download/download_file_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_file_impl.h
diff --git a/content/browser/download/download_file_impl.h b/content/browser/download/download_file_impl.h
index 23d6ce58d2ee87e8d153bbd926fed44dc5c42bb4..9eea39f1b9268d8d765ff4f5225094babf4a93e1 100644
--- a/content/browser/download/download_file_impl.h
+++ b/content/browser/download/download_file_impl.h
@@ -19,7 +19,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
-#include "base/threading/thread_checker.h"
+#include "base/sequence_checker.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "content/browser/byte_stream.h"
@@ -38,17 +38,16 @@ class CONTENT_EXPORT DownloadFileImpl : public DownloadFile {
// Takes ownership of the object pointed to by |request_handle|.
// |net_log| will be used for logging the download file's events.
// May be constructed on any thread. All methods besides the constructor
- // (including destruction) must occur on the FILE thread.
+ // (including destruction) must occur in the same sequence.
//
// Note that the DownloadFileImpl automatically reads from the passed in
// stream, and sends updates and status of those reads to the
// DownloadDestinationObserver.
- DownloadFileImpl(
- std::unique_ptr<DownloadSaveInfo> save_info,
- const base::FilePath& default_downloads_directory,
- std::unique_ptr<ByteStreamReader> stream_reader,
- const net::NetLogWithSource& net_log,
- base::WeakPtr<DownloadDestinationObserver> observer);
+ DownloadFileImpl(std::unique_ptr<DownloadSaveInfo> save_info,
+ const base::FilePath& default_downloads_directory,
+ std::unique_ptr<ByteStreamReader> stream_reader,
+ const net::NetLogWithSource& net_log,
+ base::WeakPtr<DownloadDestinationObserver> observer);
~DownloadFileImpl() override;
@@ -243,7 +242,7 @@ class CONTENT_EXPORT DownloadFileImpl : public DownloadFile {
// DownloadSaveInfo provided during construction. Since the DownloadFileImpl
// can be created on any thread, this holds the save_info_ until it can be
- // used to initialize file_ on the FILE thread.
+ // used to initialize file_ on the download sequence.
std::unique_ptr<DownloadSaveInfo> save_info_;
// The default directory for creating the download file.
@@ -279,6 +278,8 @@ class CONTENT_EXPORT DownloadFileImpl : public DownloadFile {
std::vector<DownloadItem::ReceivedSlice> received_slices_;
+ SEQUENCE_CHECKER(sequence_checker_);
+
base::WeakPtr<DownloadDestinationObserver> observer_;
base::WeakPtrFactory<DownloadFileImpl> weak_factory_;
« no previous file with comments | « content/browser/download/download_file.h ('k') | content/browser/download/download_file_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698