Chromium Code Reviews| OLD | NEW | 
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 
 
nasko
2016/01/20 23:15:07
2016 :)
 
Mike West
2016/01/21 14:51:24
It was 2015 when I started. :)
 
 | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_SECURITY_XFO_THROTTLE_H_ | |
| 6 #define CHROME_BROWSER_SECURITY_XFO_THROTTLE_H_ | |
| 7 | |
| 8 #include "base/memory/scoped_ptr.h" | |
| 9 #include "content/public/browser/navigation_throttle.h" | |
| 10 | |
| 11 namespace content { | |
| 12 class NavigationHandle; | |
| 13 } | |
| 14 | |
| 15 namespace net { | |
| 16 class HttpResponseHeaders; | |
| 17 } | |
| 18 | |
| 19 namespace content { | |
| 20 | |
| 21 class CONTENT_EXPORT XFOThrottle : public NavigationThrottle { | |
| 
 
nasko
2016/01/20 23:15:07
XfoThrottle, as per semi-recent chromium-dev@ disc
 
Mike West
2016/01/21 14:51:24
...
Style rules never get better, do they? They j
 
 | |
| 22 public: | |
| 23 enum HeaderDisposition { | |
| 24 NOT_PRESENT, | |
| 25 DENY, | |
| 26 SAMEORIGIN, | |
| 
 
nasko
2016/01/20 23:15:07
Why use _ in NOT_PRESENT, but not in SAME_ORITIN a
 
Mike West
2016/01/21 14:51:24
Changed to `NONE` to avoid the question.
 
 | |
| 27 ALLOWALL, | |
| 28 INVALID, | |
| 29 CONFLICT | |
| 30 }; | |
| 31 | |
| 32 explicit XFOThrottle(NavigationHandle* handle); | |
| 33 ~XFOThrottle() override; | |
| 34 | |
| 35 NavigationThrottle::ThrottleCheckResult WillProcessResponse() override; | |
| 36 static scoped_ptr<NavigationThrottle> MaybeCreateThrottleFor( | |
| 
 
nasko
2016/01/20 23:15:07
Static methods go first in the class, especially c
 
Mike West
2016/01/21 14:51:24
Done.
 
 | |
| 37 NavigationHandle* handle); | |
| 38 | |
| 39 // Parses an 'X-Frame-Options' header. If the result is either CONFLICT | |
| 40 // or INVALID, |failed_parse| will be populated with the value which caused | |
| 41 // the parse error. | |
| 42 static HeaderDisposition ParseHeader(const net::HttpResponseHeaders* headers, | |
| 43 std::string* failed_parse); | |
| 44 | |
| 45 private: | |
| 46 void ParseError(const std::string& value, HeaderDisposition disposition); | |
| 47 void ConsoleError(HeaderDisposition disposition); | |
| 48 | |
| 49 DISALLOW_COPY_AND_ASSIGN(XFOThrottle); | |
| 50 }; | |
| 51 | |
| 52 } // namespace content | |
| 53 | |
| 54 #endif // CHROME_BROWSER_SECURITY_XFO_THROTTLE_H_ | |
| OLD | NEW |