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

Side by Side Diff: device/serial/serial.mojom

Issue 562563002: Make some fields non-nullable in serial.mojom and data_stream.mojom. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/data_stream.mojom ('k') | extensions/renderer/api/serial/serial_api_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import "data_stream.mojom" 5 import "data_stream.mojom"
6 6
7 module device.serial { 7 module device.serial {
8 8
9 struct DeviceInfo { 9 struct DeviceInfo {
10 string? path; 10 string path;
11 uint16 vendor_id; 11 uint16 vendor_id;
12 bool has_vendor_id = false; 12 bool has_vendor_id = false;
13 uint16 product_id; 13 uint16 product_id;
14 bool has_product_id = false; 14 bool has_product_id = false;
15 string? display_name; 15 string? display_name;
16 }; 16 };
17 17
18 enum SendError { 18 enum SendError {
19 NONE, 19 NONE,
20 DISCONNECTED, 20 DISCONNECTED,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 }; 75 };
76 76
77 struct DeviceControlSignals { 77 struct DeviceControlSignals {
78 bool dcd; 78 bool dcd;
79 bool cts; 79 bool cts;
80 bool ri; 80 bool ri;
81 bool dsr; 81 bool dsr;
82 }; 82 };
83 83
84 interface SerialService { 84 interface SerialService {
85 GetDevices() => (DeviceInfo?[]? devices); 85 GetDevices() => (DeviceInfo[] devices);
86 86
87 // Creates a |Connection| to |path| with options specified by |options|, 87 // Creates a |Connection| to |path| with options specified by |options|,
88 // returning it via |connection|. Sending and receiving data over this 88 // returning it via |connection|. Sending and receiving data over this
89 // connection is handled by |sink| and |source|, respectively. This will fail 89 // connection is handled by |sink| and |source|, respectively. This will fail
90 // and |connection| will not be usable if |path| does not specify a valid 90 // and |connection| will not be usable if |path| does not specify a valid
91 // serial device or there is an error connecting to or configuring the 91 // serial device or there is an error connecting to or configuring the
92 // connection. 92 // connection.
93 Connect(string? path, 93 Connect(string path,
94 ConnectionOptions? options, 94 ConnectionOptions? options,
95 Connection&? connection, 95 Connection& connection,
96 DataSink&? sink, 96 DataSink& sink,
97 DataSource&? source); 97 DataSource& source);
98 }; 98 };
99 99
100 interface Connection { 100 interface Connection {
101 GetInfo() => (ConnectionInfo? info); 101 GetInfo() => (ConnectionInfo? info);
102 SetOptions(ConnectionOptions? options) => (bool success); 102 SetOptions(ConnectionOptions options) => (bool success);
103 SetControlSignals(HostControlSignals? signals) => (bool success); 103 SetControlSignals(HostControlSignals signals) => (bool success);
104 GetControlSignals() => (DeviceControlSignals? signals); 104 GetControlSignals() => (DeviceControlSignals? signals);
105 Flush() => (bool success); 105 Flush() => (bool success);
106 }; 106 };
107 107
108 } 108 }
OLDNEW
« no previous file with comments | « device/serial/data_stream.mojom ('k') | extensions/renderer/api/serial/serial_api_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698