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