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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
351 request_info->response_start = ConsumeIOTimestamp(); | 351 request_info->response_start = ConsumeIOTimestamp(); |
352 | 352 |
353 if (delegate_) { | 353 if (delegate_) { |
354 RequestPeer* new_peer = | 354 RequestPeer* new_peer = |
355 delegate_->OnReceivedResponse( | 355 delegate_->OnReceivedResponse( |
356 request_info->peer, response_head.mime_type, request_info->url); | 356 request_info->peer, response_head.mime_type, request_info->url); |
357 if (new_peer) | 357 if (new_peer) |
358 request_info->peer = new_peer; | 358 request_info->peer = new_peer; |
359 } | 359 } |
360 | 360 |
361 // Updates the response_url if the response was fetched via a ServiceWorker, | |
362 // and it was not generated inside the ServiceWorker. | |
363 if (response_head.was_fetched_via_service_worker && | |
364 !response_head.original_url_via_service_worker.is_empty()) { | |
365 request_info->response_url = response_head.original_url_via_service_worker; | |
Mike West
2014/07/09 12:14:46
Is overwriting the response url the right thing to
horo
2014/07/10 06:17:56
I think it's ok to overwrite the response url here
| |
366 } | |
367 | |
361 ResourceResponseInfo renderer_response_info; | 368 ResourceResponseInfo renderer_response_info; |
362 ToResourceResponseInfo(*request_info, response_head, &renderer_response_info); | 369 ToResourceResponseInfo(*request_info, response_head, &renderer_response_info); |
363 request_info->site_isolation_metadata = | 370 request_info->site_isolation_metadata = |
364 SiteIsolationPolicy::OnReceivedResponse(request_info->frame_origin, | 371 SiteIsolationPolicy::OnReceivedResponse(request_info->frame_origin, |
365 request_info->response_url, | 372 request_info->response_url, |
366 request_info->resource_type, | 373 request_info->resource_type, |
367 request_info->origin_pid, | 374 request_info->origin_pid, |
368 renderer_response_info); | 375 renderer_response_info); |
369 request_info->peer->OnReceivedResponse(renderer_response_info); | 376 request_info->peer->OnReceivedResponse(renderer_response_info); |
370 } | 377 } |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
852 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { | 859 void ResourceDispatcher::ReleaseResourcesInMessageQueue(MessageQueue* queue) { |
853 while (!queue->empty()) { | 860 while (!queue->empty()) { |
854 IPC::Message* message = queue->front(); | 861 IPC::Message* message = queue->front(); |
855 ReleaseResourcesInDataMessage(*message); | 862 ReleaseResourcesInDataMessage(*message); |
856 queue->pop_front(); | 863 queue->pop_front(); |
857 delete message; | 864 delete message; |
858 } | 865 } |
859 } | 866 } |
860 | 867 |
861 } // namespace content | 868 } // namespace content |
OLD | NEW |