OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_PUBLIC_BROWSER_FILEAPI_BLOB_STORAGE_HOST_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_FILEAPI_BLOB_STORAGE_HOST_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/compiler_specific.h" |
| 11 #include "content/common/content_export.h" |
| 12 #include "webkit/common/blob/blob_data.h" |
| 13 |
| 14 class GURL; |
| 15 |
| 16 namespace webkit_blob { |
| 17 class BlobStorageContext; |
| 18 } |
| 19 |
| 20 using webkit_blob::BlobStorageContext; |
| 21 using webkit_blob::BlobData; |
| 22 |
| 23 namespace content { |
| 24 |
| 25 // This class handles the logistics of blob storage for a single child process. |
| 26 // There is one instance per child process. When the child process |
| 27 // terminates all blob references attibutable to that process go away upon |
| 28 // destruction of the instance. The class is single threaded and should |
| 29 // only be used on the IO thread. |
| 30 class CONTENT_EXPORT BlobStorageHost { |
| 31 public: |
| 32 virtual ~BlobStorageHost(); |
| 33 |
| 34 // Methods to support the IPC message protocol. |
| 35 // A false return indicates a problem with the inputs |
| 36 // like a non-existent or pre-existent uuid or url. |
| 37 virtual bool StartBuildingBlob(const std::string& uuid) = 0; |
| 38 virtual bool AppendBlobDataItem(const std::string& uuid, |
| 39 const BlobData::Item& data_item) = 0; |
| 40 virtual bool CancelBuildingBlob(const std::string& uuid) = 0; |
| 41 virtual bool FinishBuildingBlob(const std::string& uuid, |
| 42 const std::string& type) = 0; |
| 43 virtual bool IncrementBlobRefCount(const std::string& uuid) = 0; |
| 44 virtual bool DecrementBlobRefCount(const std::string& uuid) = 0; |
| 45 virtual bool RegisterPublicBlobURL(const GURL& blob_url, |
| 46 const std::string& uuid) = 0; |
| 47 virtual bool RevokePublicBlobURL(const GURL& blob_url) = 0; |
| 48 }; |
| 49 |
| 50 } // namespace content |
| 51 |
| 52 #endif // CONTENT_PUBLIC_BROWSER_FILEAPI_BLOB_STORAGE_HOST_H_ |
OLD | NEW |