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

Side by Side Diff: net/base/cookie_policy.cc

Issue 552265: r37624 abandoned code that isn't in the project any more. Deleting the unused... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | net/base/cookie_policy_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
(Empty)
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "net/base/cookie_policy.h"
6
7 #include "base/logging.h"
8 #include "googleurl/src/gurl.h"
9 #include "net/base/registry_controlled_domain.h"
10
11 namespace net {
12
13 bool CookiePolicy::CanGetCookies(const GURL& url,
14 const GURL& first_party_for_cookies) {
15 switch (type_) {
16 case CookiePolicy::ALLOW_ALL_COOKIES:
17 return true;
18 case CookiePolicy::BLOCK_THIRD_PARTY_COOKIES:
19 return true;
20 case CookiePolicy::BLOCK_ALL_COOKIES:
21 return false;
22 default:
23 NOTREACHED();
24 return false;
25 }
26 }
27
28 bool CookiePolicy::CanSetCookie(const GURL& url,
29 const GURL& first_party_for_cookies) {
30 switch (type_) {
31 case CookiePolicy::ALLOW_ALL_COOKIES:
32 return true;
33 case CookiePolicy::BLOCK_THIRD_PARTY_COOKIES:
34 if (first_party_for_cookies.is_empty())
35 return true; // Empty first-party URL indicates a first-party request.
36 return net::RegistryControlledDomainService::SameDomainOrHost(
37 url, first_party_for_cookies);
38 case CookiePolicy::BLOCK_ALL_COOKIES:
39 return false;
40 default:
41 NOTREACHED();
42 return false;
43 }
44 }
45
46 CookiePolicy::CookiePolicy() : type_(CookiePolicy::ALLOW_ALL_COOKIES) {
47 }
48
49 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/base/cookie_policy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698