| 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> |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 STATIC_ASSERT_ENUM(REQUEST_CONTEXT_TYPE_XML_HTTP_REQUEST, | 464 STATIC_ASSERT_ENUM(REQUEST_CONTEXT_TYPE_XML_HTTP_REQUEST, |
| 465 WebURLRequest::RequestContextXMLHttpRequest); | 465 WebURLRequest::RequestContextXMLHttpRequest); |
| 466 STATIC_ASSERT_ENUM(REQUEST_CONTEXT_TYPE_XSLT, | 466 STATIC_ASSERT_ENUM(REQUEST_CONTEXT_TYPE_XSLT, |
| 467 WebURLRequest::RequestContextXSLT); | 467 WebURLRequest::RequestContextXSLT); |
| 468 | 468 |
| 469 RequestContextType GetRequestContextTypeForWebURLRequest( | 469 RequestContextType GetRequestContextTypeForWebURLRequest( |
| 470 const blink::WebURLRequest& request) { | 470 const blink::WebURLRequest& request) { |
| 471 return static_cast<RequestContextType>(request.getRequestContext()); | 471 return static_cast<RequestContextType>(request.getRequestContext()); |
| 472 } | 472 } |
| 473 | 473 |
| 474 blink::WebMixedContent::ContextType GetMixedContentContextTypeForWebURLRequest( |
| 475 const blink::WebURLRequest& request) { |
| 476 bool block_mixed_plugin_content = false; |
| 477 if (request.getExtraData()) { |
| 478 RequestExtraData* extra_data = |
| 479 static_cast<RequestExtraData*>(request.getExtraData()); |
| 480 block_mixed_plugin_content = extra_data->block_mixed_plugin_content(); |
| 481 } |
| 482 |
| 483 return blink::WebMixedContent::contextTypeFromRequestContext( |
| 484 request.getRequestContext(), block_mixed_plugin_content); |
| 485 } |
| 486 |
| 474 STATIC_ASSERT_ENUM(SkipServiceWorker::NONE, | 487 STATIC_ASSERT_ENUM(SkipServiceWorker::NONE, |
| 475 WebURLRequest::SkipServiceWorker::None); | 488 WebURLRequest::SkipServiceWorker::None); |
| 476 STATIC_ASSERT_ENUM(SkipServiceWorker::CONTROLLING, | 489 STATIC_ASSERT_ENUM(SkipServiceWorker::CONTROLLING, |
| 477 WebURLRequest::SkipServiceWorker::Controlling); | 490 WebURLRequest::SkipServiceWorker::Controlling); |
| 478 STATIC_ASSERT_ENUM(SkipServiceWorker::ALL, | 491 STATIC_ASSERT_ENUM(SkipServiceWorker::ALL, |
| 479 WebURLRequest::SkipServiceWorker::All); | 492 WebURLRequest::SkipServiceWorker::All); |
| 480 | 493 |
| 481 SkipServiceWorker GetSkipServiceWorkerForWebURLRequest( | 494 SkipServiceWorker GetSkipServiceWorkerForWebURLRequest( |
| 482 const blink::WebURLRequest& request) { | 495 const blink::WebURLRequest& request) { |
| 483 return static_cast<SkipServiceWorker>(request.skipServiceWorker()); | 496 return static_cast<SkipServiceWorker>(request.skipServiceWorker()); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 509 bool stale_copy_in_cache, | 522 bool stale_copy_in_cache, |
| 510 int reason, | 523 int reason, |
| 511 bool was_ignored_by_handler) { | 524 bool was_ignored_by_handler) { |
| 512 blink::WebURLError error = | 525 blink::WebURLError error = |
| 513 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason); | 526 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason); |
| 514 error.wasIgnoredByHandler = was_ignored_by_handler; | 527 error.wasIgnoredByHandler = was_ignored_by_handler; |
| 515 return error; | 528 return error; |
| 516 } | 529 } |
| 517 | 530 |
| 518 } // namespace content | 531 } // namespace content |
| OLD | NEW |