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 d1ad10f571dd340482ff67ff951f71b6e31a29b8..a0fc81585cf5d5a4b832590e1a57edf1b2fb2615 100644 |
--- a/content/browser/download/download_file_impl.h |
+++ b/content/browser/download/download_file_impl.h |
@@ -183,6 +183,16 @@ class CONTENT_EXPORT DownloadFileImpl : public DownloadFile { |
// Called before the data is written to disk. |
void WillWriteToDisk(size_t data_len); |
+ // For a given SourceStream object and the bytes it has read, determine the |
+ // actual number of bytes it can write to the disk. For parallel downloading, |
+ // if the first disk IO writes to a location that is already written by |
+ // another stream, the current stream should stop writing. Returns true if the |
+ // stream can write no more data and should be finished, returns false |
+ // otherwise. |
+ bool CalculateBytesToWrite(SourceStream* source_stream, |
+ size_t bytes_read, |
+ size_t* bytes_to_write); |
+ |
// Called when there's some activity on the byte stream that needs to be |
// handled. |
void StreamActive(SourceStream* source_stream); |