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

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

Issue 42013: Slight code change to make some global variables const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 9 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 | « net/base/completion_callback.h ('k') | net/base/data_url_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) 2006-2008 The Chromium Authors. All rights reserved. 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 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 "net/base/cookie_policy.h" 5 #include "net/base/cookie_policy.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "googleurl/src/gurl.h" 8 #include "googleurl/src/gurl.h"
9 #include "net/base/registry_controlled_domain.h" 9 #include "net/base/registry_controlled_domain.h"
10 10
(...skipping 13 matching lines...) Expand all
24 } 24 }
25 } 25 }
26 26
27 bool CookiePolicy::CanSetCookie(const GURL& url, const GURL& policy_url) { 27 bool CookiePolicy::CanSetCookie(const GURL& url, const GURL& policy_url) {
28 switch (type_) { 28 switch (type_) {
29 case CookiePolicy::ALLOW_ALL_COOKIES: 29 case CookiePolicy::ALLOW_ALL_COOKIES:
30 return true; 30 return true;
31 case CookiePolicy::BLOCK_THIRD_PARTY_COOKIES: 31 case CookiePolicy::BLOCK_THIRD_PARTY_COOKIES:
32 if (policy_url.is_empty()) 32 if (policy_url.is_empty())
33 return true; // Empty policy URL should indicate a first-party request 33 return true; // Empty policy URL should indicate a first-party request
34 34 return net::RegistryControlledDomainService::SameDomainOrHost(url,
35 return net::RegistryControlledDomainService::SameDomainOrHost(url, policy_ url); 35 policy_url);
36 case CookiePolicy::BLOCK_ALL_COOKIES: 36 case CookiePolicy::BLOCK_ALL_COOKIES:
37 return false; 37 return false;
38 default: 38 default:
39 NOTREACHED(); 39 NOTREACHED();
40 return false; 40 return false;
41 } 41 }
42 } 42 }
43 43
44 CookiePolicy::CookiePolicy() : type_(CookiePolicy::ALLOW_ALL_COOKIES) { 44 CookiePolicy::CookiePolicy() : type_(CookiePolicy::ALLOW_ALL_COOKIES) {
45 } 45 }
46 46
47 } // namespace net 47 } // namespace net
48 48
OLDNEW
« no previous file with comments | « net/base/completion_callback.h ('k') | net/base/data_url_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698