OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef NET_BASE_NETWORK_TIME_NOTIFIER_H_ | 5 #ifndef NET_BASE_NETWORK_TIME_NOTIFIER_H_ |
6 #define NET_BASE_NETWORK_TIME_NOTIFIER_H_ | 6 #define NET_BASE_NETWORK_TIME_NOTIFIER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
15 #include "base/time.h" | |
16 #include "base/time/tick_clock.h" | 15 #include "base/time/tick_clock.h" |
| 16 #include "base/time/time.h" |
17 #include "net/base/net_export.h" | 17 #include "net/base/net_export.h" |
18 | 18 |
19 namespace net { | 19 namespace net { |
20 | 20 |
21 // A class that receives updates for and maintains network time. Network time | 21 // A class that receives updates for and maintains network time. Network time |
22 // sources can pass updates through UpdateNetworkTime, and network time | 22 // sources can pass updates through UpdateNetworkTime, and network time |
23 // consumers can register as observers. This class is not thread-safe. | 23 // consumers can register as observers. This class is not thread-safe. |
24 class NET_EXPORT NetworkTimeNotifier { | 24 class NET_EXPORT NetworkTimeNotifier { |
25 public: | 25 public: |
26 // Callback for observers to receive network time updates. | 26 // Callback for observers to receive network time updates. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // A vector of callbacks is used, rather than an ObserverList, so that the | 75 // A vector of callbacks is used, rather than an ObserverList, so that the |
76 // lifetime of the observer can be bound to the callback. | 76 // lifetime of the observer can be bound to the callback. |
77 std::vector<ObserverCallback> observers_; | 77 std::vector<ObserverCallback> observers_; |
78 | 78 |
79 DISALLOW_COPY_AND_ASSIGN(NetworkTimeNotifier); | 79 DISALLOW_COPY_AND_ASSIGN(NetworkTimeNotifier); |
80 }; | 80 }; |
81 | 81 |
82 } // namespace net | 82 } // namespace net |
83 | 83 |
84 #endif // NET_BASE_NETWORK_TIME_NOTIFIER_H_ | 84 #endif // NET_BASE_NETWORK_TIME_NOTIFIER_H_ |
OLD | NEW |