OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 NET_BASE_STATIC_COOKIE_POLICY_H_ | 5 #ifndef NET_BASE_STATIC_COOKIE_POLICY_H_ |
6 #define NET_BASE_STATIC_COOKIE_POLICY_H_ | 6 #define NET_BASE_STATIC_COOKIE_POLICY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | |
10 | |
11 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
12 #include "net/base/net_api.h" | 10 #include "net/base/net_api.h" |
13 | 11 |
14 class GURL; | 12 class GURL; |
15 | 13 |
16 namespace net { | 14 namespace net { |
17 | 15 |
18 // The StaticCookiePolicy class implements a static cookie policy that supports | 16 // The StaticCookiePolicy class implements a static cookie policy that supports |
19 // three modes: allow all, deny all, or block third-party cookies. | 17 // three modes: allow all, deny all, or block third-party cookies. |
20 class NET_API StaticCookiePolicy { | 18 class NET_API StaticCookiePolicy { |
(...skipping 24 matching lines...) Expand all Loading... |
45 void set_type(Type type) { type_ = type; } | 43 void set_type(Type type) { type_ = type; } |
46 Type type() const { return type_; } | 44 Type type() const { return type_; } |
47 | 45 |
48 // Consults the user's third-party cookie blocking preferences to determine | 46 // Consults the user's third-party cookie blocking preferences to determine |
49 // whether the URL's cookies can be read. | 47 // whether the URL's cookies can be read. |
50 int CanGetCookies(const GURL& url, const GURL& first_party_for_cookies) const; | 48 int CanGetCookies(const GURL& url, const GURL& first_party_for_cookies) const; |
51 | 49 |
52 // Consults the user's third-party cookie blocking preferences to determine | 50 // Consults the user's third-party cookie blocking preferences to determine |
53 // whether the URL's cookies can be set. | 51 // whether the URL's cookies can be set. |
54 int CanSetCookie(const GURL& url, | 52 int CanSetCookie(const GURL& url, |
55 const GURL& first_party_for_cookies, | 53 const GURL& first_party_for_cookies) const; |
56 const std::string& cookie_line) const; | |
57 | 54 |
58 private: | 55 private: |
59 Type type_; | 56 Type type_; |
60 | 57 |
61 DISALLOW_COPY_AND_ASSIGN(StaticCookiePolicy); | 58 DISALLOW_COPY_AND_ASSIGN(StaticCookiePolicy); |
62 }; | 59 }; |
63 | 60 |
64 } // namespace net | 61 } // namespace net |
65 | 62 |
66 #endif // NET_BASE_STATIC_COOKIE_POLICY_H_ | 63 #endif // NET_BASE_STATIC_COOKIE_POLICY_H_ |
OLD | NEW |