| 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 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 void CookieStoreIOS::UpdateCachesAfterSet(SetCookiesCallback callback, | 854 void CookieStoreIOS::UpdateCachesAfterSet(SetCookiesCallback callback, |
| 855 bool success) { | 855 bool success) { |
| 856 DCHECK(thread_checker_.CalledOnValidThread()); | 856 DCHECK(thread_checker_.CalledOnValidThread()); |
| 857 if (success) | 857 if (success) |
| 858 UpdateCachesFromCookieMonster(); | 858 UpdateCachesFromCookieMonster(); |
| 859 if (!callback.is_null()) | 859 if (!callback.is_null()) |
| 860 std::move(callback).Run(success); | 860 std::move(callback).Run(success); |
| 861 } | 861 } |
| 862 | 862 |
| 863 void CookieStoreIOS::UpdateCachesAfterDelete(DeleteCallback callback, | 863 void CookieStoreIOS::UpdateCachesAfterDelete(DeleteCallback callback, |
| 864 int num_deleted) { | 864 uint32_t num_deleted) { |
| 865 DCHECK(thread_checker_.CalledOnValidThread()); | 865 DCHECK(thread_checker_.CalledOnValidThread()); |
| 866 UpdateCachesFromCookieMonster(); | 866 UpdateCachesFromCookieMonster(); |
| 867 if (!callback.is_null()) | 867 if (!callback.is_null()) |
| 868 std::move(callback).Run(num_deleted); | 868 std::move(callback).Run(num_deleted); |
| 869 } | 869 } |
| 870 | 870 |
| 871 void CookieStoreIOS::UpdateCachesAfterClosure(base::OnceClosure callback) { | 871 void CookieStoreIOS::UpdateCachesAfterClosure(base::OnceClosure callback) { |
| 872 DCHECK(thread_checker_.CalledOnValidThread()); | 872 DCHECK(thread_checker_.CalledOnValidThread()); |
| 873 UpdateCachesFromCookieMonster(); | 873 UpdateCachesFromCookieMonster(); |
| 874 if (!callback.is_null()) | 874 if (!callback.is_null()) |
| 875 std::move(callback).Run(); | 875 std::move(callback).Run(); |
| 876 } | 876 } |
| 877 | 877 |
| 878 net::CookieList | 878 net::CookieList |
| 879 CookieStoreIOS::CanonicalCookieListFromSystemCookies(NSArray* cookies) { | 879 CookieStoreIOS::CanonicalCookieListFromSystemCookies(NSArray* cookies) { |
| 880 net::CookieList cookie_list; | 880 net::CookieList cookie_list; |
| 881 cookie_list.reserve([cookies count]); | 881 cookie_list.reserve([cookies count]); |
| 882 for (NSHTTPCookie* cookie in cookies) { | 882 for (NSHTTPCookie* cookie in cookies) { |
| 883 base::Time created = creation_time_manager_->GetCreationTime(cookie); | 883 base::Time created = creation_time_manager_->GetCreationTime(cookie); |
| 884 cookie_list.push_back(CanonicalCookieFromSystemCookie(cookie, created)); | 884 cookie_list.push_back(CanonicalCookieFromSystemCookie(cookie, created)); |
| 885 } | 885 } |
| 886 return cookie_list; | 886 return cookie_list; |
| 887 } | 887 } |
| 888 | 888 |
| 889 } // namespace net | 889 } // namespace net |
| OLD | NEW |