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 const char* GetNameForLogging() override; | 42 const char* GetNameForLogging() override; |
45 | 43 |
46 private: | 44 private: |
47 FRIEND_TEST_ALL_PREFIXES(AncestorThrottleTest, ParsingXFrameOptions); | 45 FRIEND_TEST_ALL_PREFIXES(AncestorThrottleTest, ParsingXFrameOptions); |
48 FRIEND_TEST_ALL_PREFIXES(AncestorThrottleTest, ErrorsParsingXFrameOptions); | 46 FRIEND_TEST_ALL_PREFIXES(AncestorThrottleTest, ErrorsParsingXFrameOptions); |
49 FRIEND_TEST_ALL_PREFIXES(AncestorThrottleTest, | 47 FRIEND_TEST_ALL_PREFIXES(AncestorThrottleTest, |
50 IgnoreWhenFrameAncestorsPresent); | 48 IgnoreWhenFrameAncestorsPresent); |
51 | 49 |
52 explicit AncestorThrottle(NavigationHandle* handle); | 50 explicit AncestorThrottle(NavigationHandle* handle); |
53 void ParseError(const std::string& value, HeaderDisposition disposition); | 51 void ParseError(const std::string& value, HeaderDisposition disposition); |
54 void ConsoleError(HeaderDisposition disposition); | 52 void ConsoleError(HeaderDisposition disposition); |
55 | 53 |
56 // Parses an 'X-Frame-Options' header. If the result is either CONFLICT | 54 // Parses an 'X-Frame-Options' header. If the result is either CONFLICT |
57 // or INVALID, |header_value| will be populated with the value which caused | 55 // or INVALID, |header_value| will be populated with the value which caused |
58 // the parse error. | 56 // the parse error. |
59 HeaderDisposition ParseHeader(const net::HttpResponseHeaders* headers, | 57 HeaderDisposition ParseHeader(const net::HttpResponseHeaders* headers, |
60 std::string* header_value); | 58 std::string* header_value); |
61 | 59 |
62 NavigationThrottle::ThrottleCheckResult CheckContentSecurityPolicyFrameSrc( | |
63 bool is_redirect); | |
64 | |
65 DISALLOW_COPY_AND_ASSIGN(AncestorThrottle); | 60 DISALLOW_COPY_AND_ASSIGN(AncestorThrottle); |
66 }; | 61 }; |
67 | 62 |
68 } // namespace content | 63 } // namespace content |
69 | 64 |
70 #endif // CONTENT_BROWSER_FRAME_HOST_ANCESTOR_THROTTLE_H_ | 65 #endif // CONTENT_BROWSER_FRAME_HOST_ANCESTOR_THROTTLE_H_ |
OLD | NEW |