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 #include "webkit/browser/appcache/appcache_backend_impl.h" | 5 #include "webkit/browser/appcache/appcache_backend_impl.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "webkit/browser/appcache/appcache.h" | 8 #include "webkit/browser/appcache/appcache.h" |
9 #include "webkit/browser/appcache/appcache_group.h" | 9 #include "webkit/browser/appcache/appcache_group.h" |
10 #include "webkit/browser/appcache/appcache_service.h" | 10 #include "webkit/browser/appcache/appcache_service.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 bool AppCacheBackendImpl::SwapCacheWithCallback( | 131 bool AppCacheBackendImpl::SwapCacheWithCallback( |
132 int host_id, const SwapCacheCallback& callback, void* callback_param) { | 132 int host_id, const SwapCacheCallback& callback, void* callback_param) { |
133 AppCacheHost* host = GetHost(host_id); | 133 AppCacheHost* host = GetHost(host_id); |
134 if (!host) | 134 if (!host) |
135 return false; | 135 return false; |
136 | 136 |
137 host->SwapCacheWithCallback(callback, callback_param); | 137 host->SwapCacheWithCallback(callback, callback_param); |
138 return true; | 138 return true; |
139 } | 139 } |
140 | 140 |
| 141 bool AppCacheBackendImpl::RegisterController(int host_id, |
| 142 const GURL& document_url, |
| 143 const string16& pattern, |
| 144 const GURL& script_url) { |
| 145 AppCacheHost* host = GetHost(host_id); |
| 146 if (!host) |
| 147 return false; |
| 148 host->RegisterController(document_url, pattern, script_url); |
| 149 return true; |
| 150 } |
| 151 |
| 152 bool AppCacheBackendImpl::UnregisterController(int host_id, |
| 153 const GURL& document_url, |
| 154 const string16& pattern) { |
| 155 AppCacheHost* host = GetHost(host_id); |
| 156 if (!host) |
| 157 return false; |
| 158 host->UnregisterController(document_url, pattern); |
| 159 return true; |
| 160 } |
| 161 |
141 void AppCacheBackendImpl::GetResourceList( | 162 void AppCacheBackendImpl::GetResourceList( |
142 int host_id, std::vector<appcache::AppCacheResourceInfo>* resource_infos) { | 163 int host_id, std::vector<appcache::AppCacheResourceInfo>* resource_infos) { |
143 AppCacheHost* host = GetHost(host_id); | 164 AppCacheHost* host = GetHost(host_id); |
144 if (!host) | 165 if (!host) |
145 return; | 166 return; |
146 | 167 |
147 host->GetResourceList(resource_infos); | 168 host->GetResourceList(resource_infos); |
148 } | 169 } |
149 | 170 |
150 } // namespace appcache | 171 } // namespace appcache |
OLD | NEW |