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

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

Issue 2823273004: Add new UMA stats for parallelizable download (Closed)
Patch Set: Created 3 years, 8 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_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 29 matching lines...) Expand all
40 // error. 40 // error.
41 typedef base::Callback<void(DownloadInterruptReason reason, 41 typedef base::Callback<void(DownloadInterruptReason reason,
42 const base::FilePath& path)> 42 const base::FilePath& path)>
43 RenameCompletionCallback; 43 RenameCompletionCallback;
44 44
45 virtual ~DownloadFile() {} 45 virtual ~DownloadFile() {}
46 46
47 // Upon completion, |callback| will be called on the UI 47 // Upon completion, |callback| will be called on the UI
48 // thread as per the comment above, passing DOWNLOAD_INTERRUPT_REASON_NONE 48 // thread as per the comment above, passing DOWNLOAD_INTERRUPT_REASON_NONE
49 // on success, or a network download interrupt reason on failure. 49 // on success, or a network download interrupt reason on failure.
50 virtual void Initialize( 50 virtual void Initialize(const InitializeCallback& callback,
xingliu 2017/04/19 02:18:11 FYI: sorry that I just modified this function, so
qinmin 2017/04/19 22:42:33 rebased in the new PS
51 const InitializeCallback& callback, 51 const DownloadItem::ReceivedSlices& received_slices,
52 const DownloadItem::ReceivedSlices& received_slices) = 0; 52 bool is_parallelizable) = 0;
53 53
54 // Add a byte stream reader to write into a slice of the file, used for 54 // Add a byte stream reader to write into a slice of the file, used for
55 // parallel download. Called on the file thread. 55 // parallel download. Called on the file thread.
56 virtual void AddByteStream(std::unique_ptr<ByteStreamReader> stream_reader, 56 virtual void AddByteStream(std::unique_ptr<ByteStreamReader> stream_reader,
57 int64_t offset, 57 int64_t offset,
58 int64_t length) = 0; 58 int64_t length) = 0;
59 59
60 // Rename the download file to |full_path|. If that file exists 60 // Rename the download file to |full_path|. If that file exists
61 // |full_path| will be uniquified by suffixing " (<number>)" to the 61 // |full_path| will be uniquified by suffixing " (<number>)" to the
62 // file name before the extension. 62 // file name before the extension.
(...skipping 24 matching lines...) Expand all
87 virtual void SetPotentialFileLength(int64_t length) = 0; 87 virtual void SetPotentialFileLength(int64_t length) = 0;
88 88
89 virtual const base::FilePath& FullPath() const = 0; 89 virtual const base::FilePath& FullPath() const = 0;
90 virtual bool InProgress() const = 0; 90 virtual bool InProgress() const = 0;
91 virtual void WasPaused() = 0; 91 virtual void WasPaused() = 0;
92 }; 92 };
93 93
94 } // namespace content 94 } // namespace content
95 95
96 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ 96 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/download/download_file_impl.h » ('j') | content/browser/download/download_file_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698