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

Side by Side Diff: android_webview/browser/aw_cookie_access_policy.cc

Issue 2655443003: Unify the "get" and "set" cookie access settings. (Closed)
Patch Set: rebase Created 3 years, 10 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 | chrome/browser/browsing_data/cookies_tree_model_unittest.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "android_webview/browser/aw_cookie_access_policy.h" 5 #include "android_webview/browser/aw_cookie_access_policy.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "android_webview/browser/aw_contents_io_thread_client.h" 9 #include "android_webview/browser/aw_contents_io_thread_client.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 return StaticCookiePolicy::BLOCK_ALL_COOKIES; 135 return StaticCookiePolicy::BLOCK_ALL_COOKIES;
136 } 136 }
137 if (accept_third_party_cookies() || isFile) { 137 if (accept_third_party_cookies() || isFile) {
138 return StaticCookiePolicy::ALLOW_ALL_COOKIES; 138 return StaticCookiePolicy::ALLOW_ALL_COOKIES;
139 } 139 }
140 return StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES; 140 return StaticCookiePolicy::BLOCK_ALL_THIRD_PARTY_COOKIES;
141 } 141 }
142 142
143 bool AwStaticCookiePolicy::AllowSet(const GURL& url, 143 bool AwStaticCookiePolicy::AllowSet(const GURL& url,
144 const GURL& first_party) const { 144 const GURL& first_party) const {
145 145 return StaticCookiePolicy(GetPolicy(url))
146 return StaticCookiePolicy(GetPolicy(url)).CanSetCookie(url, first_party) == 146 .CanAccessCookies(url, first_party) == net::OK;
147 net::OK;
148 } 147 }
149 148
150 bool AwStaticCookiePolicy::AllowGet(const GURL& url, 149 bool AwStaticCookiePolicy::AllowGet(const GURL& url,
151 const GURL& first_party) const { 150 const GURL& first_party) const {
152 return StaticCookiePolicy(GetPolicy(url)).CanGetCookies(url, first_party) == 151 return StaticCookiePolicy(GetPolicy(url))
153 net::OK; 152 .CanAccessCookies(url, first_party) == net::OK;
154 } 153 }
155 154
156 } // namespace android_webview 155 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browsing_data/cookies_tree_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698