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

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

Issue 1402933002: Revert "Post loading tasks on the appropriate WebFrameScheduler's queue." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix bad merge Created 5 years, 2 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 | « content/child/resource_dispatcher.h ('k') | content/child/resource_scheduling_filter.h » ('j') | 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 "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/debug/alias.h" 12 #include "base/debug/alias.h"
13 #include "base/debug/dump_without_crashing.h" 13 #include "base/debug/dump_without_crashing.h"
14 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
15 #include "base/memory/shared_memory.h" 15 #include "base/memory/shared_memory.h"
16 #include "base/message_loop/message_loop.h" 16 #include "base/message_loop/message_loop.h"
17 #include "base/metrics/histogram.h" 17 #include "base/metrics/histogram.h"
18 #include "base/strings/string_util.h" 18 #include "base/strings/string_util.h"
19 #include "content/child/request_extra_data.h" 19 #include "content/child/request_extra_data.h"
20 #include "content/child/request_info.h" 20 #include "content/child/request_info.h"
21 #include "content/child/resource_scheduling_filter.h"
22 #include "content/child/shared_memory_received_data_factory.h" 21 #include "content/child/shared_memory_received_data_factory.h"
23 #include "content/child/site_isolation_stats_gatherer.h" 22 #include "content/child/site_isolation_stats_gatherer.h"
24 #include "content/child/sync_load_response.h" 23 #include "content/child/sync_load_response.h"
25 #include "content/child/threaded_data_provider.h" 24 #include "content/child/threaded_data_provider.h"
26 #include "content/common/inter_process_time_ticks_converter.h" 25 #include "content/common/inter_process_time_ticks_converter.h"
27 #include "content/common/resource_messages.h" 26 #include "content/common/resource_messages.h"
28 #include "content/public/child/fixed_received_data.h" 27 #include "content/public/child/fixed_received_data.h"
29 #include "content/public/child/request_peer.h" 28 #include "content/public/child/request_peer.h"
30 #include "content/public/child/resource_dispatcher_delegate.h" 29 #include "content/public/child/resource_dispatcher_delegate.h"
31 #include "content/public/common/resource_response.h" 30 #include "content/public/common/resource_response.h"
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 bool release_downloaded_file = request_info.download_to_file; 407 bool release_downloaded_file = request_info.download_to_file;
409 408
410 ReleaseResourcesInMessageQueue(&request_info.deferred_message_queue); 409 ReleaseResourcesInMessageQueue(&request_info.deferred_message_queue);
411 pending_requests_.erase(it); 410 pending_requests_.erase(it);
412 411
413 if (release_downloaded_file) { 412 if (release_downloaded_file) {
414 message_sender_->Send( 413 message_sender_->Send(
415 new ResourceHostMsg_ReleaseDownloadedFile(request_id)); 414 new ResourceHostMsg_ReleaseDownloadedFile(request_id));
416 } 415 }
417 416
418 if (resource_scheduling_filter_.get())
419 resource_scheduling_filter_->ClearRequestIdTaskRunner(request_id);
420
421 return true; 417 return true;
422 } 418 }
423 419
424 void ResourceDispatcher::Cancel(int request_id) { 420 void ResourceDispatcher::Cancel(int request_id) {
425 PendingRequestList::iterator it = pending_requests_.find(request_id); 421 PendingRequestList::iterator it = pending_requests_.find(request_id);
426 if (it == pending_requests_.end()) { 422 if (it == pending_requests_.end()) {
427 DVLOG(1) << "unknown request"; 423 DVLOG(1) << "unknown request";
428 return; 424 return;
429 } 425 }
430 426
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 // Compute a unique request_id for this renderer process. 592 // Compute a unique request_id for this renderer process.
597 int request_id = MakeRequestID(); 593 int request_id = MakeRequestID();
598 pending_requests_[request_id] = 594 pending_requests_[request_id] =
599 PendingRequestInfo(peer, 595 PendingRequestInfo(peer,
600 request->resource_type, 596 request->resource_type,
601 request->origin_pid, 597 request->origin_pid,
602 frame_origin, 598 frame_origin,
603 request->url, 599 request->url,
604 request_info.download_to_file); 600 request_info.download_to_file);
605 601
606 if (resource_scheduling_filter_.get() &&
607 request_info.loading_web_task_runner) {
608 resource_scheduling_filter_->SetRequestIdTaskRunner(
609 request_id,
610 make_scoped_ptr(request_info.loading_web_task_runner->clone()));
611 }
612
613 message_sender_->Send(new ResourceHostMsg_RequestResource( 602 message_sender_->Send(new ResourceHostMsg_RequestResource(
614 request_info.routing_id, request_id, *request)); 603 request_info.routing_id, request_id, *request));
615 604
616 return request_id; 605 return request_id;
617 } 606 }
618 607
619 void ResourceDispatcher::ToResourceResponseInfo( 608 void ResourceDispatcher::ToResourceResponseInfo(
620 const PendingRequestInfo& request_info, 609 const PendingRequestInfo& request_info,
621 const ResourceResponseHead& browser_info, 610 const ResourceResponseHead& browser_info,
622 ResourceResponseInfo* renderer_info) const { 611 ResourceResponseInfo* renderer_info) const {
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 request->transferred_request_request_id = 798 request->transferred_request_request_id =
810 extra_data->transferred_request_request_id(); 799 extra_data->transferred_request_request_id();
811 request->service_worker_provider_id = 800 request->service_worker_provider_id =
812 extra_data->service_worker_provider_id(); 801 extra_data->service_worker_provider_id();
813 request->request_body = request_body; 802 request->request_body = request_body;
814 if (frame_origin) 803 if (frame_origin)
815 *frame_origin = extra_data->frame_origin(); 804 *frame_origin = extra_data->frame_origin();
816 return request.Pass(); 805 return request.Pass();
817 } 806 }
818 807
819 void ResourceDispatcher::SetResourceSchedulingFilter(
820 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) {
821 resource_scheduling_filter_ = resource_scheduling_filter;
822 }
823
824 } // namespace content 808 } // namespace content
OLDNEW
« no previous file with comments | « content/child/resource_dispatcher.h ('k') | content/child/resource_scheduling_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698