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