| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "net/base/load_flags.h" | 9 #include "net/base/load_flags.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 283 |
| 284 STATIC_ASSERT_MATCHING_ENUMS(FETCH_REQUEST_MODE_SAME_ORIGIN, | 284 STATIC_ASSERT_MATCHING_ENUMS(FETCH_REQUEST_MODE_SAME_ORIGIN, |
| 285 WebURLRequest::FetchRequestModeSameOrigin); | 285 WebURLRequest::FetchRequestModeSameOrigin); |
| 286 STATIC_ASSERT_MATCHING_ENUMS(FETCH_REQUEST_MODE_NO_CORS, | 286 STATIC_ASSERT_MATCHING_ENUMS(FETCH_REQUEST_MODE_NO_CORS, |
| 287 WebURLRequest::FetchRequestModeNoCORS); | 287 WebURLRequest::FetchRequestModeNoCORS); |
| 288 STATIC_ASSERT_MATCHING_ENUMS(FETCH_REQUEST_MODE_CORS, | 288 STATIC_ASSERT_MATCHING_ENUMS(FETCH_REQUEST_MODE_CORS, |
| 289 WebURLRequest::FetchRequestModeCORS); | 289 WebURLRequest::FetchRequestModeCORS); |
| 290 STATIC_ASSERT_MATCHING_ENUMS( | 290 STATIC_ASSERT_MATCHING_ENUMS( |
| 291 FETCH_REQUEST_MODE_CORS_WITH_FORCED_PREFLIGHT, | 291 FETCH_REQUEST_MODE_CORS_WITH_FORCED_PREFLIGHT, |
| 292 WebURLRequest::FetchRequestModeCORSWithForcedPreflight); | 292 WebURLRequest::FetchRequestModeCORSWithForcedPreflight); |
| 293 STATIC_ASSERT_MATCHING_ENUMS(FETCH_REQUEST_MODE_NAVIGATE, |
| 294 WebURLRequest::FetchRequestModeNavigate); |
| 293 | 295 |
| 294 FetchRequestMode GetFetchRequestModeForWebURLRequest( | 296 FetchRequestMode GetFetchRequestModeForWebURLRequest( |
| 295 const blink::WebURLRequest& request) { | 297 const blink::WebURLRequest& request) { |
| 296 return static_cast<FetchRequestMode>(request.fetchRequestMode()); | 298 return static_cast<FetchRequestMode>(request.fetchRequestMode()); |
| 297 } | 299 } |
| 298 | 300 |
| 299 STATIC_ASSERT_MATCHING_ENUMS(FETCH_CREDENTIALS_MODE_OMIT, | 301 STATIC_ASSERT_MATCHING_ENUMS(FETCH_CREDENTIALS_MODE_OMIT, |
| 300 WebURLRequest::FetchCredentialsModeOmit); | 302 WebURLRequest::FetchCredentialsModeOmit); |
| 301 STATIC_ASSERT_MATCHING_ENUMS(FETCH_CREDENTIALS_MODE_SAME_ORIGIN, | 303 STATIC_ASSERT_MATCHING_ENUMS(FETCH_CREDENTIALS_MODE_SAME_ORIGIN, |
| 302 WebURLRequest::FetchCredentialsModeSameOrigin); | 304 WebURLRequest::FetchCredentialsModeSameOrigin); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 bool stale_copy_in_cache, | 434 bool stale_copy_in_cache, |
| 433 int reason, | 435 int reason, |
| 434 bool was_ignored_by_handler) { | 436 bool was_ignored_by_handler) { |
| 435 blink::WebURLError error = | 437 blink::WebURLError error = |
| 436 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason); | 438 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason); |
| 437 error.wasIgnoredByHandler = was_ignored_by_handler; | 439 error.wasIgnoredByHandler = was_ignored_by_handler; |
| 438 return error; | 440 return error; |
| 439 } | 441 } |
| 440 | 442 |
| 441 } // namespace content | 443 } // namespace content |
| OLD | NEW |