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 WEBKIT_BROWSER_BLOB_BLOB_STORAGE_HOST_H_ |
6 #define WEBKIT_BROWSER_BLOB_BLOB_STORAGE_HOST_H_ | 6 #define WEBKIT_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> |
(...skipping 29 matching lines...) Expand all Loading... |
40 const BlobData::Item& data_item) WARN_UNUSED_RESULT; | 40 const BlobData::Item& data_item) WARN_UNUSED_RESULT; |
41 bool CancelBuildingBlob(const std::string& uuid) WARN_UNUSED_RESULT; | 41 bool CancelBuildingBlob(const std::string& uuid) WARN_UNUSED_RESULT; |
42 bool FinishBuildingBlob(const std::string& uuid, | 42 bool FinishBuildingBlob(const std::string& uuid, |
43 const std::string& type) WARN_UNUSED_RESULT; | 43 const std::string& type) WARN_UNUSED_RESULT; |
44 bool IncrementBlobRefCount(const std::string& uuid) WARN_UNUSED_RESULT; | 44 bool IncrementBlobRefCount(const std::string& uuid) WARN_UNUSED_RESULT; |
45 bool DecrementBlobRefCount(const std::string& uuid) WARN_UNUSED_RESULT; | 45 bool DecrementBlobRefCount(const std::string& uuid) WARN_UNUSED_RESULT; |
46 bool RegisterPublicBlobURL(const GURL& blob_url, | 46 bool RegisterPublicBlobURL(const GURL& blob_url, |
47 const std::string& uuid) WARN_UNUSED_RESULT; | 47 const std::string& uuid) WARN_UNUSED_RESULT; |
48 bool RevokePublicBlobURL(const GURL& blob_url) WARN_UNUSED_RESULT; | 48 bool RevokePublicBlobURL(const GURL& blob_url) WARN_UNUSED_RESULT; |
49 | 49 |
50 // Temporary support for mapping old style private blob urls to uuids. | |
51 void DeprecatedRegisterBlobURL(const GURL& private_url, | |
52 const std::string& uuid); | |
53 void DeprecatedCloneBlobURL(const GURL& url, | |
54 const GURL& src_private_url); | |
55 void DeprecatedRevokeBlobURL(const GURL& url); | |
56 | |
57 private: | 50 private: |
58 typedef std::map<std::string, int> BlobReferenceMap; | 51 typedef std::map<std::string, int> BlobReferenceMap; |
59 | 52 |
60 bool IsInUseInHost(const std::string& uuid); | 53 bool IsInUseInHost(const std::string& uuid); |
61 bool IsBeingBuiltInHost(const std::string& uuid); | 54 bool IsBeingBuiltInHost(const std::string& uuid); |
62 bool IsUrlRegisteredInHost(const GURL& blob_url); | 55 bool IsUrlRegisteredInHost(const GURL& blob_url); |
63 | 56 |
64 // Collection of blob ids and a count of how many usages | 57 // Collection of blob ids and a count of how many usages |
65 // of that id are attributable to this consumer. | 58 // of that id are attributable to this consumer. |
66 BlobReferenceMap blobs_inuse_map_; | 59 BlobReferenceMap blobs_inuse_map_; |
67 | 60 |
68 // The set of public blob urls coined by this consumer. | 61 // The set of public blob urls coined by this consumer. |
69 std::set<GURL> public_blob_urls_; | 62 std::set<GURL> public_blob_urls_; |
70 | 63 |
71 // And private deprecated blob urls. | |
72 std::set<GURL> private_blob_urls_; | |
73 | |
74 base::WeakPtr<BlobStorageContext> context_; | 64 base::WeakPtr<BlobStorageContext> context_; |
75 | 65 |
76 DISALLOW_COPY_AND_ASSIGN(BlobStorageHost); | 66 DISALLOW_COPY_AND_ASSIGN(BlobStorageHost); |
77 }; | 67 }; |
78 | 68 |
79 } // namespace webkit_blob | 69 } // namespace webkit_blob |
80 | 70 |
81 #endif // WEBKIT_BROWSER_BLOB_BLOB_STORAGE_HOST_H_ | 71 #endif // WEBKIT_BROWSER_BLOB_BLOB_STORAGE_HOST_H_ |
OLD | NEW |