 Chromium Code Reviews
 Chromium Code Reviews Issue 2448353002:
  [BlobAsync] Moving async handling into BlobStorageContext & quota out.  (Closed)
    
  
    Issue 2448353002:
  [BlobAsync] Moving async handling into BlobStorageContext & quota out.  (Closed) 
  | Index: content/browser/blob_storage/blob_dispatcher_host.h | 
| diff --git a/content/browser/blob_storage/blob_dispatcher_host.h b/content/browser/blob_storage/blob_dispatcher_host.h | 
| index f9d1a98881e7556a12bf96bee12bb74c5975db21..68514bcc89cff12504517e0438feb570257a71ac 100644 | 
| --- a/content/browser/blob_storage/blob_dispatcher_host.h | 
| +++ b/content/browser/blob_storage/blob_dispatcher_host.h | 
| @@ -16,8 +16,7 @@ | 
| #include "base/memory/shared_memory_handle.h" | 
| #include "content/common/content_export.h" | 
| #include "content/public/browser/browser_message_filter.h" | 
| -#include "storage/browser/blob/blob_async_builder_host.h" | 
| -#include "storage/browser/blob/blob_transport_result.h" | 
| +#include "storage/browser/blob/blob_transport_host.h" | 
| #include "storage/common/blob_storage/blob_storage_constants.h" | 
| class GURL; | 
| @@ -58,14 +57,6 @@ class CONTENT_EXPORT BlobDispatcherHost : public BrowserMessageFilter { | 
| protected: | 
| ~BlobDispatcherHost() override; | 
| - // For testing use only. | 
| - void SetMemoryConstantsForTesting(size_t max_ipc_memory_size, | 
| - size_t max_shared_memory_size, | 
| - uint64_t max_file_size) { | 
| - async_builder_.SetMemoryConstantsForTesting( | 
| - max_ipc_memory_size, max_shared_memory_size, max_file_size); | 
| - } | 
| - | 
| private: | 
| friend class base::RefCountedThreadSafe<BlobDispatcherHost>; | 
| friend class BlobDispatcherHostTest; | 
| @@ -100,18 +91,15 @@ class CONTENT_EXPORT BlobDispatcherHost : public BrowserMessageFilter { | 
| typedef std::map<std::string, int> BlobReferenceMap; | 
| - void OnRegisterBlobUUID(const std::string& uuid, | 
| - const std::string& content_type, | 
| - const std::string& content_disposition, | 
| - const std::set<std::string>& referenced_blob_uuids); | 
| - void OnStartBuildingBlob( | 
| - const std::string& uuid, | 
| - const std::vector<storage::DataElement>& descriptions); | 
| + void OnRegisterBlob(const std::string& uuid, | 
| + const std::string& content_type, | 
| + const std::string& content_disposition, | 
| + const std::vector<storage::DataElement>& descriptions); | 
| void OnMemoryItemResponse( | 
| const std::string& uuid, | 
| const std::vector<storage::BlobItemBytesResponse>& response); | 
| void OnCancelBuildingBlob(const std::string& uuid, | 
| - const storage::IPCBlobCreationCancelCode code); | 
| + const storage::BlobStatus code); | 
| void OnIncrementBlobRefCount(const std::string& uuid); | 
| void OnDecrementBlobRefCount(const std::string& uuid); | 
| @@ -120,15 +108,13 @@ class CONTENT_EXPORT BlobDispatcherHost : public BrowserMessageFilter { | 
| storage::BlobStorageContext* context(); | 
| - void SendMemoryRequest( | 
| - const std::string& uuid, | 
| - std::unique_ptr<std::vector<storage::BlobItemBytesRequest>> requests, | 
| - std::unique_ptr<std::vector<base::SharedMemoryHandle>> memory_handles, | 
| - std::unique_ptr<std::vector<base::File>> files); | 
| + void SendMemoryRequest(const std::string& uuid, | 
| + std::vector<storage::BlobItemBytesRequest> requests, | 
| + std::vector<base::SharedMemoryHandle> memory_handles, | 
| + std::vector<base::File> files); | 
| - // Send the appropriate IPC response to the renderer for the given result. | 
| - void SendIPCResponse(const std::string& uuid, | 
| - storage::BlobTransportResult result); | 
| + // The status should never be a pending status (see BlobStatusIsPending). | 
| + void SendFinalBlobStatus(const std::string& uuid, storage::BlobStatus status); | 
| bool IsInUseInHost(const std::string& uuid); | 
| bool IsUrlRegisteredInHost(const GURL& blob_url); | 
| @@ -147,7 +133,7 @@ class CONTENT_EXPORT BlobDispatcherHost : public BrowserMessageFilter { | 
| std::set<GURL> public_blob_urls_; | 
| scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; | 
| - storage::BlobAsyncBuilderHost async_builder_; | 
| + storage::BlobTransportHost async_builder_; | 
| 
michaeln
2016/11/07 21:47:05
it'd be good to rename the data member correspondi
 
dmurph
2016/11/08 21:19:58
Done.
 | 
| DISALLOW_COPY_AND_ASSIGN(BlobDispatcherHost); | 
| }; |