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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 int intra_priority_value) { | 564 int intra_priority_value) { |
565 DCHECK(base::ContainsKey(pending_requests_, request_id)); | 565 DCHECK(base::ContainsKey(pending_requests_, request_id)); |
566 message_sender_->Send(new ResourceHostMsg_DidChangePriority( | 566 message_sender_->Send(new ResourceHostMsg_DidChangePriority( |
567 request_id, new_priority, intra_priority_value)); | 567 request_id, new_priority, intra_priority_value)); |
568 } | 568 } |
569 | 569 |
570 ResourceDispatcher::PendingRequestInfo::PendingRequestInfo( | 570 ResourceDispatcher::PendingRequestInfo::PendingRequestInfo( |
571 std::unique_ptr<RequestPeer> peer, | 571 std::unique_ptr<RequestPeer> peer, |
572 ResourceType resource_type, | 572 ResourceType resource_type, |
573 int origin_pid, | 573 int origin_pid, |
574 const GURL& frame_origin, | 574 const url::Origin& frame_origin, |
575 const GURL& request_url, | 575 const GURL& request_url, |
576 bool download_to_file) | 576 bool download_to_file) |
577 : peer(std::move(peer)), | 577 : peer(std::move(peer)), |
578 resource_type(resource_type), | 578 resource_type(resource_type), |
579 origin_pid(origin_pid), | 579 origin_pid(origin_pid), |
580 url(request_url), | 580 url(request_url), |
581 frame_origin(frame_origin), | 581 frame_origin(frame_origin), |
582 response_url(request_url), | 582 response_url(request_url), |
583 download_to_file(download_to_file), | 583 download_to_file(download_to_file), |
584 request_start(base::TimeTicks::Now()) {} | 584 request_start(base::TimeTicks::Now()) {} |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 response->download_file_path = result.download_file_path; | 674 response->download_file_path = result.download_file_path; |
675 response->socket_address = result.socket_address; | 675 response->socket_address = result.socket_address; |
676 response->encoded_data_length = result.encoded_data_length; | 676 response->encoded_data_length = result.encoded_data_length; |
677 response->encoded_body_length = result.encoded_body_length; | 677 response->encoded_body_length = result.encoded_body_length; |
678 } | 678 } |
679 | 679 |
680 int ResourceDispatcher::StartAsync( | 680 int ResourceDispatcher::StartAsync( |
681 std::unique_ptr<ResourceRequest> request, | 681 std::unique_ptr<ResourceRequest> request, |
682 int routing_id, | 682 int routing_id, |
683 scoped_refptr<base::SingleThreadTaskRunner> loading_task_runner, | 683 scoped_refptr<base::SingleThreadTaskRunner> loading_task_runner, |
684 const GURL& frame_origin, | 684 const url::Origin& frame_origin, |
685 std::unique_ptr<RequestPeer> peer, | 685 std::unique_ptr<RequestPeer> peer, |
686 blink::WebURLRequest::LoadingIPCType ipc_type, | 686 blink::WebURLRequest::LoadingIPCType ipc_type, |
687 mojom::URLLoaderFactory* url_loader_factory, | 687 mojom::URLLoaderFactory* url_loader_factory, |
688 mojo::AssociatedGroup* associated_group) { | 688 mojo::AssociatedGroup* associated_group) { |
689 CheckSchemeForReferrerPolicy(*request); | 689 CheckSchemeForReferrerPolicy(*request); |
690 | 690 |
691 // Compute a unique request_id for this renderer process. | 691 // Compute a unique request_id for this renderer process. |
692 int request_id = MakeRequestID(); | 692 int request_id = MakeRequestID(); |
693 pending_requests_[request_id] = base::MakeUnique<PendingRequestInfo>( | 693 pending_requests_[request_id] = base::MakeUnique<PendingRequestInfo>( |
694 std::move(peer), request->resource_type, request->origin_pid, | 694 std::move(peer), request->resource_type, request->origin_pid, |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 delete message; | 852 delete message; |
853 } | 853 } |
854 } | 854 } |
855 | 855 |
856 void ResourceDispatcher::SetResourceSchedulingFilter( | 856 void ResourceDispatcher::SetResourceSchedulingFilter( |
857 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { | 857 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { |
858 resource_scheduling_filter_ = resource_scheduling_filter; | 858 resource_scheduling_filter_ = resource_scheduling_filter; |
859 } | 859 } |
860 | 860 |
861 } // namespace content | 861 } // namespace content |
OLD | NEW |