Index: webkit/browser/appcache/appcache_backend_impl.cc |
diff --git a/webkit/browser/appcache/appcache_backend_impl.cc b/webkit/browser/appcache/appcache_backend_impl.cc |
index fd8029d6dab7b5561d965c5349b24675b8fc8015..17b0b0c6a606f645a55efeea5745a9abf39c5250 100644 |
--- a/webkit/browser/appcache/appcache_backend_impl.cc |
+++ b/webkit/browser/appcache/appcache_backend_impl.cc |
@@ -147,4 +147,36 @@ void AppCacheBackendImpl::GetResourceList( |
host->GetResourceList(resource_infos); |
} |
+scoped_ptr<AppCacheHost> AppCacheBackendImpl::TransferHostOut(int host_id) { |
+ HostMap::iterator found = hosts_.find(host_id); |
+ if (found == hosts_.end()) { |
+ NOTREACHED(); |
+ return scoped_ptr<AppCacheHost>(); |
+ } |
+ |
+ AppCacheHost* transferree = found->second; |
+ |
+ // Put a new empty host in its place. |
+ found->second = new AppCacheHost(host_id, frontend_, service_); |
+ |
+ // We give up ownership. |
+ transferree->PrepareForTransfer(); |
+ return scoped_ptr<AppCacheHost>(transferree); |
+} |
+ |
+void AppCacheBackendImpl::TransferHostIn( |
+ int new_host_id, scoped_ptr<AppCacheHost> host) { |
+ HostMap::iterator found = hosts_.find(new_host_id); |
+ if (found == hosts_.end()) { |
+ NOTREACHED(); |
+ return; |
+ } |
+ |
+ delete found->second; |
+ |
+ // We take onwership. |
+ host->CompleteTransfer(new_host_id, frontend_); |
+ found->second = host.release(); |
+} |
+ |
} // namespace appcache |