OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_FRAME_HOST_FORM_SUBMISSION_THROTTLE_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_FORM_SUBMISSION_THROTTLE_H_ |
| 7 |
| 8 #include <memory> |
| 9 #include <string> |
| 10 |
| 11 #include "base/macros.h" |
| 12 #include "content/public/browser/navigation_throttle.h" |
| 13 |
| 14 namespace content { |
| 15 class NavigationHandle; |
| 16 |
| 17 // A FormSubmissionThrottle is responsible for enforcing the 'form-action' CSP |
| 18 // directive, blocking requests which violate them. |
| 19 // It is enforcing it only if PlzNavigate is enabled. Blink is still enforcing |
| 20 // the 'form-action' directive on the renderer process. |
| 21 class CONTENT_EXPORT FormSubmissionThrottle : public NavigationThrottle { |
| 22 public: |
| 23 static std::unique_ptr<NavigationThrottle> MaybeCreateThrottleFor( |
| 24 NavigationHandle* handle); |
| 25 |
| 26 ~FormSubmissionThrottle() override; |
| 27 |
| 28 NavigationThrottle::ThrottleCheckResult WillStartRequest() override; |
| 29 NavigationThrottle::ThrottleCheckResult WillRedirectRequest() override; |
| 30 |
| 31 private: |
| 32 explicit FormSubmissionThrottle(NavigationHandle* handle); |
| 33 NavigationThrottle::ThrottleCheckResult CheckContentSecurityPolicyFormAction( |
| 34 bool is_redirect); |
| 35 |
| 36 DISALLOW_COPY_AND_ASSIGN(FormSubmissionThrottle); |
| 37 }; |
| 38 |
| 39 } // namespace content |
| 40 |
| 41 #endif // CONTENT_BROWSER_FRAME_HOST_FORM_SUBMISSION_THROTTLE_H_ |
OLD | NEW |