| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include <vector> | 10 #include <vector> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 // Context for use during cache updates, should only be accessed | 47 // Context for use during cache updates, should only be accessed |
| 48 // on the IO thread. We do NOT add a reference to the request context, | 48 // on the IO thread. We do NOT add a reference to the request context, |
| 49 // it is the callers responsibility to ensure that the pointer | 49 // it is the callers responsibility to ensure that the pointer |
| 50 // remains valid while set. | 50 // remains valid while set. |
| 51 URLRequestContext* request_context() const { return request_context_; } | 51 URLRequestContext* request_context() const { return request_context_; } |
| 52 void set_request_context(URLRequestContext* context) { | 52 void set_request_context(URLRequestContext* context) { |
| 53 request_context_ = context; | 53 request_context_ = context; |
| 54 } | 54 } |
| 55 | 55 |
| 56 // TODO(jennb): API to set service settings, like file paths for storage | |
| 57 | |
| 58 // Track which processes are using this appcache service. | 56 // Track which processes are using this appcache service. |
| 59 void RegisterBackend(AppCacheBackendImpl* backend_impl); | 57 void RegisterBackend(AppCacheBackendImpl* backend_impl); |
| 60 void UnregisterBackend(AppCacheBackendImpl* backend_impl); | 58 void UnregisterBackend(AppCacheBackendImpl* backend_impl); |
| 61 AppCacheBackendImpl* GetBackend(int id) { | 59 AppCacheBackendImpl* GetBackend(int id) { |
| 62 BackendMap::iterator it = backends_.find(id); | 60 BackendMap::iterator it = backends_.find(id); |
| 63 return (it != backends_.end()) ? it->second : NULL; | 61 return (it != backends_.end()) ? it->second : NULL; |
| 64 } | 62 } |
| 65 | 63 |
| 66 // Track what we have in our in-memory cache. | 64 // Track what we have in our in-memory cache. |
| 67 void AddCache(AppCache* cache); | 65 void AddCache(AppCache* cache); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 URLRequestContext* request_context_; | 119 URLRequestContext* request_context_; |
| 122 | 120 |
| 123 // TODO(michaeln): cache and group loading book keeping. | 121 // TODO(michaeln): cache and group loading book keeping. |
| 124 // TODO(michaeln): database and response storage | 122 // TODO(michaeln): database and response storage |
| 125 // TODO(jennb): service state: e.g. reached quota? | 123 // TODO(jennb): service state: e.g. reached quota? |
| 126 }; | 124 }; |
| 127 | 125 |
| 128 } // namespace appcache | 126 } // namespace appcache |
| 129 | 127 |
| 130 #endif // WEBKIT_APPCACHE_APPCACHE_SERVICE_H_ | 128 #endif // WEBKIT_APPCACHE_APPCACHE_SERVICE_H_ |
| OLD | NEW |