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

Side by Side Diff: third_party/WebKit/Source/core/loader/DocumentLoader.cpp

Issue 2790693002: Split CSP into pre- and post-upgrade checks (Closed)
Patch Set: add mkwst TODO Created 3 years, 8 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 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 // If the redirecting url is not allowed to display content from the target 460 // If the redirecting url is not allowed to display content from the target
461 // origin, then block the redirect. 461 // origin, then block the redirect.
462 const KURL& request_url = request_.Url(); 462 const KURL& request_url = request_.Url();
463 RefPtr<SecurityOrigin> redirecting_origin = 463 RefPtr<SecurityOrigin> redirecting_origin =
464 SecurityOrigin::Create(redirect_response.Url()); 464 SecurityOrigin::Create(redirect_response.Url());
465 if (!redirecting_origin->CanDisplay(request_url)) { 465 if (!redirecting_origin->CanDisplay(request_url)) {
466 FrameLoader::ReportLocalLoadFailed(frame_, request_url.GetString()); 466 FrameLoader::ReportLocalLoadFailed(frame_, request_url.GetString());
467 fetcher_->StopFetching(); 467 fetcher_->StopFetching();
468 return false; 468 return false;
469 } 469 }
470 if (GetFrameLoader().ShouldContinueForNavigationPolicy( 470 if (GetFrameLoader().ShouldContinueForRedirectNavigationPolicy(
471 request_, SubstituteData(), this, kCheckContentSecurityPolicy, 471 request_, SubstituteData(), this, kCheckContentSecurityPolicy,
472 navigation_type_, kNavigationPolicyCurrentTab, load_type_, 472 navigation_type_, kNavigationPolicyCurrentTab, load_type_,
473 IsClientRedirect(), nullptr) != kNavigationPolicyCurrentTab) { 473 IsClientRedirect(), nullptr) != kNavigationPolicyCurrentTab) {
474 fetcher_->StopFetching(); 474 fetcher_->StopFetching();
475 return false; 475 return false;
476 } 476 }
477 477
478 DCHECK(GetTiming().FetchStart()); 478 DCHECK(GetTiming().FetchStart());
479 AppendRedirect(request_url); 479 AppendRedirect(request_url);
480 GetTiming().AddRedirect(redirect_response.Url(), request_url); 480 GetTiming().AddRedirect(redirect_response.Url(), request_url);
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 InstallNewDocumentReason::kJavascriptURL, 1086 InstallNewDocumentReason::kJavascriptURL,
1087 kForceSynchronousParsing, KURL()); 1087 kForceSynchronousParsing, KURL());
1088 if (!source.IsNull()) 1088 if (!source.IsNull())
1089 writer_->AppendReplacingData(source); 1089 writer_->AppendReplacingData(source);
1090 EndWriting(); 1090 EndWriting();
1091 } 1091 }
1092 1092
1093 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 1093 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
1094 1094
1095 } // namespace blink 1095 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698