summaryrefslogtreecommitdiffstats
path: root/device/serial/serial_serialization.mojom
diff options
context:
space:
mode:
authorsammc <sammc@chromium.org>2014-10-04 01:35:45 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-04 08:35:59 +0000
commit8ef8db1b7662d904fc3c325422aa8c58e1533e52 (patch)
treefb39ffc0dee7254f0a5a062b22d23bd60914939c /device/serial/serial_serialization.mojom
parentb373ec3d9f757ba065bae01de186632ff0f260d3 (diff)
downloadchromium_src-8ef8db1b7662d904fc3c325422aa8c58e1533e52.zip
chromium_src-8ef8db1b7662d904fc3c325422aa8c58e1533e52.tar.gz
chromium_src-8ef8db1b7662d904fc3c325422aa8c58e1533e52.tar.bz2
Add serialization support to the JS serial connection client.
To support persistent serial connections on mojo, serial.Connection and its dependencies must be serializable to mojo structs so it can be stashed. This adds serialization support to serial.Connection. BUG=389016 Committed: https://crrev.com/3daad1ed89cd32023624be98edaf051a0043ff5f Cr-Commit-Position: refs/heads/master@{#298158} Review URL: https://codereview.chromium.org/592263004 Cr-Commit-Position: refs/heads/master@{#298171}
Diffstat (limited to 'device/serial/serial_serialization.mojom')
-rw-r--r--device/serial/serial_serialization.mojom31
1 files changed, 31 insertions, 0 deletions
diff --git a/device/serial/serial_serialization.mojom b/device/serial/serial_serialization.mojom
new file mode 100644
index 0000000..77a7ef7
--- /dev/null
+++ b/device/serial/serial_serialization.mojom
@@ -0,0 +1,31 @@
+// 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.
+
+import "serial.mojom"
+import "data_stream_serialization.mojom"
+
+module device.serial {
+
+// The client state of a serial connection.
+struct ConnectionState {
+ uint32 connectionId;
+ bool paused = false;
+ bool persistent = false;
+ string name = "";
+ uint32 receiveTimeout = 0;
+ uint32 sendTimeout = 0;
+ uint32 bufferSize = 4096;
+};
+
+// A serialized serial connection.
+struct SerializedConnection {
+ ConnectionState state;
+ ReceiveError queuedReceiveError = NONE;
+ array<int8>? queuedReceiveData;
+ Connection connection;
+ SerializedDataSender sender;
+ SerializedDataReceiver receiver;
+};
+
+}