Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_BROWSER_BLOB_BLOB_STORAGE_HOST_H_ | 5 #ifndef CONTENT_BROWSER_BLOB_BLOB_STORAGE_HOST_H_ |
|
jam
2014/04/09 22:22:28
nit: CONTENT_BROWSER_FILEAPI_BLOB_STORAGE_HOST_H_
| |
| 6 #define WEBKIT_BROWSER_BLOB_BLOB_STORAGE_HOST_H_ | 6 #define CONTENT_BROWSER_BLOB_BLOB_STORAGE_HOST_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "webkit/browser/webkit_storage_browser_export.h" | 14 #include "content/common/content_export.h" |
| 15 #include "webkit/common/blob/blob_data.h" | 15 #include "webkit/common/blob/blob_data.h" |
| 16 | 16 |
| 17 class GURL; | 17 class GURL; |
| 18 | 18 |
| 19 namespace webkit_blob { | 19 namespace webkit_blob { |
| 20 | |
| 21 class BlobDataHandle; | 20 class BlobDataHandle; |
| 22 class BlobStorageHost; | 21 class BlobStorageHost; |
| 23 class BlobStorageContext; | 22 class BlobStorageContext; |
| 23 } | |
| 24 | |
| 25 using webkit_blob::BlobStorageContext; | |
| 26 using webkit_blob::BlobData; | |
| 27 | |
| 28 namespace content { | |
| 24 | 29 |
| 25 // This class handles the logistics of blob storage for a single child process. | 30 // 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 | 31 // There is one instance per child process. When the child process |
| 27 // terminates all blob references attibutable to that process go away upon | 32 // terminates all blob references attibutable to that process go away upon |
| 28 // destruction of the instance. The class is single threaded and should | 33 // destruction of the instance. The class is single threaded and should |
| 29 // only be used on the IO thread. | 34 // only be used on the IO thread. |
| 30 class WEBKIT_STORAGE_BROWSER_EXPORT BlobStorageHost { | 35 class CONTENT_EXPORT BlobStorageHost { |
| 31 public: | 36 public: |
| 32 explicit BlobStorageHost(BlobStorageContext* context); | 37 explicit BlobStorageHost(BlobStorageContext* context); |
| 33 ~BlobStorageHost(); | 38 ~BlobStorageHost(); |
| 34 | 39 |
| 35 // Methods to support the IPC message protocol. | 40 // Methods to support the IPC message protocol. |
| 36 // A false return indicates a problem with the inputs | 41 // A false return indicates a problem with the inputs |
| 37 // like a non-existent or pre-existent uuid or url. | 42 // like a non-existent or pre-existent uuid or url. |
| 38 bool StartBuildingBlob(const std::string& uuid) WARN_UNUSED_RESULT; | 43 bool StartBuildingBlob(const std::string& uuid) WARN_UNUSED_RESULT; |
| 39 bool AppendBlobDataItem(const std::string& uuid, | 44 bool AppendBlobDataItem(const std::string& uuid, |
| 40 const BlobData::Item& data_item) WARN_UNUSED_RESULT; | 45 const BlobData::Item& data_item) WARN_UNUSED_RESULT; |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 59 BlobReferenceMap blobs_inuse_map_; | 64 BlobReferenceMap blobs_inuse_map_; |
| 60 | 65 |
| 61 // The set of public blob urls coined by this consumer. | 66 // The set of public blob urls coined by this consumer. |
| 62 std::set<GURL> public_blob_urls_; | 67 std::set<GURL> public_blob_urls_; |
| 63 | 68 |
| 64 base::WeakPtr<BlobStorageContext> context_; | 69 base::WeakPtr<BlobStorageContext> context_; |
| 65 | 70 |
| 66 DISALLOW_COPY_AND_ASSIGN(BlobStorageHost); | 71 DISALLOW_COPY_AND_ASSIGN(BlobStorageHost); |
| 67 }; | 72 }; |
| 68 | 73 |
| 69 } // namespace webkit_blob | 74 } // namespace content |
| 70 | 75 |
| 71 #endif // WEBKIT_BROWSER_BLOB_BLOB_STORAGE_HOST_H_ | 76 #endif // CONTENT_BROWSER_BLOB_BLOB_STORAGE_HOST_H_ |
| OLD | NEW |