OLD | NEW |
| (Empty) |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_NETWORK_TIME_NETWORK_TIME_H_ | |
6 #define CHROME_BROWSER_NETWORK_TIME_NETWORK_TIME_H_ | |
7 | |
8 #include "base/time/time.h" | |
9 | |
10 // NetworkTime is a wrapper for Time that indicates that the underlying Time | |
11 // object represents real (network) time. This is to force conversions (from | |
12 // local to network time and vice versa) to be explicit. | |
13 class NetworkTime { | |
14 public: | |
15 NetworkTime() {} | |
16 explicit NetworkTime(base::Time t) : time_internal_(t) {} | |
17 ~NetworkTime() {} | |
18 | |
19 base::Time GetTime() const { | |
20 return time_internal_; | |
21 } | |
22 | |
23 private: | |
24 // Network time value. | |
25 base::Time time_internal_; | |
26 }; | |
27 | |
28 #endif // CHROME_BROWSER_NETWORK_TIME_NETWORK_TIME_H_ | |
OLD | NEW |