OLD | NEW |
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 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 delegate_map_[new_request_id] = delegate_map_[old_request_id]; | 1075 delegate_map_[new_request_id] = delegate_map_[old_request_id]; |
1076 delegate_map_.erase(old_request_id); | 1076 delegate_map_.erase(old_request_id); |
1077 } | 1077 } |
1078 } | 1078 } |
1079 | 1079 |
1080 AppCacheInterceptor::CompleteCrossSiteTransfer( | 1080 AppCacheInterceptor::CompleteCrossSiteTransfer( |
1081 loader->request(), | 1081 loader->request(), |
1082 child_id, | 1082 child_id, |
1083 request_data.appcache_host_id); | 1083 request_data.appcache_host_id); |
1084 | 1084 |
| 1085 ServiceWorkerRequestHandler* handler = |
| 1086 ServiceWorkerRequestHandler::GetHandler(loader->request()); |
| 1087 if (handler) { |
| 1088 handler->CompleteCrossSiteTransfer( |
| 1089 child_id, request_data.service_worker_provider_id); |
| 1090 } |
| 1091 |
1085 // We should have a CrossSiteResourceHandler to finish the transfer. | 1092 // We should have a CrossSiteResourceHandler to finish the transfer. |
1086 DCHECK(info->cross_site_handler()); | 1093 DCHECK(info->cross_site_handler()); |
1087 } | 1094 } |
1088 | 1095 |
1089 void ResourceDispatcherHostImpl::BeginRequest( | 1096 void ResourceDispatcherHostImpl::BeginRequest( |
1090 int request_id, | 1097 int request_id, |
1091 const ResourceHostMsg_Request& request_data, | 1098 const ResourceHostMsg_Request& request_data, |
1092 IPC::Message* sync_result, // only valid for sync | 1099 IPC::Message* sync_result, // only valid for sync |
1093 int route_id) { | 1100 int route_id) { |
1094 int process_type = filter_->process_type(); | 1101 int process_type = filter_->process_type(); |
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1967 // Hang on to a reference to ensure the blob is not released prior | 1974 // Hang on to a reference to ensure the blob is not released prior |
1968 // to the job being started. | 1975 // to the job being started. |
1969 ChromeBlobStorageContext* blob_context = | 1976 ChromeBlobStorageContext* blob_context = |
1970 GetChromeBlobStorageContextForResourceContext(resource_context); | 1977 GetChromeBlobStorageContextForResourceContext(resource_context); |
1971 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( | 1978 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( |
1972 new_request.get(), | 1979 new_request.get(), |
1973 blob_context->context()->GetBlobDataFromPublicURL(new_request->url())); | 1980 blob_context->context()->GetBlobDataFromPublicURL(new_request->url())); |
1974 } | 1981 } |
1975 | 1982 |
1976 // TODO(davidben): Attach ServiceWorkerRequestHandler. | 1983 // TODO(davidben): Attach ServiceWorkerRequestHandler. |
1977 | 1984 // TODO(michaeln): Help out with this and that. |
1978 // TODO(davidben): Attach AppCacheInterceptor. | 1985 // TODO(davidben): Attach AppCacheInterceptor. |
1979 | 1986 |
1980 scoped_ptr<ResourceHandler> handler(new NavigationResourceHandler( | 1987 scoped_ptr<ResourceHandler> handler(new NavigationResourceHandler( |
1981 new_request.get(), loader)); | 1988 new_request.get(), loader)); |
1982 | 1989 |
1983 // TODO(davidben): Pass in the appropriate appcache_service. Also fix the | 1990 // TODO(davidben): Pass in the appropriate appcache_service. Also fix the |
1984 // dependency on child_id/route_id. Those are used by the ResourceScheduler; | 1991 // dependency on child_id/route_id. Those are used by the ResourceScheduler; |
1985 // currently it's a no-op. | 1992 // currently it's a no-op. |
1986 handler = AddStandardHandlers(new_request.get(), resource_type, | 1993 handler = AddStandardHandlers(new_request.get(), resource_type, |
1987 resource_context, | 1994 resource_context, |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2367 | 2374 |
2368 // Add a flag to selectively bypass the data reduction proxy if the resource | 2375 // Add a flag to selectively bypass the data reduction proxy if the resource |
2369 // type is not an image. | 2376 // type is not an image. |
2370 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) | 2377 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) |
2371 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; | 2378 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; |
2372 | 2379 |
2373 return load_flags; | 2380 return load_flags; |
2374 } | 2381 } |
2375 | 2382 |
2376 } // namespace content | 2383 } // namespace content |
OLD | NEW |