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 |
456 // Always delete the pending_request asyncly so that cancelling the request | 460 // Always delete the pending_request asyncly so that cancelling the request |
457 // doesn't delete the request context info while its response is still being | 461 // doesn't delete the request context info while its response is still being |
458 // handled. | 462 // handled. |
459 main_thread_task_runner_->DeleteSoon(FROM_HERE, it->second.release()); | 463 main_thread_task_runner_->DeleteSoon(FROM_HERE, it->second.release()); |
460 pending_requests_.erase(it); | 464 pending_requests_.erase(it); |
461 | 465 |
462 if (release_downloaded_file) { | 466 if (release_downloaded_file) { |
463 message_sender_->Send( | 467 message_sender_->Send( |
464 new ResourceHostMsg_ReleaseDownloadedFile(request_id)); | 468 new ResourceHostMsg_ReleaseDownloadedFile(request_id)); |
465 } | 469 } |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 delete message; | 814 delete message; |
811 } | 815 } |
812 } | 816 } |
813 | 817 |
814 void ResourceDispatcher::SetResourceSchedulingFilter( | 818 void ResourceDispatcher::SetResourceSchedulingFilter( |
815 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { | 819 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { |
816 resource_scheduling_filter_ = resource_scheduling_filter; | 820 resource_scheduling_filter_ = resource_scheduling_filter; |
817 } | 821 } |
818 | 822 |
819 } // namespace content | 823 } // namespace content |
OLD | NEW |