| 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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 DCHECK(system_store); | 306 DCHECK(system_store); |
| 307 | 307 |
| 308 NotificationTrampoline::GetInstance()->AddObserver(this); | 308 NotificationTrampoline::GetInstance()->AddObserver(this); |
| 309 | 309 |
| 310 cookie_monster_->SetPersistSessionCookies(true); | 310 cookie_monster_->SetPersistSessionCookies(true); |
| 311 cookie_monster_->SetForceKeepSessionState(); | 311 cookie_monster_->SetForceKeepSessionState(); |
| 312 } | 312 } |
| 313 | 313 |
| 314 CookieStoreIOS::~CookieStoreIOS() { | 314 CookieStoreIOS::~CookieStoreIOS() { |
| 315 NotificationTrampoline::GetInstance()->RemoveObserver(this); | 315 NotificationTrampoline::GetInstance()->RemoveObserver(this); |
| 316 STLDeleteContainerPairSecondPointers(hook_map_.begin(), hook_map_.end()); | 316 base::STLDeleteContainerPairSecondPointers(hook_map_.begin(), |
| 317 hook_map_.end()); |
| 317 } | 318 } |
| 318 | 319 |
| 319 // static | 320 // static |
| 320 void CookieStoreIOS::SetCookiePolicy(CookiePolicy setting) { | 321 void CookieStoreIOS::SetCookiePolicy(CookiePolicy setting) { |
| 321 NSHTTPCookieAcceptPolicy policy = (setting == ALLOW) | 322 NSHTTPCookieAcceptPolicy policy = (setting == ALLOW) |
| 322 ? NSHTTPCookieAcceptPolicyAlways | 323 ? NSHTTPCookieAcceptPolicyAlways |
| 323 : NSHTTPCookieAcceptPolicyNever; | 324 : NSHTTPCookieAcceptPolicyNever; |
| 324 NSHTTPCookieStorage* store = [NSHTTPCookieStorage sharedHTTPCookieStorage]; | 325 NSHTTPCookieStorage* store = [NSHTTPCookieStorage sharedHTTPCookieStorage]; |
| 325 NSHTTPCookieAcceptPolicy current_policy = [store cookieAcceptPolicy]; | 326 NSHTTPCookieAcceptPolicy current_policy = [store cookieAcceptPolicy]; |
| 326 if (current_policy == policy) | 327 if (current_policy == policy) |
| (...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1155 weak_factory_.GetWeakPtr(), callback); | 1156 weak_factory_.GetWeakPtr(), callback); |
| 1156 } | 1157 } |
| 1157 | 1158 |
| 1158 base::Closure CookieStoreIOS::WrapClosure(const base::Closure& callback) { | 1159 base::Closure CookieStoreIOS::WrapClosure(const base::Closure& callback) { |
| 1159 DCHECK(thread_checker_.CalledOnValidThread()); | 1160 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1160 return base::Bind(&CookieStoreIOS::UpdateCachesAfterClosure, | 1161 return base::Bind(&CookieStoreIOS::UpdateCachesAfterClosure, |
| 1161 weak_factory_.GetWeakPtr(), callback); | 1162 weak_factory_.GetWeakPtr(), callback); |
| 1162 } | 1163 } |
| 1163 | 1164 |
| 1164 } // namespace net | 1165 } // namespace net |
| OLD | NEW |