OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_APPCACHE_APPCACHE_STORAGE_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_STORAGE_H_ |
6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_STORAGE_H_ | 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_STORAGE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "content/browser/appcache/appcache_working_set.h" | 16 #include "content/browser/appcache/appcache_working_set.h" |
17 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
18 #include "net/base/completion_callback.h" | 18 #include "net/base/completion_callback.h" |
19 | 19 |
20 class GURL; | 20 class GURL; |
21 | 21 |
22 namespace content { | 22 namespace content { |
23 FORWARD_DECLARE_TEST(AppCacheStorageTest, DelegateReferences); | 23 FORWARD_DECLARE_TEST(AppCacheStorageTest, DelegateReferences); |
24 FORWARD_DECLARE_TEST(AppCacheStorageTest, UsageMap); | 24 FORWARD_DECLARE_TEST(AppCacheStorageTest, UsageMap); |
25 class AppCache; | 25 class AppCache; |
26 class AppCacheEntry; | 26 class AppCacheEntry; |
27 class AppCacheGroup; | 27 class AppCacheGroup; |
28 class AppCacheQuotaClientTest; | 28 class AppCacheQuotaClientTest; |
| 29 class AppCacheResponseMetadataWriter; |
29 class AppCacheResponseReader; | 30 class AppCacheResponseReader; |
30 class AppCacheResponseTest; | 31 class AppCacheResponseTest; |
31 class AppCacheResponseWriter; | 32 class AppCacheResponseWriter; |
32 class AppCacheServiceImpl; | 33 class AppCacheServiceImpl; |
33 class AppCacheStorageTest; | 34 class AppCacheStorageTest; |
34 struct AppCacheInfoCollection; | 35 struct AppCacheInfoCollection; |
35 struct HttpResponseInfoIOBuffer; | 36 struct HttpResponseInfoIOBuffer; |
36 | 37 |
37 class CONTENT_EXPORT AppCacheStorage { | 38 class CONTENT_EXPORT AppCacheStorage { |
38 public: | 39 public: |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 163 |
163 // Creates a reader to read a response from storage. | 164 // Creates a reader to read a response from storage. |
164 virtual AppCacheResponseReader* CreateResponseReader( | 165 virtual AppCacheResponseReader* CreateResponseReader( |
165 const GURL& manifest_url, int64 group_id, int64 response_id) = 0; | 166 const GURL& manifest_url, int64 group_id, int64 response_id) = 0; |
166 | 167 |
167 // Creates a writer to write a new response to storage. This call | 168 // Creates a writer to write a new response to storage. This call |
168 // establishes a new response id. | 169 // establishes a new response id. |
169 virtual AppCacheResponseWriter* CreateResponseWriter( | 170 virtual AppCacheResponseWriter* CreateResponseWriter( |
170 const GURL& manifest_url, int64 group_id) = 0; | 171 const GURL& manifest_url, int64 group_id) = 0; |
171 | 172 |
| 173 // Creates a metadata writer to write metadata of response to storage. |
| 174 virtual AppCacheResponseMetadataWriter* CreateResponseMetadataWriter( |
| 175 int64 group_id, |
| 176 int64 response_id) = 0; |
| 177 |
172 // Schedules the lazy deletion of responses and saves the ids | 178 // Schedules the lazy deletion of responses and saves the ids |
173 // persistently such that the responses will be deleted upon restart | 179 // persistently such that the responses will be deleted upon restart |
174 // if they aren't deleted prior to shutdown. | 180 // if they aren't deleted prior to shutdown. |
175 virtual void DoomResponses( | 181 virtual void DoomResponses( |
176 const GURL& manifest_url, const std::vector<int64>& response_ids) = 0; | 182 const GURL& manifest_url, const std::vector<int64>& response_ids) = 0; |
177 | 183 |
178 // Schedules the lazy deletion of responses without persistently saving | 184 // Schedules the lazy deletion of responses without persistently saving |
179 // the response ids. | 185 // the response ids. |
180 virtual void DeleteResponses( | 186 virtual void DeleteResponses( |
181 const GURL& manifest_url, const std::vector<int64>& response_ids) = 0; | 187 const GURL& manifest_url, const std::vector<int64>& response_ids) = 0; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 | 324 |
319 FRIEND_TEST_ALL_PREFIXES(content::AppCacheStorageTest, DelegateReferences); | 325 FRIEND_TEST_ALL_PREFIXES(content::AppCacheStorageTest, DelegateReferences); |
320 FRIEND_TEST_ALL_PREFIXES(content::AppCacheStorageTest, UsageMap); | 326 FRIEND_TEST_ALL_PREFIXES(content::AppCacheStorageTest, UsageMap); |
321 | 327 |
322 DISALLOW_COPY_AND_ASSIGN(AppCacheStorage); | 328 DISALLOW_COPY_AND_ASSIGN(AppCacheStorage); |
323 }; | 329 }; |
324 | 330 |
325 } // namespace content | 331 } // namespace content |
326 | 332 |
327 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_STORAGE_H_ | 333 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_STORAGE_H_ |
OLD | NEW |