| 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/child/resource_dispatcher.h" | 7 #include "content/child/resource_dispatcher.h" |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 request_info->response_start = ConsumeIOTimestamp(); | 370 request_info->response_start = ConsumeIOTimestamp(); |
| 371 | 371 |
| 372 if (delegate_) { | 372 if (delegate_) { |
| 373 RequestPeer* new_peer = | 373 RequestPeer* new_peer = |
| 374 delegate_->OnReceivedResponse( | 374 delegate_->OnReceivedResponse( |
| 375 request_info->peer, response_head.mime_type, request_info->url); | 375 request_info->peer, response_head.mime_type, request_info->url); |
| 376 if (new_peer) | 376 if (new_peer) |
| 377 request_info->peer = new_peer; | 377 request_info->peer = new_peer; |
| 378 } | 378 } |
| 379 | 379 |
| 380 // Updates the response_url if the response was fetched by a ServiceWorker, | |
| 381 // and it was not generated inside the ServiceWorker. | |
| 382 if (response_head.was_fetched_via_service_worker && | |
| 383 !response_head.original_url_via_service_worker.is_empty()) { | |
| 384 request_info->response_url = response_head.original_url_via_service_worker; | |
| 385 } | |
| 386 | |
| 387 ResourceResponseInfo renderer_response_info; | 380 ResourceResponseInfo renderer_response_info; |
| 388 ToResourceResponseInfo(*request_info, response_head, &renderer_response_info); | 381 ToResourceResponseInfo(*request_info, response_head, &renderer_response_info); |
| 389 request_info->site_isolation_metadata = | 382 request_info->site_isolation_metadata = |
| 390 SiteIsolationPolicy::OnReceivedResponse(request_info->frame_origin, | 383 SiteIsolationPolicy::OnReceivedResponse(request_info->frame_origin, |
| 391 request_info->response_url, | 384 request_info->response_url, |
| 392 request_info->resource_type, | 385 request_info->resource_type, |
| 393 request_info->origin_pid, | 386 request_info->origin_pid, |
| 394 renderer_response_info); | 387 renderer_response_info); |
| 395 request_info->peer->OnReceivedResponse(renderer_response_info); | 388 request_info->peer->OnReceivedResponse(renderer_response_info); |
| 396 } | 389 } |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { | 893 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { |
| 901 while (!queue->empty()) { | 894 while (!queue->empty()) { |
| 902 IPC::Message* message = queue->front(); | 895 IPC::Message* message = queue->front(); |
| 903 ReleaseResourcesInDataMessage(*message); | 896 ReleaseResourcesInDataMessage(*message); |
| 904 queue->pop_front(); | 897 queue->pop_front(); |
| 905 delete message; | 898 delete message; |
| 906 } | 899 } |
| 907 } | 900 } |
| 908 | 901 |
| 909 } // namespace content | 902 } // namespace content |
| OLD | NEW |