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

Unified 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: Defaults to Metronome client Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chromeos/dbus/metronome_client.h
diff --git a/chromeos/dbus/metronome_client.h b/chromeos/dbus/metronome_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..ff02bee5d910db6c828f1278c38ebeb1daaacb96
--- /dev/null
+++ b/chromeos/dbus/metronome_client.h
@@ -0,0 +1,46 @@
+// Copyright 2015 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 CHROMEOS_DBUS_METRONOME_CLIENT_H_
+#define CHROMEOS_DBUS_METRONOME_CLIENT_H_
+
+#include "base/basictypes.h"
+#include "base/callback_forward.h"
+#include "chromeos/dbus/dbus_client.h"
+#include "chromeos/dbus/dbus_client_implementation_type.h"
+
+namespace chromeos {
+
+// A DBus client class for the org.chromium.Metronome service.
+class MetronomeClient : public DBusClient {
+ public:
+ // Interface for observing timestamp events from a metronome client.
+ class Observer {
+ public:
+ // Called when the TimestampUpdated signal is received.
+ virtual void OnTimestampUpdated(uint64 beacon_timestamp,
+ uint64 mac_timestamp) = 0;
Ben Chan 2015/02/19 19:03:14 |beacon_timestamp| and |mac_timestamp| kinda refer
varkha 2015/02/19 20:33:43 Done.
+ };
+
+ virtual ~MetronomeClient();
+
+ // Adds and removes observers for timestamp events.
+ virtual void AddObserver(Observer* observer) = 0;
+ virtual void RemoveObserver(Observer* observer) = 0;
+
+ // Factory function, creates a new instance and returns ownership.
+ // For normal usage, access the singleton via DBusThreadManager::Get().
+ static MetronomeClient* Create(DBusClientImplementationType type);
+
+ protected:
+ // Create() should be used instead.
+ MetronomeClient();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MetronomeClient);
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_DBUS_METRONOME_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698