| 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_request_util.h" | 5 #include "content/child/web_url_request_util.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <limits> | 10 #include <limits> |
| 11 | 11 |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "content/child/request_extra_data.h" |
| 14 #include "net/base/load_flags.h" | 15 #include "net/base/load_flags.h" |
| 15 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
| 16 #include "third_party/WebKit/public/platform/FilePathConversion.h" | 17 #include "third_party/WebKit/public/platform/FilePathConversion.h" |
| 17 #include "third_party/WebKit/public/platform/WebCachePolicy.h" | 18 #include "third_party/WebKit/public/platform/WebCachePolicy.h" |
| 18 #include "third_party/WebKit/public/platform/WebData.h" | 19 #include "third_party/WebKit/public/platform/WebData.h" |
| 19 #include "third_party/WebKit/public/platform/WebHTTPHeaderVisitor.h" | 20 #include "third_party/WebKit/public/platform/WebHTTPHeaderVisitor.h" |
| 20 #include "third_party/WebKit/public/platform/WebString.h" | 21 #include "third_party/WebKit/public/platform/WebString.h" |
| 21 #include "third_party/WebKit/public/platform/WebURL.h" | 22 #include "third_party/WebKit/public/platform/WebURL.h" |
| 22 #include "third_party/WebKit/public/platform/WebURLError.h" | 23 #include "third_party/WebKit/public/platform/WebURLError.h" |
| 23 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 24 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 } | 211 } |
| 211 | 212 |
| 212 if (!request.allowStoredCredentials()) { | 213 if (!request.allowStoredCredentials()) { |
| 213 load_flags |= net::LOAD_DO_NOT_SAVE_COOKIES; | 214 load_flags |= net::LOAD_DO_NOT_SAVE_COOKIES; |
| 214 load_flags |= net::LOAD_DO_NOT_SEND_COOKIES; | 215 load_flags |= net::LOAD_DO_NOT_SEND_COOKIES; |
| 215 } | 216 } |
| 216 | 217 |
| 217 if (!request.allowStoredCredentials()) | 218 if (!request.allowStoredCredentials()) |
| 218 load_flags |= net::LOAD_DO_NOT_SEND_AUTH_DATA; | 219 load_flags |= net::LOAD_DO_NOT_SEND_AUTH_DATA; |
| 219 | 220 |
| 221 if (request.getExtraData()) { |
| 222 RequestExtraData* extra_data = |
| 223 static_cast<RequestExtraData*>(request.getExtraData()); |
| 224 if (extra_data->is_prefetch()) |
| 225 load_flags |= net::LOAD_PREFETCH; |
| 226 } |
| 227 |
| 220 return load_flags; | 228 return load_flags; |
| 221 } | 229 } |
| 222 | 230 |
| 223 WebHTTPBody GetWebHTTPBodyForRequestBody( | 231 WebHTTPBody GetWebHTTPBodyForRequestBody( |
| 224 const scoped_refptr<ResourceRequestBodyImpl>& input) { | 232 const scoped_refptr<ResourceRequestBodyImpl>& input) { |
| 225 WebHTTPBody http_body; | 233 WebHTTPBody http_body; |
| 226 http_body.initialize(); | 234 http_body.initialize(); |
| 227 http_body.setIdentifier(input->identifier()); | 235 http_body.setIdentifier(input->identifier()); |
| 228 for (const auto& element : *input->elements()) { | 236 for (const auto& element : *input->elements()) { |
| 229 switch (element.type()) { | 237 switch (element.type()) { |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 bool stale_copy_in_cache, | 501 bool stale_copy_in_cache, |
| 494 int reason, | 502 int reason, |
| 495 bool was_ignored_by_handler) { | 503 bool was_ignored_by_handler) { |
| 496 blink::WebURLError error = | 504 blink::WebURLError error = |
| 497 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason); | 505 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason); |
| 498 error.wasIgnoredByHandler = was_ignored_by_handler; | 506 error.wasIgnoredByHandler = was_ignored_by_handler; |
| 499 return error; | 507 return error; |
| 500 } | 508 } |
| 501 | 509 |
| 502 } // namespace content | 510 } // namespace content |
| OLD | NEW |