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

Side by Side Diff: ios/net/cookies/system_cookie_util.mm

Issue 2874843002: Shifted creation of unvalidated CanonicalCookies over to a constructor. (Closed)
Patch Set: Merged to top of dependent CL. Created 3 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ios/net/cookies/system_cookie_util.h" 5 #include "ios/net/cookies/system_cookie_util.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 break; 63 break;
64 } 64 }
65 } 65 }
66 66
67 } // namespace 67 } // namespace
68 68
69 // Converts NSHTTPCookie to net::CanonicalCookie. 69 // Converts NSHTTPCookie to net::CanonicalCookie.
70 net::CanonicalCookie CanonicalCookieFromSystemCookie( 70 net::CanonicalCookie CanonicalCookieFromSystemCookie(
71 NSHTTPCookie* cookie, 71 NSHTTPCookie* cookie,
72 const base::Time& ceation_time) { 72 const base::Time& ceation_time) {
73 return *net::CanonicalCookie::Create( 73 return net::CanonicalCookie(
74 base::SysNSStringToUTF8([cookie name]), 74 base::SysNSStringToUTF8([cookie name]),
75 base::SysNSStringToUTF8([cookie value]), 75 base::SysNSStringToUTF8([cookie value]),
76 base::SysNSStringToUTF8([cookie domain]), 76 base::SysNSStringToUTF8([cookie domain]),
77 base::SysNSStringToUTF8([cookie path]), ceation_time, 77 base::SysNSStringToUTF8([cookie path]), ceation_time,
78 base::Time::FromDoubleT([[cookie expiresDate] timeIntervalSince1970]), 78 base::Time::FromDoubleT([[cookie expiresDate] timeIntervalSince1970]),
79 base::Time(), [cookie isSecure], [cookie isHTTPOnly], 79 base::Time(), [cookie isSecure], [cookie isHTTPOnly],
80 // TODO(mkwst): When iOS begins to support 'SameSite' and 'Priority' 80 // TODO(mkwst): When iOS begins to support 'SameSite' and 'Priority'
81 // attributes, pass them through here. 81 // attributes, pass them through here.
82 net::CookieSameSite::DEFAULT_MODE, net::COOKIE_PRIORITY_DEFAULT); 82 net::CookieSameSite::DEFAULT_MODE, net::COOKIE_PRIORITY_DEFAULT);
83 } 83 }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 ResetCookieCountMetrics(); 151 ResetCookieCountMetrics();
152 } 152 }
153 153
154 void ResetCookieCountMetrics() { 154 void ResetCookieCountMetrics() {
155 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; 155 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
156 [defaults setBool:NO forKey:kCheckCookieLossKey]; 156 [defaults setBool:NO forKey:kCheckCookieLossKey];
157 [defaults synchronize]; 157 [defaults synchronize];
158 } 158 }
159 159
160 } // namespace net 160 } // namespace net
OLDNEW
« no previous file with comments | « ios/net/cookies/cookie_store_ios_test_util.mm ('k') | ios/net/cookies/system_cookie_util_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698