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

Unified Diff: content/browser/fileapi/blob_storage_host.h

Issue 1234813004: [BlobAsync] Asynchronous Blob Construction Final Patch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blob-protocol-change
Patch Set: comments Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/fileapi/blob_storage_host.h
diff --git a/content/browser/fileapi/blob_storage_host.h b/content/browser/fileapi/blob_storage_host.h
index dc277ae5accbe41eac0a36755ccc4e5a635e2d9d..53fd557ca22e707d2c9845fcb350300eb2cc9c3d 100644
--- a/content/browser/fileapi/blob_storage_host.h
+++ b/content/browser/fileapi/blob_storage_host.h
@@ -8,18 +8,27 @@
#include <map>
#include <set>
#include <string>
+#include <vector>
+#include "base/callback_forward.h"
#include "base/compiler_specific.h"
+#include "base/memory/shared_memory_handle.h"
#include "base/memory/weak_ptr.h"
#include "content/common/content_export.h"
+#include "ipc/ipc_platform_file.h"
+#include "storage/browser/blob/blob_async_builder_host.h"
+#include "storage/common/blob_storage/blob_storage_constants.h"
#include "storage/common/data_element.h"
class GURL;
namespace storage {
+class BlobDataBuilder;
class BlobDataHandle;
class BlobStorageHost;
class BlobStorageContext;
+struct BlobItemBytesRequest;
+struct BlobItemBytesResponse;
}
namespace content {
@@ -34,21 +43,32 @@ class CONTENT_EXPORT BlobStorageHost {
explicit BlobStorageHost(storage::BlobStorageContext* context);
~BlobStorageHost();
- // Methods to support the IPC message protocol.
// A false return indicates a problem with the inputs
// like a non-existent or pre-existent uuid or url.
- bool StartBuildingBlob(const std::string& uuid) WARN_UNUSED_RESULT;
- bool AppendBlobDataItem(const std::string& uuid,
- const storage::DataElement& data_item)
- WARN_UNUSED_RESULT;
- bool CancelBuildingBlob(const std::string& uuid) WARN_UNUSED_RESULT;
- bool FinishBuildingBlob(const std::string& uuid,
- const std::string& type) WARN_UNUSED_RESULT;
- bool IncrementBlobRefCount(const std::string& uuid) WARN_UNUSED_RESULT;
- bool DecrementBlobRefCount(const std::string& uuid) WARN_UNUSED_RESULT;
- bool RegisterPublicBlobURL(const GURL& blob_url,
- const std::string& uuid) WARN_UNUSED_RESULT;
- bool RevokePublicBlobURL(const GURL& blob_url) WARN_UNUSED_RESULT;
+
+ bool RegisterBlobUUID(const std::string& uuid);
+
+ void StartBuildingBlob(
+ const std::string& uuid,
+ const std::string& type,
+ const std::vector<storage::DataElement>& descriptions,
+ const base::Callback<void(
+ const std::vector<storage::BlobItemBytesRequest>&,
+ const std::vector<base::SharedMemoryHandle>&,
+ const std::vector<IPC::PlatformFileForTransit>&)>& request_memory,
+ const base::Closure& done,
+ const base::Callback<void(storage::IPCBlobCreationCancelCode)>& cancel);
+
+ void OnBlobMemoryResponses(
+ const std::string& uuid,
+ const std::vector<storage::BlobItemBytesResponse>& responses);
+
+ bool CancelBuildingBlob(const std::string& uuid);
+
+ bool IncrementBlobRefCount(const std::string& uuid);
+ bool DecrementBlobRefCount(const std::string& uuid);
+ bool RegisterPublicBlobURL(const GURL& blob_url, const std::string& uuid);
+ bool RevokePublicBlobURL(const GURL& blob_url);
private:
typedef std::map<std::string, int> BlobReferenceMap;
@@ -65,6 +85,7 @@ class CONTENT_EXPORT BlobStorageHost {
std::set<GURL> public_blob_urls_;
base::WeakPtr<storage::BlobStorageContext> context_;
+ storage::BlobAsyncBuilderHost async_builder_;
DISALLOW_COPY_AND_ASSIGN(BlobStorageHost);
};

Powered by Google App Engine
This is Rietveld 408576698