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 if (it->second->url_loader_client) | |
457 it->second->url_loader_client = nullptr; | |
yhirano
2016/10/05 09:03:00
Would Calling Cancel be enough?
tzik
2016/10/06 04:14:02
As we chatted offline, URLLoaderClient (and URLLoa
yhirano
2016/10/06 06:53:05
Can you run this statement unconditionally?
tzik
2016/10/06 12:08:13
Done.
| |
458 | |
456 // Always delete the pending_request asyncly so that cancelling the request | 459 // 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 | 460 // doesn't delete the request context info while its response is still being |
458 // handled. | 461 // handled. |
459 main_thread_task_runner_->DeleteSoon(FROM_HERE, it->second.release()); | 462 main_thread_task_runner_->DeleteSoon(FROM_HERE, it->second.release()); |
460 pending_requests_.erase(it); | 463 pending_requests_.erase(it); |
461 | 464 |
462 if (release_downloaded_file) { | 465 if (release_downloaded_file) { |
463 message_sender_->Send( | 466 message_sender_->Send( |
464 new ResourceHostMsg_ReleaseDownloadedFile(request_id)); | 467 new ResourceHostMsg_ReleaseDownloadedFile(request_id)); |
465 } | 468 } |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
810 delete message; | 813 delete message; |
811 } | 814 } |
812 } | 815 } |
813 | 816 |
814 void ResourceDispatcher::SetResourceSchedulingFilter( | 817 void ResourceDispatcher::SetResourceSchedulingFilter( |
815 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { | 818 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { |
816 resource_scheduling_filter_ = resource_scheduling_filter; | 819 resource_scheduling_filter_ = resource_scheduling_filter; |
817 } | 820 } |
818 | 821 |
819 } // namespace content | 822 } // namespace content |
OLD | NEW |