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

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

Issue 2625633002: Supporting changes in preparation of browser side mixed content checking. (Closed)
Patch Set: Address code review comments. 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
« no previous file with comments | « content/child/web_url_request_util.h ('k') | content/common/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
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 "content/child/request_extra_data.h"
15 #include "net/base/load_flags.h" 15 #include "net/base/load_flags.h"
16 #include "net/base/net_errors.h" 16 #include "net/base/net_errors.h"
17 #include "third_party/WebKit/public/platform/FilePathConversion.h" 17 #include "third_party/WebKit/public/platform/FilePathConversion.h"
18 #include "third_party/WebKit/public/platform/WebCachePolicy.h" 18 #include "third_party/WebKit/public/platform/WebCachePolicy.h"
19 #include "third_party/WebKit/public/platform/WebData.h" 19 #include "third_party/WebKit/public/platform/WebData.h"
20 #include "third_party/WebKit/public/platform/WebHTTPHeaderVisitor.h" 20 #include "third_party/WebKit/public/platform/WebHTTPHeaderVisitor.h"
21 #include "third_party/WebKit/public/platform/WebMixedContent.h"
21 #include "third_party/WebKit/public/platform/WebString.h" 22 #include "third_party/WebKit/public/platform/WebString.h"
22 #include "third_party/WebKit/public/platform/WebURL.h" 23 #include "third_party/WebKit/public/platform/WebURL.h"
23 #include "third_party/WebKit/public/platform/WebURLError.h" 24 #include "third_party/WebKit/public/platform/WebURLError.h"
24 #include "third_party/WebKit/public/platform/WebURLRequest.h" 25 #include "third_party/WebKit/public/platform/WebURLRequest.h"
25 26
26 using blink::WebCachePolicy; 27 using blink::WebCachePolicy;
27 using blink::WebData; 28 using blink::WebData;
28 using blink::WebHTTPBody; 29 using blink::WebHTTPBody;
29 using blink::WebString; 30 using blink::WebString;
30 using blink::WebURLRequest; 31 using blink::WebURLRequest;
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 STATIC_ASSERT_ENUM(REQUEST_CONTEXT_TYPE_XML_HTTP_REQUEST, 465 STATIC_ASSERT_ENUM(REQUEST_CONTEXT_TYPE_XML_HTTP_REQUEST,
465 WebURLRequest::RequestContextXMLHttpRequest); 466 WebURLRequest::RequestContextXMLHttpRequest);
466 STATIC_ASSERT_ENUM(REQUEST_CONTEXT_TYPE_XSLT, 467 STATIC_ASSERT_ENUM(REQUEST_CONTEXT_TYPE_XSLT,
467 WebURLRequest::RequestContextXSLT); 468 WebURLRequest::RequestContextXSLT);
468 469
469 RequestContextType GetRequestContextTypeForWebURLRequest( 470 RequestContextType GetRequestContextTypeForWebURLRequest(
470 const blink::WebURLRequest& request) { 471 const blink::WebURLRequest& request) {
471 return static_cast<RequestContextType>(request.getRequestContext()); 472 return static_cast<RequestContextType>(request.getRequestContext());
472 } 473 }
473 474
475 blink::WebMixedContentContextType GetMixedContentContextTypeForWebURLRequest(
476 const blink::WebURLRequest& request) {
477 bool block_mixed_plugin_content = false;
478 if (request.getExtraData()) {
479 RequestExtraData* extra_data =
480 static_cast<RequestExtraData*>(request.getExtraData());
481 block_mixed_plugin_content = extra_data->block_mixed_plugin_content();
482 }
483
484 return blink::WebMixedContent::contextTypeFromRequestContext(
485 request.getRequestContext(), block_mixed_plugin_content);
486 }
487
474 STATIC_ASSERT_ENUM(SkipServiceWorker::NONE, 488 STATIC_ASSERT_ENUM(SkipServiceWorker::NONE,
475 WebURLRequest::SkipServiceWorker::None); 489 WebURLRequest::SkipServiceWorker::None);
476 STATIC_ASSERT_ENUM(SkipServiceWorker::CONTROLLING, 490 STATIC_ASSERT_ENUM(SkipServiceWorker::CONTROLLING,
477 WebURLRequest::SkipServiceWorker::Controlling); 491 WebURLRequest::SkipServiceWorker::Controlling);
478 STATIC_ASSERT_ENUM(SkipServiceWorker::ALL, 492 STATIC_ASSERT_ENUM(SkipServiceWorker::ALL,
479 WebURLRequest::SkipServiceWorker::All); 493 WebURLRequest::SkipServiceWorker::All);
480 494
481 SkipServiceWorker GetSkipServiceWorkerForWebURLRequest( 495 SkipServiceWorker GetSkipServiceWorkerForWebURLRequest(
482 const blink::WebURLRequest& request) { 496 const blink::WebURLRequest& request) {
483 return static_cast<SkipServiceWorker>(request.skipServiceWorker()); 497 return static_cast<SkipServiceWorker>(request.skipServiceWorker());
(...skipping 25 matching lines...) Expand all
509 bool stale_copy_in_cache, 523 bool stale_copy_in_cache,
510 int reason, 524 int reason,
511 bool was_ignored_by_handler) { 525 bool was_ignored_by_handler) {
512 blink::WebURLError error = 526 blink::WebURLError error =
513 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason); 527 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason);
514 error.wasIgnoredByHandler = was_ignored_by_handler; 528 error.wasIgnoredByHandler = was_ignored_by_handler;
515 return error; 529 return error;
516 } 530 }
517 531
518 } // namespace content 532 } // namespace content
OLDNEW
« no previous file with comments | « content/child/web_url_request_util.h ('k') | content/common/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698