| Index: storage/browser/blob/blob_async_transport_strategy.h
|
| diff --git a/storage/browser/blob/blob_async_transport_strategy.h b/storage/browser/blob/blob_async_transport_strategy.h
|
| index fe8d37436ae4639fa5759c4455da41bf114af2f8..1cf5ee2bf549c1d69a9cf52abd543876be11387f 100644
|
| --- a/storage/browser/blob/blob_async_transport_strategy.h
|
| +++ b/storage/browser/blob/blob_async_transport_strategy.h
|
| @@ -48,28 +48,42 @@ class STORAGE_EXPORT BlobAsyncTransportStrategy {
|
| // the browser.
|
| size_t browser_item_offset;
|
| BlobItemBytesRequest message;
|
| - bool received;
|
| };
|
|
|
| BlobAsyncTransportStrategy();
|
| virtual ~BlobAsyncTransportStrategy();
|
|
|
| - // This call does the computation to create the requests and builder for the
|
| - // blob given the memory constraints and blob description. |memory_available|
|
| - // is the total amount of memory we can offer for storing blobs.
|
| - // This method can only be called once.
|
| - void Initialize(size_t max_ipc_memory_size,
|
| - size_t max_shared_memory_size,
|
| - size_t max_file_size,
|
| - uint64_t disk_space_left,
|
| - size_t memory_available,
|
| - const std::string& uuid,
|
| - const std::vector<DataElement>& blob_item_infos);
|
| + // Initializes the transport strategy for file requests.
|
| + void InitializeForFileRequests(
|
| + size_t max_file_size,
|
| + const std::string& uuid,
|
| + uint64_t blob_total_size,
|
| + const std::vector<DataElement>& blob_item_infos,
|
| + BlobDataBuilder* builder);
|
| +
|
| + void InitializeForSharedMemoryRequests(
|
| + size_t max_shared_memory_size,
|
| + const std::string& uuid,
|
| + uint64_t blob_total_size,
|
| + const std::vector<DataElement>& blob_item_infos,
|
| + BlobDataBuilder* builder);
|
| +
|
| + void InitializeForIPCTransportation(
|
| + size_t max_ipc_memory_size,
|
| + const std::string& uuid,
|
| + uint64_t blob_total_size,
|
| + const std::vector<DataElement>& blob_item_infos,
|
| + BlobDataBuilder* builder);
|
|
|
| // The sizes of the handles being used (by handle index) in the async
|
| - // operation. This is used for both files or shared memory, as their use is
|
| - // mutually exclusive.
|
| - const std::vector<size_t>& handle_sizes() const { return handle_sizes_; }
|
| + // operation.
|
| + const std::vector<size_t>& shared_memory_handle_sizes() const {
|
| + return shared_memory_handle_sizes_;
|
| + }
|
| +
|
| + const std::vector<size_t>& file_handle_sizes() const {
|
| + return file_handle_sizes_;
|
| + }
|
|
|
| // The requests for memory, segmented as described above, along with their
|
| // destination browser indexes and offsets.
|
| @@ -77,20 +91,6 @@ class STORAGE_EXPORT BlobAsyncTransportStrategy {
|
| return requests_;
|
| }
|
|
|
| - // Marks the request at the given request number as recieved.
|
| - void MarkRequestAsReceived(size_t request_num) {
|
| - DCHECK_LT(request_num, requests_.size());
|
| - requests_[request_num].received = true;
|
| - }
|
| -
|
| - // A BlobDataBuilder which can be used to construct the Blob in the
|
| - // BlobStorageContext object after:
|
| - // * The bytes items from AppendFutureData are populated by
|
| - // PopulateFutureData.
|
| - // * The temporary files from AppendFutureFile are populated by
|
| - // PopulateFutureFile.
|
| - BlobDataBuilder* blob_builder() { return builder_.get(); }
|
| -
|
| // The total bytes size of memory items in the blob.
|
| uint64_t total_bytes_size() const { return total_bytes_size_; }
|
|
|
| @@ -107,13 +107,14 @@ class STORAGE_EXPORT BlobAsyncTransportStrategy {
|
| Error error_;
|
|
|
| // We use the same vector for shared memory handle sizes and file handle sizes
|
| - // because we only use one for any strategy. The size of the handles is capped
|
| - // by the |max_file_size| argument in Initialize, so we can just use size_t.
|
| - std::vector<size_t> handle_sizes_;
|
| + // because we only use one for any strategy. T
|
| + std::vector<size_t> shared_memory_handle_sizes_;
|
| + // The size of the handles is capped by the |max_file_size| argument in
|
| + // InitializeForFileRequests, so we can just use size_t.
|
| + std::vector<size_t> file_handle_sizes_;
|
|
|
| uint64_t total_bytes_size_;
|
| std::vector<RendererMemoryItemRequest> requests_;
|
| - scoped_ptr<BlobDataBuilder> builder_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(BlobAsyncTransportStrategy);
|
| };
|
|
|