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_CONTEXT_H_ | 5 #ifndef WEBKIT_BROWSER_BLOB_BLOB_STORAGE_CONTEXT_H_ |
6 #define WEBKIT_BROWSER_BLOB_BLOB_STORAGE_CONTEXT_H_ | 6 #define WEBKIT_BROWSER_BLOB_BLOB_STORAGE_CONTEXT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.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 "webkit/common/blob/blob_data.h" | 15 #include "webkit/common/blob/blob_data.h" |
15 #include "webkit/storage/webkit_storage_export.h" | |
16 | 16 |
17 class GURL; | 17 class GURL; |
18 | 18 |
19 namespace base { | 19 namespace base { |
20 class FilePath; | 20 class FilePath; |
21 class Time; | 21 class Time; |
22 } | 22 } |
23 | 23 |
24 namespace webkit_blob { | 24 namespace webkit_blob { |
25 | 25 |
26 class BlobDataHandle; | 26 class BlobDataHandle; |
27 | 27 |
28 // This class handles the logistics of blob Storage within the browser process, | 28 // This class handles the logistics of blob Storage within the browser process, |
29 // and maintains a mapping from blob uuid to the data. The class is single | 29 // and maintains a mapping from blob uuid to the data. The class is single |
30 // threaded and should only be used on the IO thread. | 30 // threaded and should only be used on the IO thread. |
31 // In chromium, there is one instance per profile. | 31 // In chromium, there is one instance per profile. |
32 class WEBKIT_STORAGE_EXPORT BlobStorageContext | 32 class WEBKIT_STORAGE_BROWSER_EXPORT BlobStorageContext |
33 : public base::SupportsWeakPtr<BlobStorageContext> { | 33 : public base::SupportsWeakPtr<BlobStorageContext> { |
34 public: | 34 public: |
35 BlobStorageContext(); | 35 BlobStorageContext(); |
36 ~BlobStorageContext(); | 36 ~BlobStorageContext(); |
37 | 37 |
38 scoped_ptr<BlobDataHandle> GetBlobDataFromUUID(const std::string& uuid); | 38 scoped_ptr<BlobDataHandle> GetBlobDataFromUUID(const std::string& uuid); |
39 scoped_ptr<BlobDataHandle> GetBlobDataFromPublicURL(const GURL& url); | 39 scoped_ptr<BlobDataHandle> GetBlobDataFromPublicURL(const GURL& url); |
40 | 40 |
41 // Useful for coining blobs from within the browser process. If the | 41 // Useful for coining blobs from within the browser process. If the |
42 // blob cannot be added due to memory consumption, returns NULL. | 42 // blob cannot be added due to memory consumption, returns NULL. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // we count only the items of TYPE_DATA which are held in memory and not | 101 // we count only the items of TYPE_DATA which are held in memory and not |
102 // items of TYPE_FILE. | 102 // items of TYPE_FILE. |
103 int64 memory_usage_; | 103 int64 memory_usage_; |
104 | 104 |
105 DISALLOW_COPY_AND_ASSIGN(BlobStorageContext); | 105 DISALLOW_COPY_AND_ASSIGN(BlobStorageContext); |
106 }; | 106 }; |
107 | 107 |
108 } // namespace webkit_blob | 108 } // namespace webkit_blob |
109 | 109 |
110 #endif // WEBKIT_BROWSER_BLOB_BLOB_STORAGE_CONTEXT_H_ | 110 #endif // WEBKIT_BROWSER_BLOB_BLOB_STORAGE_CONTEXT_H_ |
OLD | NEW |