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 <cstdint> | |
mmenke
2017/07/05 16:58:49
nit: This is included in the header, so not neede
Randy Smith (Not in Mondays)
2017/07/08 13:03:26
Done.
| |
11 | |
10 #include "base/bind.h" | 12 #include "base/bind.h" |
11 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
12 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
13 #include "base/ios/ios_util.h" | 15 #include "base/ios/ios_util.h" |
14 #include "base/location.h" | 16 #include "base/location.h" |
15 #include "base/logging.h" | 17 #include "base/logging.h" |
16 #include "base/mac/foundation_util.h" | 18 #include "base/mac/foundation_util.h" |
17 #include "base/mac/scoped_nsobject.h" | 19 #include "base/mac/scoped_nsobject.h" |
18 #include "base/macros.h" | 20 #include "base/macros.h" |
19 #include "base/memory/ptr_util.h" | 21 #include "base/memory/ptr_util.h" |
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
854 void CookieStoreIOS::UpdateCachesAfterSet(SetCookiesCallback callback, | 856 void CookieStoreIOS::UpdateCachesAfterSet(SetCookiesCallback callback, |
855 bool success) { | 857 bool success) { |
856 DCHECK(thread_checker_.CalledOnValidThread()); | 858 DCHECK(thread_checker_.CalledOnValidThread()); |
857 if (success) | 859 if (success) |
858 UpdateCachesFromCookieMonster(); | 860 UpdateCachesFromCookieMonster(); |
859 if (!callback.is_null()) | 861 if (!callback.is_null()) |
860 std::move(callback).Run(success); | 862 std::move(callback).Run(success); |
861 } | 863 } |
862 | 864 |
863 void CookieStoreIOS::UpdateCachesAfterDelete(DeleteCallback callback, | 865 void CookieStoreIOS::UpdateCachesAfterDelete(DeleteCallback callback, |
864 int num_deleted) { | 866 uint32_t num_deleted) { |
865 DCHECK(thread_checker_.CalledOnValidThread()); | 867 DCHECK(thread_checker_.CalledOnValidThread()); |
866 UpdateCachesFromCookieMonster(); | 868 UpdateCachesFromCookieMonster(); |
867 if (!callback.is_null()) | 869 if (!callback.is_null()) |
868 std::move(callback).Run(num_deleted); | 870 std::move(callback).Run(num_deleted); |
869 } | 871 } |
870 | 872 |
871 void CookieStoreIOS::UpdateCachesAfterClosure(base::OnceClosure callback) { | 873 void CookieStoreIOS::UpdateCachesAfterClosure(base::OnceClosure callback) { |
872 DCHECK(thread_checker_.CalledOnValidThread()); | 874 DCHECK(thread_checker_.CalledOnValidThread()); |
873 UpdateCachesFromCookieMonster(); | 875 UpdateCachesFromCookieMonster(); |
874 if (!callback.is_null()) | 876 if (!callback.is_null()) |
875 std::move(callback).Run(); | 877 std::move(callback).Run(); |
876 } | 878 } |
877 | 879 |
878 net::CookieList | 880 net::CookieList |
879 CookieStoreIOS::CanonicalCookieListFromSystemCookies(NSArray* cookies) { | 881 CookieStoreIOS::CanonicalCookieListFromSystemCookies(NSArray* cookies) { |
880 net::CookieList cookie_list; | 882 net::CookieList cookie_list; |
881 cookie_list.reserve([cookies count]); | 883 cookie_list.reserve([cookies count]); |
882 for (NSHTTPCookie* cookie in cookies) { | 884 for (NSHTTPCookie* cookie in cookies) { |
883 base::Time created = creation_time_manager_->GetCreationTime(cookie); | 885 base::Time created = creation_time_manager_->GetCreationTime(cookie); |
884 cookie_list.push_back(CanonicalCookieFromSystemCookie(cookie, created)); | 886 cookie_list.push_back(CanonicalCookieFromSystemCookie(cookie, created)); |
885 } | 887 } |
886 return cookie_list; | 888 return cookie_list; |
887 } | 889 } |
888 | 890 |
889 } // namespace net | 891 } // namespace net |
OLD | NEW |