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