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

Unified Diff: device/usb/device_impl.h

Issue 1155163008: Build a basic Mojo service framework for device/usb (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DISALLOW Created 5 years, 7 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/usb/BUILD.gn ('k') | device/usb/device_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/device_impl.h
diff --git a/device/usb/device_impl.h b/device/usb/device_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..5848c41226d0bf8a2d9dd6693165cee5e327fd25
--- /dev/null
+++ b/device/usb/device_impl.h
@@ -0,0 +1,44 @@
+// 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 DEVICE_USB_DEVICE_IMPL_H_
+#define DEVICE_USB_DEVICE_IMPL_H_
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "device/usb/public/interfaces/device.mojom.h"
+#include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h"
+#include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h"
+
+namespace device {
+
+class UsbDevice;
+
+namespace usb {
+
+// Implementation of the public Device interface. Instances of this class are
+// constructed by DeviceManagerImpl and are strongly bound to their MessagePipe
+// lifetime.
+class DeviceImpl : public Device {
+ public:
+ DeviceImpl(scoped_refptr<UsbDevice> device,
+ mojo::InterfaceRequest<Device> request);
+ ~DeviceImpl() override;
+
+ private:
+ // Device implementation:
+ void GetDeviceInfo(const GetDeviceInfoCallback& callback) override;
+
+ mojo::StrongBinding<Device> binding_;
+
+ scoped_refptr<UsbDevice> device_;
+ DeviceInfoPtr info_;
+
+ DISALLOW_COPY_AND_ASSIGN(DeviceImpl);
+};
+
+} // namespace usb
+} // namespace device
+
+#endif // DEVICE_USB_DEVICE_IMPL_H_
« no previous file with comments | « device/usb/BUILD.gn ('k') | device/usb/device_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698