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

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

Issue 2684933009: [Cronet] Fix compilation and test errors for CookieStoreIOS. (Closed)
Patch Set: CookieStoreIOS::SystemCookiesAllowed should be true unless policy is 'Never'. Created 3 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
« no previous file with comments | « ios/crnet/crnet_environment.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ios/crnet/crnet_environment.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698