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 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2148 | 2148 |
2149 | 2149 |
2150 // The system resolution is not high enough, so we can have multiple | 2150 // The system resolution is not high enough, so we can have multiple |
2151 // set cookies that result in the same system time. When this happens, we | 2151 // set cookies that result in the same system time. When this happens, we |
2152 // increment by one Time unit. Let's hope computers don't get too fast. | 2152 // increment by one Time unit. Let's hope computers don't get too fast. |
2153 Time CookieMonster::CurrentTime() { | 2153 Time CookieMonster::CurrentTime() { |
2154 return std::max(Time::Now(), | 2154 return std::max(Time::Now(), |
2155 Time::FromInternalValue(last_time_seen_.ToInternalValue() + 1)); | 2155 Time::FromInternalValue(last_time_seen_.ToInternalValue() + 1)); |
2156 } | 2156 } |
2157 | 2157 |
2158 } // namespace | 2158 } // namespace net |
OLD | NEW |