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 25 matching lines...) Expand all Loading... |
36 #include "content/public/common/content_switches.h" | 36 #include "content/public/common/content_switches.h" |
37 #include "net/base/data_url.h" | 37 #include "net/base/data_url.h" |
38 #include "net/base/filename_util.h" | 38 #include "net/base/filename_util.h" |
39 #include "net/base/net_errors.h" | 39 #include "net/base/net_errors.h" |
40 #include "net/http/http_response_headers.h" | 40 #include "net/http/http_response_headers.h" |
41 #include "net/http/http_util.h" | 41 #include "net/http/http_util.h" |
42 #include "net/ssl/ssl_cipher_suite_names.h" | 42 #include "net/ssl/ssl_cipher_suite_names.h" |
43 #include "net/ssl/ssl_connection_status_flags.h" | 43 #include "net/ssl/ssl_connection_status_flags.h" |
44 #include "net/url_request/url_request_data_job.h" | 44 #include "net/url_request/url_request_data_job.h" |
45 #include "third_party/WebKit/public/platform/WebHTTPLoadInfo.h" | 45 #include "third_party/WebKit/public/platform/WebHTTPLoadInfo.h" |
| 46 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
46 #include "third_party/WebKit/public/platform/WebTraceLocation.h" | 47 #include "third_party/WebKit/public/platform/WebTraceLocation.h" |
47 #include "third_party/WebKit/public/platform/WebURL.h" | 48 #include "third_party/WebKit/public/platform/WebURL.h" |
48 #include "third_party/WebKit/public/platform/WebURLError.h" | 49 #include "third_party/WebKit/public/platform/WebURLError.h" |
49 #include "third_party/WebKit/public/platform/WebURLLoadTiming.h" | 50 #include "third_party/WebKit/public/platform/WebURLLoadTiming.h" |
50 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" | 51 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" |
51 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 52 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
52 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 53 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
53 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 54 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
54 | 55 |
55 using base::Time; | 56 using base::Time; |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 // TODO(brettw) this should take parameter encoding into account when | 463 // TODO(brettw) this should take parameter encoding into account when |
463 // creating the GURLs. | 464 // creating the GURLs. |
464 | 465 |
465 // TODO(horo): Check credentials flag is unset when credentials mode is omit. | 466 // TODO(horo): Check credentials flag is unset when credentials mode is omit. |
466 // Check credentials flag is set when credentials mode is include. | 467 // Check credentials flag is set when credentials mode is include. |
467 | 468 |
468 RequestInfo request_info; | 469 RequestInfo request_info; |
469 request_info.method = method; | 470 request_info.method = method; |
470 request_info.url = url; | 471 request_info.url = url; |
471 request_info.first_party_for_cookies = request.firstPartyForCookies(); | 472 request_info.first_party_for_cookies = request.firstPartyForCookies(); |
| 473 request_info.request_initiator = request.requestorOrigin(); |
472 referrer_policy_ = request.referrerPolicy(); | 474 referrer_policy_ = request.referrerPolicy(); |
473 request_info.referrer = Referrer(referrer_url, referrer_policy_); | 475 request_info.referrer = Referrer(referrer_url, referrer_policy_); |
474 request_info.headers = GetWebURLRequestHeaders(request); | 476 request_info.headers = GetWebURLRequestHeaders(request); |
475 request_info.load_flags = GetLoadFlagsForWebURLRequest(request); | 477 request_info.load_flags = GetLoadFlagsForWebURLRequest(request); |
476 request_info.enable_load_timing = true; | 478 request_info.enable_load_timing = true; |
477 request_info.enable_upload_progress = request.reportUploadProgress(); | 479 request_info.enable_upload_progress = request.reportUploadProgress(); |
478 if (request.requestContext() == WebURLRequest::RequestContextXMLHttpRequest && | 480 if (request.requestContext() == WebURLRequest::RequestContextXMLHttpRequest && |
479 (url.has_username() || url.has_password())) { | 481 (url.has_username() || url.has_password())) { |
480 request_info.do_not_prompt_for_login = true; | 482 request_info.do_not_prompt_for_login = true; |
481 } | 483 } |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1090 } | 1092 } |
1091 | 1093 |
1092 void WebURLLoaderImpl::setLoadingTaskRunner( | 1094 void WebURLLoaderImpl::setLoadingTaskRunner( |
1093 blink::WebTaskRunner* loading_task_runner) { | 1095 blink::WebTaskRunner* loading_task_runner) { |
1094 // There's no guarantee on the lifetime of |loading_task_runner| so we take a | 1096 // There's no guarantee on the lifetime of |loading_task_runner| so we take a |
1095 // copy. | 1097 // copy. |
1096 context_->SetWebTaskRunner(make_scoped_ptr(loading_task_runner->clone())); | 1098 context_->SetWebTaskRunner(make_scoped_ptr(loading_task_runner->clone())); |
1097 } | 1099 } |
1098 | 1100 |
1099 } // namespace content | 1101 } // namespace content |
OLD | NEW |