| 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/appcache/appcache_backend_impl.h" | 5 #include "webkit/appcache/appcache_backend_impl.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "webkit/appcache/appcache.h" | 8 #include "webkit/appcache/appcache.h" |
| 9 #include "webkit/appcache/appcache_group.h" | 9 #include "webkit/appcache/appcache_group.h" |
| 10 #include "webkit/appcache/appcache_service.h" | 10 #include "webkit/appcache/appcache_service.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 int64 cache_document_was_loaded_from) { | 103 int64 cache_document_was_loaded_from) { |
| 104 AppCacheHost* host = GetHost(host_id); | 104 AppCacheHost* host = GetHost(host_id); |
| 105 if (!host) | 105 if (!host) |
| 106 return false; | 106 return false; |
| 107 | 107 |
| 108 host->MarkAsForeignEntry(document_url, cache_document_was_loaded_from); | 108 host->MarkAsForeignEntry(document_url, cache_document_was_loaded_from); |
| 109 return true; | 109 return true; |
| 110 } | 110 } |
| 111 | 111 |
| 112 bool AppCacheBackendImpl::GetStatusWithCallback( | 112 bool AppCacheBackendImpl::GetStatusWithCallback( |
| 113 int host_id, GetStatusCallback* callback, void* callback_param) { | 113 int host_id, const GetStatusCallback& callback, void* callback_param) { |
| 114 AppCacheHost* host = GetHost(host_id); | 114 AppCacheHost* host = GetHost(host_id); |
| 115 if (!host) | 115 if (!host) |
| 116 return false; | 116 return false; |
| 117 | 117 |
| 118 host->GetStatusWithCallback(callback, callback_param); | 118 host->GetStatusWithCallback(callback, callback_param); |
| 119 return true; | 119 return true; |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool AppCacheBackendImpl::StartUpdateWithCallback( | 122 bool AppCacheBackendImpl::StartUpdateWithCallback( |
| 123 int host_id, StartUpdateCallback* callback, void* callback_param) { | 123 int host_id, const StartUpdateCallback& callback, void* callback_param) { |
| 124 AppCacheHost* host = GetHost(host_id); | 124 AppCacheHost* host = GetHost(host_id); |
| 125 if (!host) | 125 if (!host) |
| 126 return false; | 126 return false; |
| 127 | 127 |
| 128 host->StartUpdateWithCallback(callback, callback_param); | 128 host->StartUpdateWithCallback(callback, callback_param); |
| 129 return true; | 129 return true; |
| 130 } | 130 } |
| 131 | 131 |
| 132 bool AppCacheBackendImpl::SwapCacheWithCallback( | 132 bool AppCacheBackendImpl::SwapCacheWithCallback( |
| 133 int host_id, SwapCacheCallback* callback, void* callback_param) { | 133 int host_id, const SwapCacheCallback& callback, void* callback_param) { |
| 134 AppCacheHost* host = GetHost(host_id); | 134 AppCacheHost* host = GetHost(host_id); |
| 135 if (!host) | 135 if (!host) |
| 136 return false; | 136 return false; |
| 137 | 137 |
| 138 host->SwapCacheWithCallback(callback, callback_param); | 138 host->SwapCacheWithCallback(callback, callback_param); |
| 139 return true; | 139 return true; |
| 140 } | 140 } |
| 141 | 141 |
| 142 void AppCacheBackendImpl::GetResourceList( | 142 void AppCacheBackendImpl::GetResourceList( |
| 143 int host_id, std::vector<appcache::AppCacheResourceInfo>* resource_infos) { | 143 int host_id, std::vector<appcache::AppCacheResourceInfo>* resource_infos) { |
| 144 AppCacheHost* host = GetHost(host_id); | 144 AppCacheHost* host = GetHost(host_id); |
| 145 if (!host) | 145 if (!host) |
| 146 return; | 146 return; |
| 147 | 147 |
| 148 host->GetResourceList(resource_infos); | 148 host->GetResourceList(resource_infos); |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace appcache | 151 } // namespace appcache |
| OLD | NEW |