Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(638)

Unified Diff: webkit/browser/appcache/appcache_backend_impl.cc

Issue 137883005: crossSite navs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/browser/appcache/appcache_backend_impl.h ('k') | webkit/browser/appcache/appcache_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « webkit/browser/appcache/appcache_backend_impl.h ('k') | webkit/browser/appcache/appcache_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698