Index: content/public/browser/fileapi/blob_storage_host.h |
diff --git a/content/public/browser/fileapi/blob_storage_host.h b/content/public/browser/fileapi/blob_storage_host.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7c8e4cf0c3577435ff90b10522360f61ce759263 |
--- /dev/null |
+++ b/content/public/browser/fileapi/blob_storage_host.h |
@@ -0,0 +1,52 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_PUBLIC_BROWSER_FILEAPI_BLOB_STORAGE_HOST_H_ |
+#define CONTENT_PUBLIC_BROWSER_FILEAPI_BLOB_STORAGE_HOST_H_ |
+ |
+#include <string> |
+ |
+#include "base/compiler_specific.h" |
+#include "content/common/content_export.h" |
+#include "webkit/common/blob/blob_data.h" |
+ |
+class GURL; |
+ |
+namespace webkit_blob { |
+class BlobStorageContext; |
+} |
+ |
+using webkit_blob::BlobStorageContext; |
+using webkit_blob::BlobData; |
+ |
+namespace content { |
+ |
+// This class handles the logistics of blob storage for a single child process. |
+// There is one instance per child process. When the child process |
+// terminates all blob references attibutable to that process go away upon |
+// destruction of the instance. The class is single threaded and should |
+// only be used on the IO thread. |
+class CONTENT_EXPORT BlobStorageHost { |
+ public: |
+ virtual ~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. |
+ virtual bool StartBuildingBlob(const std::string& uuid) = 0; |
+ virtual bool AppendBlobDataItem(const std::string& uuid, |
+ const BlobData::Item& data_item) = 0; |
+ virtual bool CancelBuildingBlob(const std::string& uuid) = 0; |
+ virtual bool FinishBuildingBlob(const std::string& uuid, |
+ const std::string& type) = 0; |
+ virtual bool IncrementBlobRefCount(const std::string& uuid) = 0; |
+ virtual bool DecrementBlobRefCount(const std::string& uuid) = 0; |
+ virtual bool RegisterPublicBlobURL(const GURL& blob_url, |
+ const std::string& uuid) = 0; |
+ virtual bool RevokePublicBlobURL(const GURL& blob_url) = 0; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_PUBLIC_BROWSER_FILEAPI_BLOB_STORAGE_HOST_H_ |