| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ref_counted.h" | 11 #include "base/ref_counted.h" |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "base/time.h" | 13 #include "base/time.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 "testing/gtest/include/gtest/gtest_prod.h" | 16 #include "testing/gtest/include/gtest/gtest_prod.h" |
| 17 #include "webkit/appcache/appcache_interfaces.h" | 17 #include "webkit/appcache/appcache_interfaces.h" |
| 18 #include "webkit/appcache/appcache_storage.h" | 18 #include "webkit/appcache/appcache_storage.h" |
| 19 | 19 |
| 20 class FilePath; | 20 class FilePath; |
| 21 |
| 22 namespace net { |
| 21 class URLRequestContext; | 23 class URLRequestContext; |
| 24 } // namespace net |
| 22 | 25 |
| 23 namespace base { | 26 namespace base { |
| 24 class MessageLoopProxy; | 27 class MessageLoopProxy; |
| 25 } | 28 } |
| 26 | 29 |
| 27 namespace appcache { | 30 namespace appcache { |
| 28 | 31 |
| 29 class AppCacheBackendImpl; | 32 class AppCacheBackendImpl; |
| 30 class AppCachePolicy; | 33 class AppCachePolicy; |
| 31 | 34 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // any resources within the group are no longer loadable and all | 70 // any resources within the group are no longer loadable and all |
| 68 // subresource loads for pages associated with a deleted group | 71 // subresource loads for pages associated with a deleted group |
| 69 // will fail. This method always completes asynchronously. | 72 // will fail. This method always completes asynchronously. |
| 70 void DeleteAppCacheGroup(const GURL& manifest_url, | 73 void DeleteAppCacheGroup(const GURL& manifest_url, |
| 71 net::CompletionCallback* callback); | 74 net::CompletionCallback* callback); |
| 72 | 75 |
| 73 // Context for use during cache updates, should only be accessed | 76 // Context for use during cache updates, should only be accessed |
| 74 // on the IO thread. We do NOT add a reference to the request context, | 77 // on the IO thread. We do NOT add a reference to the request context, |
| 75 // it is the callers responsibility to ensure that the pointer | 78 // it is the callers responsibility to ensure that the pointer |
| 76 // remains valid while set. | 79 // remains valid while set. |
| 77 URLRequestContext* request_context() const { return request_context_; } | 80 net::URLRequestContext* request_context() const { return request_context_; } |
| 78 void set_request_context(URLRequestContext* context) { | 81 void set_request_context(net::URLRequestContext* context) { |
| 79 request_context_ = context; | 82 request_context_ = context; |
| 80 } | 83 } |
| 81 | 84 |
| 82 // The appcache policy, may be null, in which case access is always allowed. | 85 // The appcache policy, may be null, in which case access is always allowed. |
| 83 // The service does NOT assume ownership of the policy, it is the callers | 86 // The service does NOT assume ownership of the policy, it is the callers |
| 84 // responsibility to ensure that the pointer remains valid while set. | 87 // responsibility to ensure that the pointer remains valid while set. |
| 85 AppCachePolicy* appcache_policy() const { return appcache_policy_; } | 88 AppCachePolicy* appcache_policy() const { return appcache_policy_; } |
| 86 void set_appcache_policy(AppCachePolicy* policy) { | 89 void set_appcache_policy(AppCachePolicy* policy) { |
| 87 appcache_policy_ = policy; | 90 appcache_policy_ = policy; |
| 88 } | 91 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 103 class DeleteHelper; | 106 class DeleteHelper; |
| 104 class GetInfoHelper; | 107 class GetInfoHelper; |
| 105 | 108 |
| 106 typedef std::set<AsyncHelper*> PendingAsyncHelpers; | 109 typedef std::set<AsyncHelper*> PendingAsyncHelpers; |
| 107 typedef std::map<int, AppCacheBackendImpl*> BackendMap; | 110 typedef std::map<int, AppCacheBackendImpl*> BackendMap; |
| 108 | 111 |
| 109 AppCachePolicy* appcache_policy_; | 112 AppCachePolicy* appcache_policy_; |
| 110 scoped_ptr<AppCacheStorage> storage_; | 113 scoped_ptr<AppCacheStorage> storage_; |
| 111 PendingAsyncHelpers pending_helpers_; | 114 PendingAsyncHelpers pending_helpers_; |
| 112 BackendMap backends_; // One 'backend' per child process. | 115 BackendMap backends_; // One 'backend' per child process. |
| 113 URLRequestContext* request_context_; // Context for use during cache updates. | 116 // Context for use during cache updates. |
| 117 net::URLRequestContext* request_context_; |
| 114 | 118 |
| 115 DISALLOW_COPY_AND_ASSIGN(AppCacheService); | 119 DISALLOW_COPY_AND_ASSIGN(AppCacheService); |
| 116 }; | 120 }; |
| 117 | 121 |
| 118 } // namespace appcache | 122 } // namespace appcache |
| 119 | 123 |
| 120 #endif // WEBKIT_APPCACHE_APPCACHE_SERVICE_H_ | 124 #endif // WEBKIT_APPCACHE_APPCACHE_SERVICE_H_ |
| OLD | NEW |