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

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

Issue 1379543003: Revert of Post loading tasks on the appropriate WebFrameScheduler's queue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 bool release_downloaded_file = request_info.download_to_file; 396 bool release_downloaded_file = request_info.download_to_file;
398 397
399 ReleaseResourcesInMessageQueue(&request_info.deferred_message_queue); 398 ReleaseResourcesInMessageQueue(&request_info.deferred_message_queue);
400 pending_requests_.erase(it); 399 pending_requests_.erase(it);
401 400
402 if (release_downloaded_file) { 401 if (release_downloaded_file) {
403 message_sender_->Send( 402 message_sender_->Send(
404 new ResourceHostMsg_ReleaseDownloadedFile(request_id)); 403 new ResourceHostMsg_ReleaseDownloadedFile(request_id));
405 } 404 }
406 405
407 if (resource_scheduling_filter_.get())
408 resource_scheduling_filter_->ClearRequestIdTaskRunner(request_id);
409
410 return true; 406 return true;
411 } 407 }
412 408
413 void ResourceDispatcher::Cancel(int request_id) { 409 void ResourceDispatcher::Cancel(int request_id) {
414 PendingRequestList::iterator it = pending_requests_.find(request_id); 410 PendingRequestList::iterator it = pending_requests_.find(request_id);
415 if (it == pending_requests_.end()) { 411 if (it == pending_requests_.end()) {
416 DVLOG(1) << "unknown request"; 412 DVLOG(1) << "unknown request";
417 return; 413 return;
418 } 414 }
419 415
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 // Compute a unique request_id for this renderer process. 581 // Compute a unique request_id for this renderer process.
586 int request_id = MakeRequestID(); 582 int request_id = MakeRequestID();
587 pending_requests_[request_id] = 583 pending_requests_[request_id] =
588 PendingRequestInfo(peer, 584 PendingRequestInfo(peer,
589 request->resource_type, 585 request->resource_type,
590 request->origin_pid, 586 request->origin_pid,
591 frame_origin, 587 frame_origin,
592 request->url, 588 request->url,
593 request_info.download_to_file); 589 request_info.download_to_file);
594 590
595 if (resource_scheduling_filter_.get() &&
596 request_info.loading_web_task_runner) {
597 resource_scheduling_filter_->SetRequestIdTaskRunner(
598 request_id,
599 make_scoped_ptr(request_info.loading_web_task_runner->clone()));
600 }
601
602 message_sender_->Send(new ResourceHostMsg_RequestResource( 591 message_sender_->Send(new ResourceHostMsg_RequestResource(
603 request_info.routing_id, request_id, *request)); 592 request_info.routing_id, request_id, *request));
604 593
605 return request_id; 594 return request_id;
606 } 595 }
607 596
608 void ResourceDispatcher::ToResourceResponseInfo( 597 void ResourceDispatcher::ToResourceResponseInfo(
609 const PendingRequestInfo& request_info, 598 const PendingRequestInfo& request_info,
610 const ResourceResponseHead& browser_info, 599 const ResourceResponseHead& browser_info,
611 ResourceResponseInfo* renderer_info) const { 600 ResourceResponseInfo* renderer_info) const {
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 request->transferred_request_request_id = 787 request->transferred_request_request_id =
799 extra_data->transferred_request_request_id(); 788 extra_data->transferred_request_request_id();
800 request->service_worker_provider_id = 789 request->service_worker_provider_id =
801 extra_data->service_worker_provider_id(); 790 extra_data->service_worker_provider_id();
802 request->request_body = request_body; 791 request->request_body = request_body;
803 if (frame_origin) 792 if (frame_origin)
804 *frame_origin = extra_data->frame_origin(); 793 *frame_origin = extra_data->frame_origin();
805 return request.Pass(); 794 return request.Pass();
806 } 795 }
807 796
808 void ResourceDispatcher::SetResourceSchedulingFilter(
809 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) {
810 resource_scheduling_filter_ = resource_scheduling_filter;
811 }
812
813 } // namespace content 797 } // 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