OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "net/cookies/cookie_store.h" | 5 #include "net/cookies/cookie_store.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "net/cookies/cookie_options.h" | 9 #include "net/cookies/cookie_options.h" |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 // In Mozilla, if you set a cookie like "AAA", it will have an empty token | 41 // In Mozilla, if you set a cookie like "AAA", it will have an empty token |
42 // and a value of "AAA". When it sends the cookie back, it will send "AAA", | 42 // and a value of "AAA". When it sends the cookie back, it will send "AAA", |
43 // so we need to avoid sending "=AAA" for a blank token value. | 43 // so we need to avoid sending "=AAA" for a blank token value. |
44 if (!cookie->Name().empty()) | 44 if (!cookie->Name().empty()) |
45 cookie_line += cookie->Name() + "="; | 45 cookie_line += cookie->Name() + "="; |
46 cookie_line += cookie->Value(); | 46 cookie_line += cookie->Value(); |
47 } | 47 } |
48 return cookie_line; | 48 return cookie_line; |
49 } | 49 } |
50 | 50 |
51 void CookieStore::DeleteAllAsync(const DeleteCallback& callback) { | 51 void CookieStore::DeleteAllAsync(DeleteCallback callback) { |
52 DeleteAllCreatedBetweenAsync(base::Time(), base::Time::Max(), callback); | 52 DeleteAllCreatedBetweenAsync(base::Time(), base::Time::Max(), |
| 53 std::move(callback)); |
53 } | 54 } |
54 | 55 |
55 void CookieStore::SetForceKeepSessionState() { | 56 void CookieStore::SetForceKeepSessionState() { |
56 // By default, do nothing. | 57 // By default, do nothing. |
57 } | 58 } |
58 | 59 |
59 void CookieStore::GetAllCookiesForURLAsync( | 60 void CookieStore::GetAllCookiesForURLAsync(const GURL& url, |
60 const GURL& url, | 61 GetCookieListCallback callback) { |
61 const GetCookieListCallback& callback) { | |
62 CookieOptions options; | 62 CookieOptions options; |
63 options.set_include_httponly(); | 63 options.set_include_httponly(); |
64 options.set_same_site_cookie_mode( | 64 options.set_same_site_cookie_mode( |
65 CookieOptions::SameSiteCookieMode::INCLUDE_STRICT_AND_LAX); | 65 CookieOptions::SameSiteCookieMode::INCLUDE_STRICT_AND_LAX); |
66 options.set_do_not_update_access_time(); | 66 options.set_do_not_update_access_time(); |
67 GetCookieListWithOptionsAsync(url, options, callback); | 67 GetCookieListWithOptionsAsync(url, options, std::move(callback)); |
68 } | 68 } |
69 | 69 |
70 void CookieStore::SetChannelIDServiceID(int id) { | 70 void CookieStore::SetChannelIDServiceID(int id) { |
71 DCHECK_EQ(-1, channel_id_service_id_); | 71 DCHECK_EQ(-1, channel_id_service_id_); |
72 channel_id_service_id_ = id; | 72 channel_id_service_id_ = id; |
73 } | 73 } |
74 | 74 |
75 int CookieStore::GetChannelIDServiceID() { | 75 int CookieStore::GetChannelIDServiceID() { |
76 return channel_id_service_id_; | 76 return channel_id_service_id_; |
77 } | 77 } |
78 | 78 |
79 CookieStore::CookieStore() : channel_id_service_id_(-1) {} | 79 CookieStore::CookieStore() : channel_id_service_id_(-1) {} |
80 | 80 |
81 } // namespace net | 81 } // namespace net |
OLD | NEW |