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

Unified Diff: device/serial/serial_service_impl.h

Issue 363853003: Add a basic Mojo SerialService that implements GetDevices(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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
« no previous file with comments | « device/serial/serial_device_enumerator_win.cc ('k') | device/serial/serial_service_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/serial/serial_service_impl.h
diff --git a/device/serial/serial_service_impl.h b/device/serial/serial_service_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..ff4cf4f81d2700d102c2c12b927a3bad25710d39
--- /dev/null
+++ b/device/serial/serial_service_impl.h
@@ -0,0 +1,37 @@
+// Copyright 2014 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 DEVICE_SERIAL_SERIAL_SERVICE_IMPL_H_
+#define DEVICE_SERIAL_SERIAL_SERVICE_IMPL_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "base/message_loop/message_loop_proxy.h"
+#include "device/serial/serial.mojom.h"
+#include "device/serial/serial_device_enumerator.h"
+#include "mojo/public/cpp/bindings/interface_impl.h"
+
+namespace device {
+
+class SerialServiceImpl : public mojo::InterfaceImpl<serial::SerialService> {
+ public:
+ SerialServiceImpl();
+ virtual ~SerialServiceImpl();
+
+ static void Create(mojo::InterfaceRequest<serial::SerialService> request);
+ static void CreateOnMessageLoop(
+ scoped_refptr<base::MessageLoopProxy> message_loop,
+ mojo::InterfaceRequest<serial::SerialService> request);
+
+ // mojo::InterfaceImpl<SerialService> overrides.
+ virtual void GetDevices(const mojo::Callback<
+ void(mojo::Array<serial::DeviceInfoPtr>)>& callback) OVERRIDE;
+ virtual void OnConnectionError() OVERRIDE;
+
+ private:
+ scoped_ptr<SerialDeviceEnumerator> device_enumerator_;
+};
+
+} // namespace device
+
+#endif // DEVICE_SERIAL_SERIAL_SERVICE_IMPL_H_
« no previous file with comments | « device/serial/serial_device_enumerator_win.cc ('k') | device/serial/serial_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698