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 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 delegate_map_[new_request_id] = delegate_map_[old_request_id]; | 1058 delegate_map_[new_request_id] = delegate_map_[old_request_id]; |
1059 delegate_map_.erase(old_request_id); | 1059 delegate_map_.erase(old_request_id); |
1060 } | 1060 } |
1061 } | 1061 } |
1062 | 1062 |
1063 AppCacheInterceptor::CompleteCrossSiteTransfer( | 1063 AppCacheInterceptor::CompleteCrossSiteTransfer( |
1064 loader->request(), | 1064 loader->request(), |
1065 child_id, | 1065 child_id, |
1066 request_data.appcache_host_id); | 1066 request_data.appcache_host_id); |
1067 | 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 |
1068 // We should have a CrossSiteResourceHandler to finish the transfer. | 1075 // We should have a CrossSiteResourceHandler to finish the transfer. |
1069 DCHECK(info->cross_site_handler()); | 1076 DCHECK(info->cross_site_handler()); |
1070 } | 1077 } |
1071 | 1078 |
1072 void ResourceDispatcherHostImpl::BeginRequest( | 1079 void ResourceDispatcherHostImpl::BeginRequest( |
1073 int request_id, | 1080 int request_id, |
1074 const ResourceHostMsg_Request& request_data, | 1081 const ResourceHostMsg_Request& request_data, |
1075 IPC::Message* sync_result, // only valid for sync | 1082 IPC::Message* sync_result, // only valid for sync |
1076 int route_id) { | 1083 int route_id) { |
1077 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 Loading... |
1943 // 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 |
1944 // to the job being started. | 1951 // to the job being started. |
1945 ChromeBlobStorageContext* blob_context = | 1952 ChromeBlobStorageContext* blob_context = |
1946 GetChromeBlobStorageContextForResourceContext(resource_context); | 1953 GetChromeBlobStorageContextForResourceContext(resource_context); |
1947 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( | 1954 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( |
1948 new_request.get(), | 1955 new_request.get(), |
1949 blob_context->context()->GetBlobDataFromPublicURL(new_request->url())); | 1956 blob_context->context()->GetBlobDataFromPublicURL(new_request->url())); |
1950 } | 1957 } |
1951 | 1958 |
1952 // TODO(davidben): Attach ServiceWorkerRequestHandler. | 1959 // TODO(davidben): Attach ServiceWorkerRequestHandler. |
1953 | 1960 // TODO(michaeln): Help out with this and that. |
1954 // TODO(davidben): Attach AppCacheInterceptor. | 1961 // TODO(davidben): Attach AppCacheInterceptor. |
1955 | 1962 |
1956 scoped_ptr<ResourceHandler> handler(new NavigationResourceHandler( | 1963 scoped_ptr<ResourceHandler> handler(new NavigationResourceHandler( |
1957 new_request.get(), loader)); | 1964 new_request.get(), loader)); |
1958 | 1965 |
1959 // TODO(davidben): Pass in the appropriate appcache_service. Also fix the | 1966 // TODO(davidben): Pass in the appropriate appcache_service. Also fix the |
1960 // 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; |
1961 // currently it's a no-op. | 1968 // currently it's a no-op. |
1962 handler = AddStandardHandlers(new_request.get(), resource_type, | 1969 handler = AddStandardHandlers(new_request.get(), resource_type, |
1963 resource_context, | 1970 resource_context, |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2343 | 2350 |
2344 // 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 |
2345 // type is not an image. | 2352 // type is not an image. |
2346 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) | 2353 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) |
2347 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; | 2354 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; |
2348 | 2355 |
2349 return load_flags; | 2356 return load_flags; |
2350 } | 2357 } |
2351 | 2358 |
2352 } // namespace content | 2359 } // namespace content |
OLD | NEW |