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 WEBKIT_BROWSER_APPCACHE_APPCACHE_SERVICE_H_ | 5 #ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_SERVICE_H_ |
6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_SERVICE_H_ | 6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "net/base/completion_callback.h" | 14 #include "net/base/completion_callback.h" |
15 #include "net/base/net_errors.h" | 15 #include "net/base/net_errors.h" |
16 #include "webkit/browser/appcache/appcache_storage.h" | 16 #include "webkit/browser/appcache/appcache_storage.h" |
| 17 #include "webkit/browser/webkit_storage_browser_export.h" |
17 #include "webkit/common/appcache/appcache_interfaces.h" | 18 #include "webkit/common/appcache/appcache_interfaces.h" |
18 #include "webkit/storage/webkit_storage_export.h" | |
19 | 19 |
20 namespace net { | 20 namespace net { |
21 class URLRequestContext; | 21 class URLRequestContext; |
22 } // namespace net | 22 } // namespace net |
23 | 23 |
24 namespace base { | 24 namespace base { |
25 class FilePath; | 25 class FilePath; |
26 class MessageLoopProxy; | 26 class MessageLoopProxy; |
27 } | 27 } |
28 | 28 |
29 namespace quota { | 29 namespace quota { |
30 class QuotaManagerProxy; | 30 class QuotaManagerProxy; |
31 class SpecialStoragePolicy; | 31 class SpecialStoragePolicy; |
32 } | 32 } |
33 | 33 |
34 namespace appcache { | 34 namespace appcache { |
35 | 35 |
36 class AppCacheBackendImpl; | 36 class AppCacheBackendImpl; |
37 class AppCacheQuotaClient; | 37 class AppCacheQuotaClient; |
38 class AppCachePolicy; | 38 class AppCachePolicy; |
39 | 39 |
40 // Refcounted container to avoid copying the collection in callbacks. | 40 // Refcounted container to avoid copying the collection in callbacks. |
41 struct WEBKIT_STORAGE_EXPORT AppCacheInfoCollection | 41 struct WEBKIT_STORAGE_BROWSER_EXPORT AppCacheInfoCollection |
42 : public base::RefCountedThreadSafe<AppCacheInfoCollection> { | 42 : public base::RefCountedThreadSafe<AppCacheInfoCollection> { |
43 AppCacheInfoCollection(); | 43 AppCacheInfoCollection(); |
44 | 44 |
45 std::map<GURL, AppCacheInfoVector> infos_by_origin; | 45 std::map<GURL, AppCacheInfoVector> infos_by_origin; |
46 | 46 |
47 private: | 47 private: |
48 friend class base::RefCountedThreadSafe<AppCacheInfoCollection>; | 48 friend class base::RefCountedThreadSafe<AppCacheInfoCollection>; |
49 virtual ~AppCacheInfoCollection(); | 49 virtual ~AppCacheInfoCollection(); |
50 }; | 50 }; |
51 | 51 |
52 // Class that manages the application cache service. Sends notifications | 52 // Class that manages the application cache service. Sends notifications |
53 // to many frontends. One instance per user-profile. Each instance has | 53 // to many frontends. One instance per user-profile. Each instance has |
54 // exclusive access to its cache_directory on disk. | 54 // exclusive access to its cache_directory on disk. |
55 class WEBKIT_STORAGE_EXPORT AppCacheService { | 55 class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheService { |
56 public: | 56 public: |
57 // If not using quota management, the proxy may be NULL. | 57 // If not using quota management, the proxy may be NULL. |
58 explicit AppCacheService(quota::QuotaManagerProxy* quota_manager_proxy); | 58 explicit AppCacheService(quota::QuotaManagerProxy* quota_manager_proxy); |
59 virtual ~AppCacheService(); | 59 virtual ~AppCacheService(); |
60 | 60 |
61 void Initialize(const base::FilePath& cache_directory, | 61 void Initialize(const base::FilePath& cache_directory, |
62 base::MessageLoopProxy* db_thread, | 62 base::MessageLoopProxy* db_thread, |
63 base::MessageLoopProxy* cache_thread); | 63 base::MessageLoopProxy* cache_thread); |
64 | 64 |
65 // Purges any memory not needed. | 65 // Purges any memory not needed. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 net::URLRequestContext* request_context_; | 170 net::URLRequestContext* request_context_; |
171 // If true, nothing (not even session-only data) should be deleted on exit. | 171 // If true, nothing (not even session-only data) should be deleted on exit. |
172 bool force_keep_session_state_; | 172 bool force_keep_session_state_; |
173 | 173 |
174 DISALLOW_COPY_AND_ASSIGN(AppCacheService); | 174 DISALLOW_COPY_AND_ASSIGN(AppCacheService); |
175 }; | 175 }; |
176 | 176 |
177 } // namespace appcache | 177 } // namespace appcache |
178 | 178 |
179 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_SERVICE_H_ | 179 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_SERVICE_H_ |
OLD | NEW |