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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #include <algorithm> | 47 #include <algorithm> |
48 #include <functional> | 48 #include <functional> |
49 #include <set> | 49 #include <set> |
50 | 50 |
51 #include "base/basictypes.h" | 51 #include "base/basictypes.h" |
52 #include "base/bind.h" | 52 #include "base/bind.h" |
53 #include "base/callback.h" | 53 #include "base/callback.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/message_loop_proxy.h" |
58 #include "base/metrics/histogram.h" | 58 #include "base/metrics/histogram.h" |
59 #include "base/string_util.h" | 59 #include "base/string_util.h" |
60 #include "base/stringprintf.h" | 60 #include "base/stringprintf.h" |
61 #include "googleurl/src/gurl.h" | 61 #include "googleurl/src/gurl.h" |
62 #include "net/cookies/canonical_cookie.h" | 62 #include "net/cookies/canonical_cookie.h" |
63 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 63 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
64 #include "net/cookies/cookie_util.h" | 64 #include "net/cookies/cookie_util.h" |
65 #include "net/cookies/parsed_cookie.h" | 65 #include "net/cookies/parsed_cookie.h" |
66 | 66 |
67 using base::Time; | 67 using base::Time; |
(...skipping 2082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2150 | 2150 |
2151 // The system resolution is not high enough, so we can have multiple | 2151 // The system resolution is not high enough, so we can have multiple |
2152 // set cookies that result in the same system time. When this happens, we | 2152 // set cookies that result in the same system time. When this happens, we |
2153 // increment by one Time unit. Let's hope computers don't get too fast. | 2153 // increment by one Time unit. Let's hope computers don't get too fast. |
2154 Time CookieMonster::CurrentTime() { | 2154 Time CookieMonster::CurrentTime() { |
2155 return std::max(Time::Now(), | 2155 return std::max(Time::Now(), |
2156 Time::FromInternalValue(last_time_seen_.ToInternalValue() + 1)); | 2156 Time::FromInternalValue(last_time_seen_.ToInternalValue() + 1)); |
2157 } | 2157 } |
2158 | 2158 |
2159 } // namespace net | 2159 } // namespace net |
OLD | NEW |