| 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 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. | 5 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. |
| 6 | 6 |
| 7 #include "webkit/child/weburlloader_impl.h" | 7 #include "webkit/child/weburlloader_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" |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 load_flags |= net::LOAD_REPORT_RAW_HEADERS; | 353 load_flags |= net::LOAD_REPORT_RAW_HEADERS; |
| 354 | 354 |
| 355 if (!request.allowCookies() || !request.allowStoredCredentials()) { | 355 if (!request.allowCookies() || !request.allowStoredCredentials()) { |
| 356 load_flags |= net::LOAD_DO_NOT_SAVE_COOKIES; | 356 load_flags |= net::LOAD_DO_NOT_SAVE_COOKIES; |
| 357 load_flags |= net::LOAD_DO_NOT_SEND_COOKIES; | 357 load_flags |= net::LOAD_DO_NOT_SEND_COOKIES; |
| 358 } | 358 } |
| 359 | 359 |
| 360 if (!request.allowStoredCredentials()) | 360 if (!request.allowStoredCredentials()) |
| 361 load_flags |= net::LOAD_DO_NOT_SEND_AUTH_DATA; | 361 load_flags |= net::LOAD_DO_NOT_SEND_AUTH_DATA; |
| 362 | 362 |
| 363 if (request.targetType() == WebURLRequest::TargetIsXHR && |
| 364 (url.has_username() || url.has_password())) { |
| 365 load_flags |= net::LOAD_DO_NOT_PROMPT_FOR_LOGIN; |
| 366 } |
| 367 |
| 363 HeaderFlattener flattener(load_flags); | 368 HeaderFlattener flattener(load_flags); |
| 364 request.visitHTTPHeaderFields(&flattener); | 369 request.visitHTTPHeaderFields(&flattener); |
| 365 | 370 |
| 366 // TODO(brettw) this should take parameter encoding into account when | 371 // TODO(brettw) this should take parameter encoding into account when |
| 367 // creating the GURLs. | 372 // creating the GURLs. |
| 368 | 373 |
| 369 ResourceLoaderBridge::RequestInfo request_info; | 374 ResourceLoaderBridge::RequestInfo request_info; |
| 370 request_info.method = method; | 375 request_info.method = method; |
| 371 request_info.url = url; | 376 request_info.url = url; |
| 372 request_info.first_party_for_cookies = request.firstPartyForCookies(); | 377 request_info.first_party_for_cookies = request.firstPartyForCookies(); |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 | 853 |
| 849 void WebURLLoaderImpl::setDefersLoading(bool value) { | 854 void WebURLLoaderImpl::setDefersLoading(bool value) { |
| 850 context_->SetDefersLoading(value); | 855 context_->SetDefersLoading(value); |
| 851 } | 856 } |
| 852 | 857 |
| 853 void WebURLLoaderImpl::didChangePriority(WebURLRequest::Priority new_priority) { | 858 void WebURLLoaderImpl::didChangePriority(WebURLRequest::Priority new_priority) { |
| 854 context_->DidChangePriority(new_priority); | 859 context_->DidChangePriority(new_priority); |
| 855 } | 860 } |
| 856 | 861 |
| 857 } // namespace webkit_glue | 862 } // namespace webkit_glue |
| OLD | NEW |