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

Side by Side Diff: device/serial/serial_service_impl.h

Issue 2410743002: Remove the mojo serial interfaces and related infrastructure. (Closed)
Patch Set: Created 4 years, 2 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 | « device/serial/serial_serialization.mojom ('k') | device/serial/serial_service_impl.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 2014 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 DEVICE_SERIAL_SERIAL_SERVICE_IMPL_H_
6 #define DEVICE_SERIAL_SERIAL_SERVICE_IMPL_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "base/single_thread_task_runner.h"
12 #include "base/threading/thread_task_runner_handle.h"
13 #include "device/serial/data_stream.mojom.h"
14 #include "device/serial/serial.mojom.h"
15 #include "device/serial/serial_connection_factory.h"
16 #include "device/serial/serial_device_enumerator.h"
17
18 namespace device {
19
20 class SerialServiceImpl : public serial::SerialService {
21 public:
22 explicit SerialServiceImpl(
23 scoped_refptr<SerialConnectionFactory> connection_factory);
24 SerialServiceImpl(scoped_refptr<SerialConnectionFactory> connection_factory,
25 std::unique_ptr<SerialDeviceEnumerator> device_enumerator);
26 ~SerialServiceImpl() override;
27
28 static void Create(scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
29 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
30 mojo::InterfaceRequest<serial::SerialService> request);
31 static void CreateOnMessageLoop(
32 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
33 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
34 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
35 mojo::InterfaceRequest<serial::SerialService> request);
36
37 // SerialService overrides.
38 void GetDevices(const GetDevicesCallback& callback) override;
39 void Connect(
40 const mojo::String& path,
41 serial::ConnectionOptionsPtr options,
42 mojo::InterfaceRequest<serial::Connection> connection_request,
43 mojo::InterfaceRequest<serial::DataSink> sink,
44 mojo::InterfaceRequest<serial::DataSource> source,
45 mojo::InterfacePtr<serial::DataSourceClient> source_client) override;
46
47 private:
48 SerialDeviceEnumerator* GetDeviceEnumerator();
49 bool IsValidPath(const mojo::String& path);
50
51 std::unique_ptr<SerialDeviceEnumerator> device_enumerator_;
52 scoped_refptr<SerialConnectionFactory> connection_factory_;
53
54 DISALLOW_COPY_AND_ASSIGN(SerialServiceImpl);
55 };
56
57 } // namespace device
58
59 #endif // DEVICE_SERIAL_SERIAL_SERVICE_IMPL_H_
OLDNEW
« no previous file with comments | « device/serial/serial_serialization.mojom ('k') | device/serial/serial_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698