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 // Portions of this code based on Mozilla: | 5 // Portions of this code based on Mozilla: |
6 // (netwerk/cookie/src/nsCookieService.cpp) | 6 // (netwerk/cookie/src/nsCookieService.cpp) |
7 /* ***** BEGIN LICENSE BLOCK ***** | 7 /* ***** BEGIN LICENSE BLOCK ***** |
8 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 8 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
9 * | 9 * |
10 * The contents of this file are subject to the Mozilla Public License Version | 10 * The contents of this file are subject to the Mozilla Public License Version |
(...skipping 24 matching lines...) Expand all Loading... |
35 * of those above. If you wish to allow use of your version of this file only | 35 * of those above. If you wish to allow use of your version of this file only |
36 * under the terms of either the GPL or the LGPL, and not to allow others to | 36 * under the terms of either the GPL or the LGPL, and not to allow others to |
37 * use your version of this file under the terms of the MPL, indicate your | 37 * use your version of this file under the terms of the MPL, indicate your |
38 * decision by deleting the provisions above and replace them with the notice | 38 * decision by deleting the provisions above and replace them with the notice |
39 * and other provisions required by the GPL or the LGPL. If you do not delete | 39 * and other provisions required by the GPL or the LGPL. If you do not delete |
40 * the provisions above, a recipient may use your version of this file under | 40 * the provisions above, a recipient may use your version of this file under |
41 * the terms of any one of the MPL, the GPL or the LGPL. | 41 * the terms of any one of the MPL, the GPL or the LGPL. |
42 * | 42 * |
43 * ***** END LICENSE BLOCK ***** */ | 43 * ***** END LICENSE BLOCK ***** */ |
44 | 44 |
45 #include "net/base/cookie_monster.h" | 45 #include "net/cookies/cookie_monster.h" |
46 | 46 |
47 #include <algorithm> | 47 #include <algorithm> |
48 #include <set> | 48 #include <set> |
49 | 49 |
50 #include "base/basictypes.h" | 50 #include "base/basictypes.h" |
51 #include "base/bind.h" | 51 #include "base/bind.h" |
52 #include "base/callback.h" | 52 #include "base/callback.h" |
53 #include "base/format_macros.h" | 53 #include "base/format_macros.h" |
54 #include "base/logging.h" | 54 #include "base/logging.h" |
55 #include "base/memory/scoped_ptr.h" | 55 #include "base/memory/scoped_ptr.h" |
56 #include "base/message_loop.h" | 56 #include "base/message_loop.h" |
57 #include "base/message_loop_proxy.h" | 57 #include "base/message_loop_proxy.h" |
58 #include "base/metrics/histogram.h" | 58 #include "base/metrics/histogram.h" |
59 #include "base/string_tokenizer.h" | 59 #include "base/string_tokenizer.h" |
60 #include "base/string_util.h" | 60 #include "base/string_util.h" |
61 #include "base/stringprintf.h" | 61 #include "base/stringprintf.h" |
62 #include "googleurl/src/gurl.h" | 62 #include "googleurl/src/gurl.h" |
63 #include "googleurl/src/url_canon.h" | 63 #include "googleurl/src/url_canon.h" |
64 #include "net/base/cookie_util.h" | 64 #include "net/cookies/cookie_util.h" |
65 #include "net/base/registry_controlled_domain.h" | 65 #include "net/base/registry_controlled_domain.h" |
66 | 66 |
67 using base::Time; | 67 using base::Time; |
68 using base::TimeDelta; | 68 using base::TimeDelta; |
69 using base::TimeTicks; | 69 using base::TimeTicks; |
70 | 70 |
71 // In steady state, most cookie requests can be satisfied by the in memory | 71 // In steady state, most cookie requests can be satisfied by the in memory |
72 // cookie monster store. However, if a request comes in during the initial | 72 // cookie monster store. However, if a request comes in during the initial |
73 // cookie load, it must be delayed until that load completes. That is done by | 73 // cookie load, it must be delayed until that load completes. That is done by |
74 // queueing it on CookieMonster::queue_ and running it when notification of | 74 // queueing it on CookieMonster::queue_ and running it when notification of |
(...skipping 2656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2731 std::string CookieMonster::CanonicalCookie::DebugString() const { | 2731 std::string CookieMonster::CanonicalCookie::DebugString() const { |
2732 return base::StringPrintf( | 2732 return base::StringPrintf( |
2733 "name: %s value: %s domain: %s path: %s creation: %" | 2733 "name: %s value: %s domain: %s path: %s creation: %" |
2734 PRId64, | 2734 PRId64, |
2735 name_.c_str(), value_.c_str(), | 2735 name_.c_str(), value_.c_str(), |
2736 domain_.c_str(), path_.c_str(), | 2736 domain_.c_str(), path_.c_str(), |
2737 static_cast<int64>(creation_date_.ToTimeT())); | 2737 static_cast<int64>(creation_date_.ToTimeT())); |
2738 } | 2738 } |
2739 | 2739 |
2740 } // namespace | 2740 } // namespace |
OLD | NEW |