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 <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 PendingRequestMap::iterator it = pending_requests_.find(request_id); | 446 PendingRequestMap::iterator it = pending_requests_.find(request_id); |
447 if (it == pending_requests_.end()) | 447 if (it == pending_requests_.end()) |
448 return false; | 448 return false; |
449 | 449 |
450 PendingRequestInfo* request_info = it->second.get(); | 450 PendingRequestInfo* request_info = it->second.get(); |
451 | 451 |
452 bool release_downloaded_file = request_info->download_to_file; | 452 bool release_downloaded_file = request_info->download_to_file; |
453 | 453 |
454 ReleaseResourcesInMessageQueue(&request_info->deferred_message_queue); | 454 ReleaseResourcesInMessageQueue(&request_info->deferred_message_queue); |
455 | 455 |
456 // Clear URLLoaderClient to stop receiving further Mojo IPC from the browser | |
457 // process. | |
458 it->second->url_loader_client = nullptr; | |
459 | |
460 // Always delete the pending_request asyncly so that cancelling the request | 456 // Always delete the pending_request asyncly so that cancelling the request |
461 // doesn't delete the request context info while its response is still being | 457 // doesn't delete the request context info while its response is still being |
462 // handled. | 458 // handled. |
463 main_thread_task_runner_->DeleteSoon(FROM_HERE, it->second.release()); | 459 main_thread_task_runner_->DeleteSoon(FROM_HERE, it->second.release()); |
464 pending_requests_.erase(it); | 460 pending_requests_.erase(it); |
465 | 461 |
466 if (release_downloaded_file) { | 462 if (release_downloaded_file) { |
467 message_sender_->Send( | 463 message_sender_->Send( |
468 new ResourceHostMsg_ReleaseDownloadedFile(request_id)); | 464 new ResourceHostMsg_ReleaseDownloadedFile(request_id)); |
469 } | 465 } |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 delete message; | 810 delete message; |
815 } | 811 } |
816 } | 812 } |
817 | 813 |
818 void ResourceDispatcher::SetResourceSchedulingFilter( | 814 void ResourceDispatcher::SetResourceSchedulingFilter( |
819 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { | 815 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { |
820 resource_scheduling_filter_ = resource_scheduling_filter; | 816 resource_scheduling_filter_ = resource_scheduling_filter; |
821 } | 817 } |
822 | 818 |
823 } // namespace content | 819 } // namespace content |
OLD | NEW |