Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Side by Side Diff: content/child/web_url_request_util.cc

Issue 1905033002: PlzNavigate: Move navigation-level mixed content checks to the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@console-security-message
Patch Set: MixedContent::ContextType comes from the renderer; lessen Blink public code; fixed build. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698