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 #include "content/child/web_url_loader_impl.h" | 5 #include "content/child/web_url_loader_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "content/public/child/request_peer.h" | 32 #include "content/public/child/request_peer.h" |
33 #include "content/public/common/content_switches.h" | 33 #include "content/public/common/content_switches.h" |
34 #include "net/base/data_url.h" | 34 #include "net/base/data_url.h" |
35 #include "net/base/filename_util.h" | 35 #include "net/base/filename_util.h" |
36 #include "net/base/net_errors.h" | 36 #include "net/base/net_errors.h" |
37 #include "net/http/http_response_headers.h" | 37 #include "net/http/http_response_headers.h" |
38 #include "net/http/http_util.h" | 38 #include "net/http/http_util.h" |
39 #include "net/url_request/redirect_info.h" | 39 #include "net/url_request/redirect_info.h" |
40 #include "net/url_request/url_request_data_job.h" | 40 #include "net/url_request/url_request_data_job.h" |
41 #include "third_party/WebKit/public/platform/WebHTTPLoadInfo.h" | 41 #include "third_party/WebKit/public/platform/WebHTTPLoadInfo.h" |
| 42 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
42 #include "third_party/WebKit/public/platform/WebURL.h" | 43 #include "third_party/WebKit/public/platform/WebURL.h" |
43 #include "third_party/WebKit/public/platform/WebURLError.h" | 44 #include "third_party/WebKit/public/platform/WebURLError.h" |
44 #include "third_party/WebKit/public/platform/WebURLLoadTiming.h" | 45 #include "third_party/WebKit/public/platform/WebURLLoadTiming.h" |
45 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" | 46 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" |
46 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 47 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
47 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 48 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
48 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | |
49 | 49 |
50 using base::Time; | 50 using base::Time; |
51 using base::TimeTicks; | 51 using base::TimeTicks; |
52 using blink::WebData; | 52 using blink::WebData; |
53 using blink::WebHTTPBody; | 53 using blink::WebHTTPBody; |
54 using blink::WebHTTPHeaderVisitor; | 54 using blink::WebHTTPHeaderVisitor; |
55 using blink::WebHTTPLoadInfo; | 55 using blink::WebHTTPLoadInfo; |
56 using blink::WebReferrerPolicy; | 56 using blink::WebReferrerPolicy; |
57 using blink::WebSecurityPolicy; | 57 using blink::WebSecurityOrigin; |
58 using blink::WebString; | 58 using blink::WebString; |
59 using blink::WebURL; | 59 using blink::WebURL; |
60 using blink::WebURLError; | 60 using blink::WebURLError; |
61 using blink::WebURLLoadTiming; | 61 using blink::WebURLLoadTiming; |
62 using blink::WebURLLoader; | 62 using blink::WebURLLoader; |
63 using blink::WebURLLoaderClient; | 63 using blink::WebURLLoaderClient; |
64 using blink::WebURLRequest; | 64 using blink::WebURLRequest; |
65 using blink::WebURLResponse; | 65 using blink::WebURLResponse; |
66 | 66 |
67 namespace content { | 67 namespace content { |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 // TODO(brettw) this should take parameter encoding into account when | 476 // TODO(brettw) this should take parameter encoding into account when |
477 // creating the GURLs. | 477 // creating the GURLs. |
478 | 478 |
479 // TODO(horo): Check credentials flag is unset when credentials mode is omit. | 479 // TODO(horo): Check credentials flag is unset when credentials mode is omit. |
480 // Check credentials flag is set when credentials mode is include. | 480 // Check credentials flag is set when credentials mode is include. |
481 | 481 |
482 RequestInfo request_info; | 482 RequestInfo request_info; |
483 request_info.method = method; | 483 request_info.method = method; |
484 request_info.url = url; | 484 request_info.url = url; |
485 request_info.first_party_for_cookies = request.firstPartyForCookies(); | 485 request_info.first_party_for_cookies = request.firstPartyForCookies(); |
| 486 request_info.requestor_origin = request.requestorOrigin(); |
486 referrer_policy_ = request.referrerPolicy(); | 487 referrer_policy_ = request.referrerPolicy(); |
487 request_info.referrer = Referrer(referrer_url, referrer_policy_); | 488 request_info.referrer = Referrer(referrer_url, referrer_policy_); |
488 request_info.headers = GetWebURLRequestHeaders(request); | 489 request_info.headers = GetWebURLRequestHeaders(request); |
489 request_info.load_flags = GetLoadFlagsForWebURLRequest(request); | 490 request_info.load_flags = GetLoadFlagsForWebURLRequest(request); |
490 request_info.enable_load_timing = true; | 491 request_info.enable_load_timing = true; |
491 request_info.enable_upload_progress = request.reportUploadProgress(); | 492 request_info.enable_upload_progress = request.reportUploadProgress(); |
492 if (request.requestContext() == WebURLRequest::RequestContextXMLHttpRequest && | 493 if (request.requestContext() == WebURLRequest::RequestContextXMLHttpRequest && |
493 (url.has_username() || url.has_password())) { | 494 (url.has_username() || url.has_password())) { |
494 request_info.do_not_prompt_for_login = true; | 495 request_info.do_not_prompt_for_login = true; |
495 } | 496 } |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1062 int intra_priority_value) { | 1063 int intra_priority_value) { |
1063 context_->DidChangePriority(new_priority, intra_priority_value); | 1064 context_->DidChangePriority(new_priority, intra_priority_value); |
1064 } | 1065 } |
1065 | 1066 |
1066 bool WebURLLoaderImpl::attachThreadedDataReceiver( | 1067 bool WebURLLoaderImpl::attachThreadedDataReceiver( |
1067 blink::WebThreadedDataReceiver* threaded_data_receiver) { | 1068 blink::WebThreadedDataReceiver* threaded_data_receiver) { |
1068 return context_->AttachThreadedDataReceiver(threaded_data_receiver); | 1069 return context_->AttachThreadedDataReceiver(threaded_data_receiver); |
1069 } | 1070 } |
1070 | 1071 |
1071 } // namespace content | 1072 } // namespace content |
OLD | NEW |