| 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 | 8 |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 // Some canonical cookies cannot be converted into System cookies, for | 226 // Some canonical cookies cannot be converted into System cookies, for |
| 227 // example if value is not valid utf8. Such cookies are ignored. | 227 // example if value is not valid utf8. Such cookies are ignored. |
| 228 net::CanonicalCookie* bad_canonical_cookie = new net::CanonicalCookie( | 228 net::CanonicalCookie* bad_canonical_cookie = new net::CanonicalCookie( |
| 229 kTestCookieURL, "name", "\x81r\xe4\xbd\xa0\xe5\xa5\xbd", "domain", | 229 kTestCookieURL, "name", "\x81r\xe4\xbd\xa0\xe5\xa5\xbd", "domain", |
| 230 "path/", | 230 "path/", |
| 231 base::Time(), // creation | 231 base::Time(), // creation |
| 232 base::Time(), // expires | 232 base::Time(), // expires |
| 233 base::Time(), // last_access | 233 base::Time(), // last_access |
| 234 false, // secure | 234 false, // secure |
| 235 false, // httponly | 235 false, // httponly |
| 236 false, // first_party_only | 236 false, // same_site |
| 237 net::COOKIE_PRIORITY_DEFAULT); | 237 net::COOKIE_PRIORITY_DEFAULT); |
| 238 cookies.push_back(bad_canonical_cookie); | 238 cookies.push_back(bad_canonical_cookie); |
| 239 loaded_callback_.Run(cookies); | 239 loaded_callback_.Run(cookies); |
| 240 } | 240 } |
| 241 | 241 |
| 242 bool flushed() { return flushed_; } | 242 bool flushed() { return flushed_; } |
| 243 | 243 |
| 244 private: | 244 private: |
| 245 // net::CookieMonster::PersistentCookieStore implementation: | 245 // net::CookieMonster::PersistentCookieStore implementation: |
| 246 void Load(const LoadedCallback& loaded_callback) override { | 246 void Load(const LoadedCallback& loaded_callback) override { |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 EXPECT_EQ(2U, cookies.size()); | 959 EXPECT_EQ(2U, cookies.size()); |
| 960 // this deletes the callback | 960 // this deletes the callback |
| 961 handle.reset(); | 961 handle.reset(); |
| 962 SetSystemCookie(kTestCookieURL, "abc", "jkl"); | 962 SetSystemCookie(kTestCookieURL, "abc", "jkl"); |
| 963 EXPECT_EQ(2U, cookies.size()); | 963 EXPECT_EQ(2U, cookies.size()); |
| 964 DeleteSystemCookie(kTestCookieURL, "abc"); | 964 DeleteSystemCookie(kTestCookieURL, "abc"); |
| 965 store_->UnSynchronize(); | 965 store_->UnSynchronize(); |
| 966 } | 966 } |
| 967 | 967 |
| 968 } // namespace net | 968 } // namespace net |
| OLD | NEW |