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

Unified Diff: device/serial/serial_connection_factory.h

Issue 401563002: Add a partial Mojo serial connection interface and implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments 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_connection.cc ('k') | device/serial/serial_connection_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/serial/serial_connection_factory.h
diff --git a/device/serial/serial_connection_factory.h b/device/serial/serial_connection_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..99f17ee167835909a1571f5dcda6076ba49c1797
--- /dev/null
+++ b/device/serial/serial_connection_factory.h
@@ -0,0 +1,48 @@
+// 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_CONNECTION_FACTORY_H_
+#define DEVICE_SERIAL_SERIAL_CONNECTION_FACTORY_H_
+
+#include <string>
+
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
+#include "base/message_loop/message_loop_proxy.h"
+#include "device/serial/serial.mojom.h"
+#include "mojo/public/cpp/bindings/interface_request.h"
+
+namespace device {
+
+class SerialIoHandler;
+
+class SerialConnectionFactory
+ : public base::RefCountedThreadSafe<SerialConnectionFactory> {
+ public:
+ typedef base::Callback<scoped_refptr<SerialIoHandler>()> IoHandlerFactory;
+
+ SerialConnectionFactory(
+ const IoHandlerFactory& io_handler_factory,
+ scoped_refptr<base::MessageLoopProxy> connect_message_loop);
+
+ void CreateConnection(
+ const std::string& path,
+ serial::ConnectionOptionsPtr options,
+ mojo::InterfaceRequest<serial::Connection> connection_request);
+
+ private:
+ friend class base::RefCountedThreadSafe<SerialConnectionFactory>;
+ class ConnectTask;
+
+ virtual ~SerialConnectionFactory();
+
+ const IoHandlerFactory io_handler_factory_;
+ scoped_refptr<base::MessageLoopProxy> connect_message_loop_;
+
+ DISALLOW_COPY_AND_ASSIGN(SerialConnectionFactory);
+};
+
+} // namespace device
+
+#endif // DEVICE_SERIAL_SERIAL_CONNECTION_FACTORY_H_
« no previous file with comments | « device/serial/serial_connection.cc ('k') | device/serial/serial_connection_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698