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