| OLD | NEW |
| 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 #ifndef STORAGE_BROWSER_BLOB_BLOB_READER_H_ | 5 #ifndef STORAGE_BROWSER_BLOB_BLOB_READER_H_ |
| 6 #define STORAGE_BROWSER_BLOB_BLOB_READER_H_ | 6 #define STORAGE_BROWSER_BLOB_BLOB_READER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 std::unique_ptr<FileStreamReaderProvider> file_stream_provider, | 148 std::unique_ptr<FileStreamReaderProvider> file_stream_provider, |
| 149 base::SequencedTaskRunner* file_task_runner); | 149 base::SequencedTaskRunner* file_task_runner); |
| 150 | 150 |
| 151 bool total_size_calculated() const { return total_size_calculated_; } | 151 bool total_size_calculated() const { return total_size_calculated_; } |
| 152 | 152 |
| 153 private: | 153 private: |
| 154 Status ReportError(int net_error); | 154 Status ReportError(int net_error); |
| 155 void InvalidateCallbacksAndDone(int net_error, net::CompletionCallback done); | 155 void InvalidateCallbacksAndDone(int net_error, net::CompletionCallback done); |
| 156 | 156 |
| 157 void AsyncCalculateSize(const net::CompletionCallback& done, | 157 void AsyncCalculateSize(const net::CompletionCallback& done, |
| 158 bool async_succeeded, | 158 BlobStatus status); |
| 159 IPCBlobCreationCancelCode reason); | |
| 160 Status CalculateSizeImpl(const net::CompletionCallback& done); | 159 Status CalculateSizeImpl(const net::CompletionCallback& done); |
| 161 bool AddItemLength(size_t index, uint64_t length); | 160 bool AddItemLength(size_t index, uint64_t length); |
| 162 bool ResolveFileItemLength(const BlobDataItem& item, | 161 bool ResolveFileItemLength(const BlobDataItem& item, |
| 163 int64_t total_length, | 162 int64_t total_length, |
| 164 uint64_t* output_length); | 163 uint64_t* output_length); |
| 165 void DidGetFileItemLength(size_t index, int64_t result); | 164 void DidGetFileItemLength(size_t index, int64_t result); |
| 166 void DidCountSize(); | 165 void DidCountSize(); |
| 167 | 166 |
| 168 // For reading the blob. | 167 // For reading the blob. |
| 169 // Returns if we're done, PENDING_IO if we're waiting on async. | 168 // Returns if we're done, PENDING_IO if we're waiting on async. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 221 |
| 223 net::CompletionCallback size_callback_; | 222 net::CompletionCallback size_callback_; |
| 224 net::CompletionCallback read_callback_; | 223 net::CompletionCallback read_callback_; |
| 225 | 224 |
| 226 base::WeakPtrFactory<BlobReader> weak_factory_; | 225 base::WeakPtrFactory<BlobReader> weak_factory_; |
| 227 DISALLOW_COPY_AND_ASSIGN(BlobReader); | 226 DISALLOW_COPY_AND_ASSIGN(BlobReader); |
| 228 }; | 227 }; |
| 229 | 228 |
| 230 } // namespace storage | 229 } // namespace storage |
| 231 #endif // STORAGE_BROWSER_BLOB_BLOB_READER_H_ | 230 #endif // STORAGE_BROWSER_BLOB_BLOB_READER_H_ |
| OLD | NEW |