| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. | 5 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. |
| 6 | 6 |
| 7 #include "content/child/web_url_loader_impl.h" | 7 #include "content/child/web_url_loader_impl.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "content/child/ftp_directory_listing_response_delegate.h" | 15 #include "content/child/ftp_directory_listing_response_delegate.h" |
| 16 #include "content/child/multipart_response_delegate.h" | 16 #include "content/child/multipart_response_delegate.h" |
| 17 #include "content/child/request_extra_data.h" | 17 #include "content/child/request_extra_data.h" |
| 18 #include "content/child/request_info.h" | 18 #include "content/child/request_info.h" |
| 19 #include "content/child/resource_dispatcher.h" | 19 #include "content/child/resource_dispatcher.h" |
| 20 #include "content/child/sync_load_response.h" | 20 #include "content/child/sync_load_response.h" |
| 21 #include "content/child/web_url_request_util.h" |
| 21 #include "content/child/weburlresponse_extradata_impl.h" | 22 #include "content/child/weburlresponse_extradata_impl.h" |
| 22 #include "content/common/resource_request_body.h" | 23 #include "content/common/resource_request_body.h" |
| 23 #include "content/public/child/request_peer.h" | 24 #include "content/public/child/request_peer.h" |
| 24 #include "net/base/data_url.h" | 25 #include "net/base/data_url.h" |
| 25 #include "net/base/filename_util.h" | 26 #include "net/base/filename_util.h" |
| 26 #include "net/base/load_flags.h" | 27 #include "net/base/load_flags.h" |
| 27 #include "net/base/mime_util.h" | 28 #include "net/base/mime_util.h" |
| 28 #include "net/base/net_errors.h" | 29 #include "net/base/net_errors.h" |
| 29 #include "net/http/http_response_headers.h" | 30 #include "net/http/http_response_headers.h" |
| 30 #include "net/http/http_util.h" | 31 #include "net/http/http_util.h" |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 request_info.method = method; | 381 request_info.method = method; |
| 381 request_info.url = url; | 382 request_info.url = url; |
| 382 request_info.first_party_for_cookies = request.firstPartyForCookies(); | 383 request_info.first_party_for_cookies = request.firstPartyForCookies(); |
| 383 request_info.referrer = referrer_url; | 384 request_info.referrer = referrer_url; |
| 384 request_info.headers = flattener.GetBuffer(); | 385 request_info.headers = flattener.GetBuffer(); |
| 385 request_info.load_flags = load_flags; | 386 request_info.load_flags = load_flags; |
| 386 // requestor_pid only needs to be non-zero if the request originates outside | 387 // requestor_pid only needs to be non-zero if the request originates outside |
| 387 // the render process, so we can use requestorProcessID even for requests | 388 // the render process, so we can use requestorProcessID even for requests |
| 388 // from in-process plugins. | 389 // from in-process plugins. |
| 389 request_info.requestor_pid = request.requestorProcessID(); | 390 request_info.requestor_pid = request.requestorProcessID(); |
| 390 request_info.request_type = ResourceType::FromWebURLRequest(request); | 391 request_info.request_type = WebURLRequestToResourceType(request); |
| 391 request_info.priority = | 392 request_info.priority = |
| 392 ConvertWebKitPriorityToNetPriority(request.priority()); | 393 ConvertWebKitPriorityToNetPriority(request.priority()); |
| 393 request_info.appcache_host_id = request.appCacheHostID(); | 394 request_info.appcache_host_id = request.appCacheHostID(); |
| 394 request_info.routing_id = request.requestorID(); | 395 request_info.routing_id = request.requestorID(); |
| 395 request_info.download_to_file = request.downloadToFile(); | 396 request_info.download_to_file = request.downloadToFile(); |
| 396 request_info.has_user_gesture = request.hasUserGesture(); | 397 request_info.has_user_gesture = request.hasUserGesture(); |
| 397 request_info.extra_data = request.extraData(); | 398 request_info.extra_data = request.extraData(); |
| 398 referrer_policy_ = request.referrerPolicy(); | 399 referrer_policy_ = request.referrerPolicy(); |
| 399 request_info.referrer_policy = request.referrerPolicy(); | 400 request_info.referrer_policy = request.referrerPolicy(); |
| 400 bridge_.reset(resource_dispatcher_->CreateBridge(request_info)); | 401 bridge_.reset(resource_dispatcher_->CreateBridge(request_info)); |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 int intra_priority_value) { | 893 int intra_priority_value) { |
| 893 context_->DidChangePriority(new_priority, intra_priority_value); | 894 context_->DidChangePriority(new_priority, intra_priority_value); |
| 894 } | 895 } |
| 895 | 896 |
| 896 bool WebURLLoaderImpl::attachThreadedDataReceiver( | 897 bool WebURLLoaderImpl::attachThreadedDataReceiver( |
| 897 blink::WebThreadedDataReceiver* threaded_data_receiver) { | 898 blink::WebThreadedDataReceiver* threaded_data_receiver) { |
| 898 return context_->AttachThreadedDataReceiver(threaded_data_receiver); | 899 return context_->AttachThreadedDataReceiver(threaded_data_receiver); |
| 899 } | 900 } |
| 900 | 901 |
| 901 } // namespace content | 902 } // namespace content |
| OLD | NEW |