| 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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 PendingRequestMap::iterator it = pending_requests_.find(request_id); | 410 PendingRequestMap::iterator it = pending_requests_.find(request_id); |
| 411 if (it == pending_requests_.end()) | 411 if (it == pending_requests_.end()) |
| 412 return false; | 412 return false; |
| 413 | 413 |
| 414 PendingRequestInfo* request_info = it->second.get(); | 414 PendingRequestInfo* request_info = it->second.get(); |
| 415 | 415 |
| 416 bool release_downloaded_file = request_info->download_to_file; | 416 bool release_downloaded_file = request_info->download_to_file; |
| 417 | 417 |
| 418 ReleaseResourcesInMessageQueue(&request_info->deferred_message_queue); | 418 ReleaseResourcesInMessageQueue(&request_info->deferred_message_queue); |
| 419 | 419 |
| 420 // Cancel loading. |
| 421 it->second->url_loader = nullptr; |
| 420 // Clear URLLoaderClient to stop receiving further Mojo IPC from the browser | 422 // Clear URLLoaderClient to stop receiving further Mojo IPC from the browser |
| 421 // process. | 423 // process. |
| 422 it->second->url_loader_client = nullptr; | 424 it->second->url_loader_client = nullptr; |
| 423 | 425 |
| 424 // Always delete the pending_request asyncly so that cancelling the request | 426 // Always delete the pending_request asyncly so that cancelling the request |
| 425 // doesn't delete the request context info while its response is still being | 427 // doesn't delete the request context info while its response is still being |
| 426 // handled. | 428 // handled. |
| 427 main_thread_task_runner_->DeleteSoon(FROM_HERE, it->second.release()); | 429 main_thread_task_runner_->DeleteSoon(FROM_HERE, it->second.release()); |
| 428 pending_requests_.erase(it); | 430 pending_requests_.erase(it); |
| 429 | 431 |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 delete message; | 813 delete message; |
| 812 } | 814 } |
| 813 } | 815 } |
| 814 | 816 |
| 815 void ResourceDispatcher::SetResourceSchedulingFilter( | 817 void ResourceDispatcher::SetResourceSchedulingFilter( |
| 816 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { | 818 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { |
| 817 resource_scheduling_filter_ = resource_scheduling_filter; | 819 resource_scheduling_filter_ = resource_scheduling_filter; |
| 818 } | 820 } |
| 819 | 821 |
| 820 } // namespace content | 822 } // namespace content |
| OLD | NEW |