Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 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 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 } | 66 } |
| 67 | 67 |
| 68 // Determines if a request for 'url' can be satisfied while offline. | 68 // Determines if a request for 'url' can be satisfied while offline. |
| 69 // This method always completes asynchronously. | 69 // This method always completes asynchronously. |
| 70 void CanHandleMainResourceOffline(const GURL& url, | 70 void CanHandleMainResourceOffline(const GURL& url, |
| 71 net::CompletionCallback* callback); | 71 net::CompletionCallback* callback); |
| 72 | 72 |
| 73 // Populates 'collection' with info about all of the appcaches stored | 73 // Populates 'collection' with info about all of the appcaches stored |
| 74 // within the service, 'callback' is invoked upon completion. The service | 74 // within the service, 'callback' is invoked upon completion. The service |
| 75 // acquires a reference to the 'collection' until until completion. | 75 // acquires a reference to the 'collection' until until completion. |
| 76 // This method always completes asynchronously. | 76 // This method always completes asynchronously. (virtual for unittesting) |
| 77 void GetAllAppCacheInfo(AppCacheInfoCollection* collection, | 77 virtual void GetAllAppCacheInfo(AppCacheInfoCollection* collection, |
| 78 net::CompletionCallback* callback); | 78 net::CompletionCallback* callback); |
| 79 // The same as GetAllAppCacheInfo but completes synchronously. (virtual for | |
| 80 // unittesting) | |
| 81 virtual void SyncGetAllAppCacheInfo(AppCacheInfoCollection* collection); | |
|
michaeln
2011/07/14 00:42:34
Please remove the Sync prefixed methods from this
marja(google)
2011/07/14 10:31:59
Done.
| |
| 79 | 82 |
| 80 // Deletes the group identified by 'manifest_url', 'callback' is | 83 // Deletes the group identified by 'manifest_url', 'callback' is invoked upon |
| 81 // invoked upon completion. Upon completion, the cache group and | 84 // completion. Upon completion, the cache group and any resources within the |
| 82 // any resources within the group are no longer loadable and all | 85 // group are no longer loadable and all subresource loads for pages associated |
| 83 // subresource loads for pages associated with a deleted group | 86 // with a deleted group will fail. This method always completes |
| 84 // will fail. This method always completes asynchronously. | 87 // asynchronously. (virtual for unittesting) |
| 85 void DeleteAppCacheGroup(const GURL& manifest_url, | 88 virtual void DeleteAppCacheGroup(const GURL& manifest_url, |
| 86 net::CompletionCallback* callback); | 89 net::CompletionCallback* callback); |
| 90 // The same as DeleteAppCacheGroup but completes synchronously. (virtual for | |
| 91 // unittesting) | |
| 92 virtual void SyncDeleteAppCacheGroup(const GURL& manifest_url); | |
| 87 | 93 |
| 88 // Deletes all appcaches for the origin, 'callback' is invoked upon | 94 // Deletes all appcaches for the origin, 'callback' is invoked upon |
| 89 // completion. This method always completes asynchronously. | 95 // completion. This method always completes asynchronously. |
| 90 // (virtual for unittesting) | 96 void DeleteAppCachesForOrigin(const GURL& origin, |
| 91 virtual void DeleteAppCachesForOrigin(const GURL& origin, | 97 net::CompletionCallback* callback); |
| 92 net::CompletionCallback* callback); | |
| 93 | 98 |
| 94 // Context for use during cache updates, should only be accessed | 99 // Context for use during cache updates, should only be accessed |
| 95 // on the IO thread. We do NOT add a reference to the request context, | 100 // on the IO thread. We do NOT add a reference to the request context, |
| 96 // it is the callers responsibility to ensure that the pointer | 101 // it is the callers responsibility to ensure that the pointer |
| 97 // remains valid while set. | 102 // remains valid while set. |
| 98 net::URLRequestContext* request_context() const { return request_context_; } | 103 net::URLRequestContext* request_context() const { return request_context_; } |
| 99 void set_request_context(net::URLRequestContext* context) { | 104 void set_request_context(net::URLRequestContext* context) { |
| 100 request_context_ = context; | 105 request_context_ = context; |
| 101 } | 106 } |
| 102 | 107 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 154 BackendMap backends_; // One 'backend' per child process. | 159 BackendMap backends_; // One 'backend' per child process. |
| 155 // Context for use during cache updates. | 160 // Context for use during cache updates. |
| 156 net::URLRequestContext* request_context_; | 161 net::URLRequestContext* request_context_; |
| 157 | 162 |
| 158 DISALLOW_COPY_AND_ASSIGN(AppCacheService); | 163 DISALLOW_COPY_AND_ASSIGN(AppCacheService); |
| 159 }; | 164 }; |
| 160 | 165 |
| 161 } // namespace appcache | 166 } // namespace appcache |
| 162 | 167 |
| 163 #endif // WEBKIT_APPCACHE_APPCACHE_SERVICE_H_ | 168 #endif // WEBKIT_APPCACHE_APPCACHE_SERVICE_H_ |
| OLD | NEW |