LEFT | RIGHT |
(no file at all) | |
1 /* | 1 /* |
2 * Copyright (C) 2006-2017 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006-2017 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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 return completionHandler(WTFMove(newRequest)); | 642 return completionHandler(WTFMove(newRequest)); |
643 | 643 |
644 auto navigationPolicyCompletionHandler = [this, protectedThis = makeRef(*thi
s), completionHandler = WTFMove(completionHandler)] (ResourceRequest&& request,
FormState*, ShouldContinue shouldContinue) mutable { | 644 auto navigationPolicyCompletionHandler = [this, protectedThis = makeRef(*thi
s), completionHandler = WTFMove(completionHandler)] (ResourceRequest&& request,
FormState*, ShouldContinue shouldContinue) mutable { |
645 m_waitingForNavigationPolicy = false; | 645 m_waitingForNavigationPolicy = false; |
646 switch (shouldContinue) { | 646 switch (shouldContinue) { |
647 case ShouldContinue::ForSuspension: | 647 case ShouldContinue::ForSuspension: |
648 // We handle suspension by navigating forward to about:blank, which
leaves us setup to navigate back to resume. | 648 // We handle suspension by navigating forward to about:blank, which
leaves us setup to navigate back to resume. |
649 request = { blankURL() }; | 649 request = { blankURL() }; |
650 break; | 650 break; |
651 case ShouldContinue::No: | 651 case ShouldContinue::No: |
| 652 case ShouldContinue::NoAndLockBackForwardList: |
652 stopLoadingForPolicyChange(); | 653 stopLoadingForPolicyChange(); |
653 break; | 654 break; |
654 case ShouldContinue::Yes: | 655 case ShouldContinue::Yes: |
655 break; | 656 break; |
656 } | 657 } |
657 | 658 |
658 completionHandler(WTFMove(request)); | 659 completionHandler(WTFMove(request)); |
659 }; | 660 }; |
660 | 661 |
661 ASSERT(!m_waitingForNavigationPolicy); | 662 ASSERT(!m_waitingForNavigationPolicy); |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
917 | 918 |
918 // It might have gone missing | 919 // It might have gone missing |
919 if (mainResourceLoader()) | 920 if (mainResourceLoader()) |
920 static_cast<ResourceLoader*>(mainResourceLoader())->didFail(interrup
tedForPolicyChangeError()); | 921 static_cast<ResourceLoader*>(mainResourceLoader())->didFail(interrup
tedForPolicyChangeError()); |
921 return; | 922 return; |
922 } | 923 } |
923 case PolicyAction::Suspend: | 924 case PolicyAction::Suspend: |
924 // It is invalid to get a Suspend policy based on navigation response. | 925 // It is invalid to get a Suspend policy based on navigation response. |
925 RELEASE_ASSERT_NOT_REACHED(); | 926 RELEASE_ASSERT_NOT_REACHED(); |
926 case PolicyAction::Ignore: | 927 case PolicyAction::Ignore: |
| 928 case PolicyAction::IgnoreAndLockBackForwardList: |
927 if (ResourceLoader* mainResourceLoader = this->mainResourceLoader()) | 929 if (ResourceLoader* mainResourceLoader = this->mainResourceLoader()) |
928 InspectorInstrumentation::continueWithPolicyIgnore(*m_frame, mainRes
ourceLoader->identifier(), *this, m_response); | 930 InspectorInstrumentation::continueWithPolicyIgnore(*m_frame, mainRes
ourceLoader->identifier(), *this, m_response); |
929 stopLoadingForPolicyChange(); | 931 stopLoadingForPolicyChange(); |
930 return; | 932 return; |
931 } | 933 } |
932 | 934 |
933 if (m_response.isHTTP()) { | 935 if (m_response.isHTTP()) { |
934 int status = m_response.httpStatusCode(); // Status may be zero when loa
ding substitute data, in particular from a WebArchive. | 936 int status = m_response.httpStatusCode(); // Status may be zero when loa
ding substitute data, in particular from a WebArchive. |
935 if (status && (status < 200 || status >= 300)) { | 937 if (status && (status < 200 || status >= 300)) { |
936 bool hostedByObject = frameLoader()->isHostedByObjectElement(); | 938 bool hostedByObject = frameLoader()->isHostedByObjectElement(); |
(...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2024 { | 2026 { |
2025 PingLoader::sendViolationReport(*m_frame, WTFMove(reportURL), WTFMove(report
), ViolationReportType::ContentSecurityPolicy); | 2027 PingLoader::sendViolationReport(*m_frame, WTFMove(reportURL), WTFMove(report
), ViolationReportType::ContentSecurityPolicy); |
2026 } | 2028 } |
2027 | 2029 |
2028 void DocumentLoader::dispatchSecurityPolicyViolationEvent(Ref<SecurityPolicyViol
ationEvent>&& violationEvent) | 2030 void DocumentLoader::dispatchSecurityPolicyViolationEvent(Ref<SecurityPolicyViol
ationEvent>&& violationEvent) |
2029 { | 2031 { |
2030 m_frame->document()->enqueueDocumentEvent(WTFMove(violationEvent)); | 2032 m_frame->document()->enqueueDocumentEvent(WTFMove(violationEvent)); |
2031 } | 2033 } |
2032 | 2034 |
2033 } // namespace WebCore | 2035 } // namespace WebCore |
LEFT | RIGHT |