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

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 702843004: Transfer serviceworker state during cross site navigations too. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "content/browser/loader/resource_dispatcher_host_impl.h" 7 #include "content/browser/loader/resource_dispatcher_host_impl.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 delegate_map_[new_request_id] = delegate_map_[old_request_id]; 1057 delegate_map_[new_request_id] = delegate_map_[old_request_id];
1058 delegate_map_.erase(old_request_id); 1058 delegate_map_.erase(old_request_id);
1059 } 1059 }
1060 } 1060 }
1061 1061
1062 AppCacheInterceptor::CompleteCrossSiteTransfer( 1062 AppCacheInterceptor::CompleteCrossSiteTransfer(
1063 loader->request(), 1063 loader->request(),
1064 child_id, 1064 child_id,
1065 request_data.appcache_host_id); 1065 request_data.appcache_host_id);
1066 1066
1067
1068 ServiceWorkerRequestHandler* handler =
1069 ServiceWorkerRequestHandler::GetHandler(loader->request());
1070 if (handler) {
1071 handler->CompleteCrossSiteTransfer(
1072 child_id, request_data.service_worker_provider_id);
1073 }
1074
1067 // We should have a CrossSiteResourceHandler to finish the transfer. 1075 // We should have a CrossSiteResourceHandler to finish the transfer.
1068 DCHECK(info->cross_site_handler()); 1076 DCHECK(info->cross_site_handler());
1069 } 1077 }
1070 1078
1071 void ResourceDispatcherHostImpl::BeginRequest( 1079 void ResourceDispatcherHostImpl::BeginRequest(
1072 int request_id, 1080 int request_id,
1073 const ResourceHostMsg_Request& request_data, 1081 const ResourceHostMsg_Request& request_data,
1074 IPC::Message* sync_result, // only valid for sync 1082 IPC::Message* sync_result, // only valid for sync
1075 int route_id) { 1083 int route_id) {
1076 int process_type = filter_->process_type(); 1084 int process_type = filter_->process_type();
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1942 // Hang on to a reference to ensure the blob is not released prior 1950 // Hang on to a reference to ensure the blob is not released prior
1943 // to the job being started. 1951 // to the job being started.
1944 ChromeBlobStorageContext* blob_context = 1952 ChromeBlobStorageContext* blob_context =
1945 GetChromeBlobStorageContextForResourceContext(resource_context); 1953 GetChromeBlobStorageContextForResourceContext(resource_context);
1946 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( 1954 storage::BlobProtocolHandler::SetRequestedBlobDataHandle(
1947 new_request.get(), 1955 new_request.get(),
1948 blob_context->context()->GetBlobDataFromPublicURL(new_request->url())); 1956 blob_context->context()->GetBlobDataFromPublicURL(new_request->url()));
1949 } 1957 }
1950 1958
1951 // TODO(davidben): Attach ServiceWorkerRequestHandler. 1959 // TODO(davidben): Attach ServiceWorkerRequestHandler.
1952 1960 // TODO(michaeln): Help out with this and that.
1953 // TODO(davidben): Attach AppCacheInterceptor. 1961 // TODO(davidben): Attach AppCacheInterceptor.
1954 1962
1955 scoped_ptr<ResourceHandler> handler(new NavigationResourceHandler( 1963 scoped_ptr<ResourceHandler> handler(new NavigationResourceHandler(
1956 new_request.get(), loader)); 1964 new_request.get(), loader));
1957 1965
1958 // TODO(davidben): Pass in the appropriate appcache_service. Also fix the 1966 // TODO(davidben): Pass in the appropriate appcache_service. Also fix the
1959 // dependency on child_id/route_id. Those are used by the ResourceScheduler; 1967 // dependency on child_id/route_id. Those are used by the ResourceScheduler;
1960 // currently it's a no-op. 1968 // currently it's a no-op.
1961 handler = AddStandardHandlers(new_request.get(), resource_type, 1969 handler = AddStandardHandlers(new_request.get(), resource_type,
1962 resource_context, 1970 resource_context,
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
2342 2350
2343 // Add a flag to selectively bypass the data reduction proxy if the resource 2351 // Add a flag to selectively bypass the data reduction proxy if the resource
2344 // type is not an image. 2352 // type is not an image.
2345 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) 2353 if (request_data.resource_type != RESOURCE_TYPE_IMAGE)
2346 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; 2354 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY;
2347 2355
2348 return load_flags; 2356 return load_flags;
2349 } 2357 }
2350 2358
2351 } // namespace content 2359 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698