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 |
11 namespace net { | 11 namespace net { |
12 | 12 |
13 CookieStore::~CookieStore() {} | 13 CookieStore::~CookieStore() {} |
14 | 14 |
| 15 bool CookieStore::ChangeCauseIsDeletion(CookieStore::ChangeCause cause) { |
| 16 return cause != CookieStore::ChangeCause::INSERTED; |
| 17 } |
| 18 |
15 std::string CookieStore::BuildCookieLine( | 19 std::string CookieStore::BuildCookieLine( |
16 const std::vector<CanonicalCookie>& cookies) { | 20 const std::vector<CanonicalCookie>& cookies) { |
17 std::string cookie_line; | 21 std::string cookie_line; |
18 for (const auto& cookie : cookies) { | 22 for (const auto& cookie : cookies) { |
19 if (!cookie_line.empty()) | 23 if (!cookie_line.empty()) |
20 cookie_line += "; "; | 24 cookie_line += "; "; |
21 // In Mozilla, if you set a cookie like "AAA", it will have an empty token | 25 // In Mozilla, if you set a cookie like "AAA", it will have an empty token |
22 // and a value of "AAA". When it sends the cookie back, it will send "AAA", | 26 // and a value of "AAA". When it sends the cookie back, it will send "AAA", |
23 // so we need to avoid sending "=AAA" for a blank token value. | 27 // so we need to avoid sending "=AAA" for a blank token value. |
24 if (!cookie.Name().empty()) | 28 if (!cookie.Name().empty()) |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 channel_id_service_id_ = id; | 72 channel_id_service_id_ = id; |
69 } | 73 } |
70 | 74 |
71 int CookieStore::GetChannelIDServiceID() { | 75 int CookieStore::GetChannelIDServiceID() { |
72 return channel_id_service_id_; | 76 return channel_id_service_id_; |
73 } | 77 } |
74 | 78 |
75 CookieStore::CookieStore() : channel_id_service_id_(-1) {} | 79 CookieStore::CookieStore() : channel_id_service_id_(-1) {} |
76 | 80 |
77 } // namespace net | 81 } // namespace net |
OLD | NEW |