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

Side by Side Diff: content/browser/download/download_file_impl.h

Issue 2890853002: Downloads: replace BrowserThread::FILE with task scheduler. (Closed)
Patch Set: Add a missing mock expectation. Created 3 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_
7 7
8 #include "content/browser/download/download_file.h" 8 #include "content/browser/download/download_file.h"
9 9
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 20 matching lines...) Expand all
31 31
32 namespace content { 32 namespace content {
33 class ByteStreamReader; 33 class ByteStreamReader;
34 class DownloadDestinationObserver; 34 class DownloadDestinationObserver;
35 35
36 class CONTENT_EXPORT DownloadFileImpl : public DownloadFile { 36 class CONTENT_EXPORT DownloadFileImpl : public DownloadFile {
37 public: 37 public:
38 // Takes ownership of the object pointed to by |request_handle|. 38 // Takes ownership of the object pointed to by |request_handle|.
39 // |net_log| will be used for logging the download file's events. 39 // |net_log| will be used for logging the download file's events.
40 // May be constructed on any thread. All methods besides the constructor 40 // May be constructed on any thread. All methods besides the constructor
41 // (including destruction) must occur on the FILE thread. 41 // (including destruction) must occur on the download task runner.
42 // 42 //
43 // Note that the DownloadFileImpl automatically reads from the passed in 43 // Note that the DownloadFileImpl automatically reads from the passed in
44 // stream, and sends updates and status of those reads to the 44 // stream, and sends updates and status of those reads to the
45 // DownloadDestinationObserver. 45 // DownloadDestinationObserver.
46 DownloadFileImpl( 46 DownloadFileImpl(std::unique_ptr<DownloadSaveInfo> save_info,
47 std::unique_ptr<DownloadSaveInfo> save_info, 47 const base::FilePath& default_downloads_directory,
48 const base::FilePath& default_downloads_directory, 48 std::unique_ptr<ByteStreamReader> stream_reader,
49 std::unique_ptr<ByteStreamReader> stream_reader, 49 const net::NetLogWithSource& net_log,
50 const net::NetLogWithSource& net_log, 50 base::WeakPtr<DownloadDestinationObserver> observer);
51 base::WeakPtr<DownloadDestinationObserver> observer);
52 51
53 ~DownloadFileImpl() override; 52 ~DownloadFileImpl() override;
54 53
55 // DownloadFile functions. 54 // DownloadFile functions.
56 void Initialize(const InitializeCallback& initialize_callback, 55 void Initialize(const InitializeCallback& initialize_callback,
57 const CancelRequestCallback& cancel_request_callback, 56 const CancelRequestCallback& cancel_request_callback,
58 const DownloadItem::ReceivedSlices& received_slices, 57 const DownloadItem::ReceivedSlices& received_slices,
59 bool is_parallelizable) override; 58 bool is_parallelizable) override;
60 59
61 void AddByteStream(std::unique_ptr<ByteStreamReader> stream_reader, 60 void AddByteStream(std::unique_ptr<ByteStreamReader> stream_reader,
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 280
282 base::WeakPtr<DownloadDestinationObserver> observer_; 281 base::WeakPtr<DownloadDestinationObserver> observer_;
283 base::WeakPtrFactory<DownloadFileImpl> weak_factory_; 282 base::WeakPtrFactory<DownloadFileImpl> weak_factory_;
284 283
285 DISALLOW_COPY_AND_ASSIGN(DownloadFileImpl); 284 DISALLOW_COPY_AND_ASSIGN(DownloadFileImpl);
286 }; 285 };
287 286
288 } // namespace content 287 } // namespace content
289 288
290 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ 289 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698