Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ios/net/cookies/cookie_store_ios.h" | 5 #include "ios/net/cookies/cookie_store_ios.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/bind.h" | 10 #include "base/bind.h" |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 584 base::scoped_nsobject<NSArray> copy( | 584 base::scoped_nsobject<NSArray> copy( |
| 585 [[NSArray alloc] initWithArray:[system_store_ cookies]]); | 585 [[NSArray alloc] initWithArray:[system_store_ cookies]]); |
| 586 for (NSHTTPCookie* cookie in copy.get()) | 586 for (NSHTTPCookie* cookie in copy.get()) |
| 587 [system_store_ deleteCookie:cookie]; | 587 [system_store_ deleteCookie:cookie]; |
| 588 DCHECK_EQ(0u, [[system_store_ cookies] count]); | 588 DCHECK_EQ(0u, [[system_store_ cookies] count]); |
| 589 creation_time_manager_->Clear(); | 589 creation_time_manager_->Clear(); |
| 590 } | 590 } |
| 591 | 591 |
| 592 bool CookieStoreIOS::SystemCookiesAllowed() { | 592 bool CookieStoreIOS::SystemCookiesAllowed() { |
| 593 DCHECK(thread_checker_.CalledOnValidThread()); | 593 DCHECK(thread_checker_.CalledOnValidThread()); |
| 594 return [system_store_ cookieAcceptPolicy] == | 594 return [system_store_ cookieAcceptPolicy] != NSHTTPCookieAcceptPolicyNever; |
|
Eugene But (OOO till 7-30)
2017/02/10 00:17:01
This will return YES if 3rd party cookies are bloc
lilyhoughton
2017/02/10 16:41:18
What is the specific issue that this change fixes?
mef
2017/02/10 17:04:59
Done.
mef
2017/02/10 17:04:59
It broke Cronet cookie tests.
I've entered crbug.
| |
| 595 NSHTTPCookieAcceptPolicyAlways; | |
| 596 } | 595 } |
| 597 | 596 |
| 598 void CookieStoreIOS::WriteToCookieMonster(NSArray* system_cookies) { | 597 void CookieStoreIOS::WriteToCookieMonster(NSArray* system_cookies) { |
| 599 DCHECK(thread_checker_.CalledOnValidThread()); | 598 DCHECK(thread_checker_.CalledOnValidThread()); |
| 600 // Copy the cookies from the global cookie store to |cookie_monster_|. | 599 // Copy the cookies from the global cookie store to |cookie_monster_|. |
| 601 // Unlike the system store, CookieMonster requires unique creation times. | 600 // Unlike the system store, CookieMonster requires unique creation times. |
| 602 net::CookieList cookie_list; | 601 net::CookieList cookie_list; |
| 603 NSUInteger cookie_count = [system_cookies count]; | 602 NSUInteger cookie_count = [system_cookies count]; |
| 604 cookie_list.reserve(cookie_count); | 603 cookie_list.reserve(cookie_count); |
| 605 for (NSHTTPCookie* cookie in system_cookies) { | 604 for (NSHTTPCookie* cookie in system_cookies) { |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 817 net::CookieList cookie_list; | 816 net::CookieList cookie_list; |
| 818 cookie_list.reserve([cookies count]); | 817 cookie_list.reserve([cookies count]); |
| 819 for (NSHTTPCookie* cookie in cookies) { | 818 for (NSHTTPCookie* cookie in cookies) { |
| 820 base::Time created = creation_time_manager_->GetCreationTime(cookie); | 819 base::Time created = creation_time_manager_->GetCreationTime(cookie); |
| 821 cookie_list.push_back(CanonicalCookieFromSystemCookie(cookie, created)); | 820 cookie_list.push_back(CanonicalCookieFromSystemCookie(cookie, created)); |
| 822 } | 821 } |
| 823 return cookie_list; | 822 return cookie_list; |
| 824 } | 823 } |
| 825 | 824 |
| 826 } // namespace net | 825 } // namespace net |
| OLD | NEW |