summaryrefslogtreecommitdiffstats
path: root/chrome/browser/network_time/network_time.h
blob: 90d5a938e2aae11a557e32f5083ad5af94bf1517 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_NETWORK_TIME_NETWORK_TIME_H_
#define CHROME_BROWSER_NETWORK_TIME_NETWORK_TIME_H_

#include "base/time/time.h"

// NetworkTime is a wrapper for Time that indicates that the underlying Time
// object represents real (network) time. This is to force conversions (from
// local to network time and vice versa) to be explicit.
class NetworkTime {
 public:
  NetworkTime() {}
  explicit NetworkTime(base::Time t) : time_internal_(t) {}
  ~NetworkTime() {}

  base::Time GetTime() const {
    return time_internal_;
  }

 private:
  // Network time value.
  base::Time time_internal_;
};

#endif  // CHROME_BROWSER_NETWORK_TIME_NETWORK_TIME_H_