Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(618)

Side by Side Diff: content/browser/frame_host/ancestor_throttle.h

Issue 2909513002: Move PlzNavigate frame-src CSP check to NavigationRequest (Closed)
Patch Set: rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/ancestor_throttle.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/ancestor_throttle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698