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

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

Issue 2159373002: net: make CanonicalCookie's constructor private (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 break; 59 break;
60 } 60 }
61 } 61 }
62 62
63 } // namespace 63 } // namespace
64 64
65 // Converts NSHTTPCookie to net::CanonicalCookie. 65 // Converts NSHTTPCookie to net::CanonicalCookie.
66 net::CanonicalCookie CanonicalCookieFromSystemCookie( 66 net::CanonicalCookie CanonicalCookieFromSystemCookie(
67 NSHTTPCookie* cookie, 67 NSHTTPCookie* cookie,
68 const base::Time& ceation_time) { 68 const base::Time& ceation_time) {
69 return net::CanonicalCookie( 69 return *net::CanonicalCookie::Create(
70 GURL(), base::SysNSStringToUTF8([cookie name]), 70 GURL("http://example.com"), base::SysNSStringToUTF8([cookie name]),
mmenke 2016/07/20 20:50:11 I think this one is the issue. Switch it to using
tfarina 2016/07/20 21:58:47 Done.
71 base::SysNSStringToUTF8([cookie value]), 71 base::SysNSStringToUTF8([cookie value]),
72 base::SysNSStringToUTF8([cookie domain]), 72 base::SysNSStringToUTF8([cookie domain]),
73 base::SysNSStringToUTF8([cookie path]), ceation_time, 73 base::SysNSStringToUTF8([cookie path]), ceation_time,
74 base::Time::FromDoubleT([[cookie expiresDate] timeIntervalSince1970]), 74 base::Time::FromDoubleT([[cookie expiresDate] timeIntervalSince1970]),
75 base::Time(), [cookie isSecure], [cookie isHTTPOnly], 75 [cookie isSecure], [cookie isHTTPOnly],
76 // TODO(mkwst): When iOS begins to support 'SameSite' and 'Priority' 76 // TODO(mkwst): When iOS begins to support 'SameSite' and 'Priority'
77 // attributes, pass them through here. 77 // attributes, pass them through here.
78 net::CookieSameSite::DEFAULT_MODE, net::COOKIE_PRIORITY_DEFAULT); 78 net::CookieSameSite::DEFAULT_MODE, false, net::COOKIE_PRIORITY_DEFAULT);
79 } 79 }
80 80
81 // Converts net::CanonicalCookie to NSHTTPCookie. 81 // Converts net::CanonicalCookie to NSHTTPCookie.
82 NSHTTPCookie* SystemCookieFromCanonicalCookie( 82 NSHTTPCookie* SystemCookieFromCanonicalCookie(
83 const net::CanonicalCookie& cookie) { 83 const net::CanonicalCookie& cookie) {
84 NSString* cookie_domain = base::SysUTF8ToNSString(cookie.Domain()); 84 NSString* cookie_domain = base::SysUTF8ToNSString(cookie.Domain());
85 NSString* cookie_name = base::SysUTF8ToNSString(cookie.Name()); 85 NSString* cookie_name = base::SysUTF8ToNSString(cookie.Name());
86 NSString* cookie_path = base::SysUTF8ToNSString(cookie.Path()); 86 NSString* cookie_path = base::SysUTF8ToNSString(cookie.Path());
87 NSString* cookie_value = base::SysUTF8ToNSString(cookie.Value()); 87 NSString* cookie_value = base::SysUTF8ToNSString(cookie.Value());
88 if (!cookie_domain || !cookie_name || !cookie_path || !cookie_value) { 88 if (!cookie_domain || !cookie_name || !cookie_path || !cookie_value) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 ResetCookieCountMetrics(); 147 ResetCookieCountMetrics();
148 } 148 }
149 149
150 void ResetCookieCountMetrics() { 150 void ResetCookieCountMetrics() {
151 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; 151 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
152 [defaults setBool:NO forKey:kCheckCookieLossKey]; 152 [defaults setBool:NO forKey:kCheckCookieLossKey];
153 [defaults synchronize]; 153 [defaults synchronize];
154 } 154 }
155 155
156 } // namespace net 156 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698