Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: content/child/resource_dispatcher.cc

Issue 2632243005: [Mojo Loading] Cancel loading in a timely manner (Closed)
Patch Set: rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698