Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: chromeos/dbus/metronome_client.h

Issue 935933002: Adds metronome time sync dbus client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adds a command line flag to use a timer-based fake implementation Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromeos/dbus/dbus_thread_manager.cc ('k') | chromeos/dbus/metronome_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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 CHROMEOS_DBUS_METRONOME_CLIENT_H_
6 #define CHROMEOS_DBUS_METRONOME_CLIENT_H_
7
8 #include "base/basictypes.h"
9 #include "base/callback_forward.h"
10 #include "base/memory/ref_counted.h"
11 #include "chromeos/chromeos_export.h"
12 #include "chromeos/dbus/dbus_client.h"
13 #include "chromeos/dbus/dbus_client_implementation_type.h"
14
15 namespace chromeos {
16
17 // A DBus client class for the org.chromium.Metronome service.
18 class CHROMEOS_EXPORT MetronomeClient : public DBusClient {
19 public:
20 // Interface for observing timestamp events from a metronome client.
21 class Observer {
22 public:
23 // Called when the TimestampUpdated signal is received.
24 virtual void OnTimestampUpdated(uint64 beacon_timestamp,
25 uint64 local_timestamp) = 0;
26 virtual ~Observer() {}
27 };
28
29 ~MetronomeClient() override;
30
31 // Adds and removes observers for timestamp events.
32 virtual void AddObserver(Observer* observer) = 0;
33 virtual void RemoveObserver(Observer* observer) = 0;
34
35 // Factory function, creates a new instance and returns ownership.
36 // For normal usage, access the singleton via DBusThreadManager::Get().
37 static MetronomeClient* Create(DBusClientImplementationType type);
38
39 protected:
40 // Create() should be used instead.
41 MetronomeClient();
42
43 private:
44 DISALLOW_COPY_AND_ASSIGN(MetronomeClient);
45 };
46
47 } // namespace chromeos
48
49 #endif // CHROMEOS_DBUS_METRONOME_CLIENT_H_
OLDNEW
« no previous file with comments | « chromeos/dbus/dbus_thread_manager.cc ('k') | chromeos/dbus/metronome_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698