OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_ANCESTOR_THROTTLE_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_ANCESTOR_THROTTLE_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_ANCESTOR_THROTTLE_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_ANCESTOR_THROTTLE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 INVALID, | 31 INVALID, |
32 CONFLICT, | 32 CONFLICT, |
33 BYPASS | 33 BYPASS |
34 }; | 34 }; |
35 | 35 |
36 static std::unique_ptr<NavigationThrottle> MaybeCreateThrottleFor( | 36 static std::unique_ptr<NavigationThrottle> MaybeCreateThrottleFor( |
37 NavigationHandle* handle); | 37 NavigationHandle* handle); |
38 | 38 |
39 ~AncestorThrottle() override; | 39 ~AncestorThrottle() override; |
40 | 40 |
41 NavigationThrottle::ThrottleCheckResult WillStartRequest() override; | |
42 NavigationThrottle::ThrottleCheckResult WillRedirectRequest() override; | |
43 NavigationThrottle::ThrottleCheckResult WillProcessResponse() override; | 41 NavigationThrottle::ThrottleCheckResult WillProcessResponse() override; |
44 | 42 |
45 private: | 43 private: |
46 FRIEND_TEST_ALL_PREFIXES(AncestorThrottleTest, ParsingXFrameOptions); | 44 FRIEND_TEST_ALL_PREFIXES(AncestorThrottleTest, ParsingXFrameOptions); |
47 FRIEND_TEST_ALL_PREFIXES(AncestorThrottleTest, ErrorsParsingXFrameOptions); | 45 FRIEND_TEST_ALL_PREFIXES(AncestorThrottleTest, ErrorsParsingXFrameOptions); |
48 FRIEND_TEST_ALL_PREFIXES(AncestorThrottleTest, | 46 FRIEND_TEST_ALL_PREFIXES(AncestorThrottleTest, |
49 IgnoreWhenFrameAncestorsPresent); | 47 IgnoreWhenFrameAncestorsPresent); |
50 | 48 |
51 explicit AncestorThrottle(NavigationHandle* handle); | 49 explicit AncestorThrottle(NavigationHandle* handle); |
52 void ParseError(const std::string& value, HeaderDisposition disposition); | 50 void ParseError(const std::string& value, HeaderDisposition disposition); |
53 void ConsoleError(HeaderDisposition disposition); | 51 void ConsoleError(HeaderDisposition disposition); |
54 | 52 |
55 // Parses an 'X-Frame-Options' header. If the result is either CONFLICT | 53 // Parses an 'X-Frame-Options' header. If the result is either CONFLICT |
56 // or INVALID, |header_value| will be populated with the value which caused | 54 // or INVALID, |header_value| will be populated with the value which caused |
57 // the parse error. | 55 // the parse error. |
58 HeaderDisposition ParseHeader(const net::HttpResponseHeaders* headers, | 56 HeaderDisposition ParseHeader(const net::HttpResponseHeaders* headers, |
59 std::string* header_value); | 57 std::string* header_value); |
60 | 58 |
61 NavigationThrottle::ThrottleCheckResult CheckContentSecurityPolicyFrameSrc( | |
62 bool is_redirect); | |
63 | |
64 DISALLOW_COPY_AND_ASSIGN(AncestorThrottle); | 59 DISALLOW_COPY_AND_ASSIGN(AncestorThrottle); |
65 }; | 60 }; |
66 | 61 |
67 } // namespace content | 62 } // namespace content |
68 | 63 |
69 #endif // CONTENT_BROWSER_FRAME_HOST_ANCESTOR_THROTTLE_H_ | 64 #endif // CONTENT_BROWSER_FRAME_HOST_ANCESTOR_THROTTLE_H_ |
OLD | NEW |