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