New issue
Advanced search Search tips

Issue 749515 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 728227



Sign in to add a comment

Expose SerialIoHandler interface from Device Service

Project Member Reported by leon....@intel.com, Jul 27 2017

Issue description

interface SerialIoHandler {
  Open(String port, device.serial.ConnectionOptions options) => (bool success);
  Read(uint32 bytes) => (array<uint8> data, device.serial.ReceiveError error);
  Write(array<uint8> data) => (uint32 bytes_written, device.serial.SendError error);
  CancelRead(device.serial.ReceiveError reason);
  CancelWrite(device.serial.SendError reason);
  Flush() => (bool success);
  GetControlSignals() => (device.serial.DeviceControlSignals signals);
  SetControlSignals(device.serial.DeviceControlSignals signals) => (bool success);
  ConfigurePort(device.serial.ConnectionOptions options) => (bool success);
  GetPortInfo() => (device.serial.ConnectionInfo info);
  SetBreak() => (bool success);
  ClearBreak() => (bool success);
}

Based on SerialIoHandler in //device/serial/, implement mojo interface SerialIoHandler inside Device Service.

Change users in //extensions/browser/api/serial to consume above interface.


 
Project Member

Comment 1 by bugdroid1@chromium.org, Aug 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1af38255f69ec0ed596f2b2994d38795a473aaf2

commit 1af38255f69ec0ed596f2b2994d38795a473aaf2
Author: Han Leon <leon.han@intel.com>
Date: Wed Aug 16 22:41:46 2017

[DeviceService] Expose SerialIoHandler interface from Device Service

This CL is part of servicification work for //device/serial, it:
 - creates a new mojo interface SerialIoHandler and exposes it
   from Device Service, the interface implementation wraps
   a device::SerialIoHandler to do actual work.
 - lets serial extension API impls consume the above interface instead
   of directly calling functions of device::SerialIoHandler.

BUG= 749515 
TEST=browser_tests SerialApiTest.*

Change-Id: I6ecf94e5e5a8469f4fca386e072e3b73076516ae
Reviewed-on: https://chromium-review.googlesource.com/610447
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Han Leon <leon.han@intel.com>
Cr-Commit-Position: refs/heads/master@{#494985}
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/device/serial/serial.mojom
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/extensions/browser/api/api_resource_manager.h
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/extensions/browser/api/serial/BUILD.gn
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/extensions/browser/api/serial/serial_api.cc
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/extensions/browser/api/serial/serial_api.h
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/extensions/browser/api/serial/serial_apitest.cc
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/extensions/browser/api/serial/serial_connection.cc
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/extensions/browser/api/serial/serial_connection.h
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/extensions/browser/api/serial/serial_event_dispatcher.cc
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/extensions/browser/api/serial/serial_event_dispatcher.h
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/extensions/browser/api/webcam_private/BUILD.gn
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/extensions/browser/api/webcam_private/visca_webcam.cc
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/extensions/browser/api/webcam_private/visca_webcam.h
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/extensions/browser/api/webcam_private/visca_webcam_unittest.cc
[add] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/extensions/utility/scoped_callback_runner.h
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/services/device/BUILD.gn
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/services/device/device_service.cc
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/services/device/device_service.h
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/services/device/manifest.json
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/services/device/public/interfaces/BUILD.gn
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/services/device/public/interfaces/serial.mojom
[modify] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/services/device/serial/BUILD.gn
[add] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/services/device/serial/serial_io_handler_impl.cc
[add] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/services/device/serial/serial_io_handler_impl.h
[add] https://crrev.com/1af38255f69ec0ed596f2b2994d38795a473aaf2/services/device/serial/serial_io_handler_impl_unittest.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Aug 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/67733074555dfffae371b0346f26f02cfaad89a5

commit 67733074555dfffae371b0346f26f02cfaad89a5
Author: Han Leon <leon.han@intel.com>
Date: Fri Aug 18 00:56:33 2017

[DeviceService] Use once callbacks for all serial codes

This CL replaces all repeating callbacks with once callbacks across all
serial related codes.

BUG= 749515 
TBR=charliea@chromium.org

Change-Id: Idcc8d82a445ea0bee62b8c12bc663cacafebdfe1
Reviewed-on: https://chromium-review.googlesource.com/619039
Commit-Queue: Han Leon <leon.han@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495403}
[modify] https://crrev.com/67733074555dfffae371b0346f26f02cfaad89a5/device/serial/buffer.cc
[modify] https://crrev.com/67733074555dfffae371b0346f26f02cfaad89a5/device/serial/buffer.h
[modify] https://crrev.com/67733074555dfffae371b0346f26f02cfaad89a5/device/serial/serial_io_handler.cc
[modify] https://crrev.com/67733074555dfffae371b0346f26f02cfaad89a5/device/serial/serial_io_handler.h
[modify] https://crrev.com/67733074555dfffae371b0346f26f02cfaad89a5/device/serial/test_serial_io_handler.cc
[modify] https://crrev.com/67733074555dfffae371b0346f26f02cfaad89a5/device/serial/test_serial_io_handler.h
[modify] https://crrev.com/67733074555dfffae371b0346f26f02cfaad89a5/extensions/browser/api/serial/serial_apitest.cc
[modify] https://crrev.com/67733074555dfffae371b0346f26f02cfaad89a5/extensions/browser/api/serial/serial_connection.cc
[modify] https://crrev.com/67733074555dfffae371b0346f26f02cfaad89a5/extensions/browser/api/serial/serial_connection.h
[modify] https://crrev.com/67733074555dfffae371b0346f26f02cfaad89a5/extensions/browser/api/serial/serial_event_dispatcher.cc
[modify] https://crrev.com/67733074555dfffae371b0346f26f02cfaad89a5/services/device/serial/serial_io_handler_impl.cc
[modify] https://crrev.com/67733074555dfffae371b0346f26f02cfaad89a5/tools/battor_agent/battor_connection_impl.cc
[modify] https://crrev.com/67733074555dfffae371b0346f26f02cfaad89a5/tools/battor_agent/battor_connection_impl_unittest.cc

Project Member

Comment 3 by bugdroid1@chromium.org, Aug 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/effed0b438e8d3f4abc876b59345aed587837abc

commit effed0b438e8d3f4abc876b59345aed587837abc
Author: Han Leon <leon.han@intel.com>
Date: Sat Aug 19 00:01:06 2017

[DeviceService] Eliminate SerialConnection::TimeoutTask class

This CL uses base::CancelableClosure instead, thus we can eliminate
SerialConnection::TimeoutTask class.

BUG= 749515 

Change-Id: Ic3117f74a48ea3462ed4d8f4faa4b56257cac9b0
Reviewed-on: https://chromium-review.googlesource.com/620134
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Han Leon <leon.han@intel.com>
Cr-Commit-Position: refs/heads/master@{#495753}
[modify] https://crrev.com/effed0b438e8d3f4abc876b59345aed587837abc/extensions/browser/api/serial/serial_connection.cc
[modify] https://crrev.com/effed0b438e8d3f4abc876b59345aed587837abc/extensions/browser/api/serial/serial_connection.h

Project Member

Comment 4 by bugdroid1@chromium.org, Aug 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7c7bccb378d3ac6b6b818eb5a611d40d6ec2ffac

commit 7c7bccb378d3ac6b6b818eb5a611d40d6ec2ffac
Author: Han Leon <leon.han@intel.com>
Date: Sat Aug 19 13:44:08 2017

[DeviceService] Merge serial.mojom

This CL merges device/serial/serial.mojom into
services/device/public/interfaces/serial.mojom.

BUG= 749515 
TBR=charliea@chromium.org

Change-Id: I0f69f37738e84dcda9bba41200a8a5902c398e00
Reviewed-on: https://chromium-review.googlesource.com/620284
Commit-Queue: Han Leon <leon.han@intel.com>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495814}
[modify] https://crrev.com/7c7bccb378d3ac6b6b818eb5a611d40d6ec2ffac/device/serial/BUILD.gn
[modify] https://crrev.com/7c7bccb378d3ac6b6b818eb5a611d40d6ec2ffac/device/serial/DEPS
[modify] https://crrev.com/7c7bccb378d3ac6b6b818eb5a611d40d6ec2ffac/device/serial/buffer.h
[delete] https://crrev.com/a037721a9dd488fe7cdffcb428822e2708b08ae1/device/serial/serial.mojom
[modify] https://crrev.com/7c7bccb378d3ac6b6b818eb5a611d40d6ec2ffac/device/serial/serial_device_enumerator.h
[modify] https://crrev.com/7c7bccb378d3ac6b6b818eb5a611d40d6ec2ffac/device/serial/serial_io_handler.h
[modify] https://crrev.com/7c7bccb378d3ac6b6b818eb5a611d40d6ec2ffac/device/serial/test_serial_io_handler.cc
[modify] https://crrev.com/7c7bccb378d3ac6b6b818eb5a611d40d6ec2ffac/device/serial/test_serial_io_handler.h
[modify] https://crrev.com/7c7bccb378d3ac6b6b818eb5a611d40d6ec2ffac/extensions/BUILD.gn
[modify] https://crrev.com/7c7bccb378d3ac6b6b818eb5a611d40d6ec2ffac/extensions/browser/api/serial/serial_api.h
[modify] https://crrev.com/7c7bccb378d3ac6b6b818eb5a611d40d6ec2ffac/services/device/public/interfaces/BUILD.gn
[modify] https://crrev.com/7c7bccb378d3ac6b6b818eb5a611d40d6ec2ffac/services/device/public/interfaces/serial.mojom
[modify] https://crrev.com/7c7bccb378d3ac6b6b818eb5a611d40d6ec2ffac/tools/battor_agent/DEPS
[modify] https://crrev.com/7c7bccb378d3ac6b6b818eb5a611d40d6ec2ffac/tools/battor_agent/battor_connection_impl.h
[modify] https://crrev.com/7c7bccb378d3ac6b6b818eb5a611d40d6ec2ffac/tools/battor_agent/battor_connection_impl_unittest.cc
[modify] https://crrev.com/7c7bccb378d3ac6b6b818eb5a611d40d6ec2ffac/tools/battor_agent/battor_finder.cc

Comment 5 by leon....@intel.com, Aug 22 2017

Status: Fixed (was: Started)
Project Member

Comment 6 by bugdroid1@chromium.org, Aug 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4c0e4cbfb52bf05fa9957e61f35efad905790fb7

commit 4c0e4cbfb52bf05fa9957e61f35efad905790fb7
Author: Han Leon <leon.han@intel.com>
Date: Wed Aug 23 02:56:51 2017

[DeviceService] Update device::SendBuffer to avoid unnecessary vector copy

- Makes device::SendBuffer ctor take 'const std::vector<uint8_t>&'
  rather than 'const std::vector<char>&'
- Changes type of its member |data_| from 'const std::vector<char>' to
  'const std::vector<uint8_t>'.

BUG= 749515 
TBR=charliea@chromium.org

Change-Id: I27424642d866174be84f7916f260b1f5e6b769a8
Reviewed-on: https://chromium-review.googlesource.com/620207
Commit-Queue: Han Leon <leon.han@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496571}
[modify] https://crrev.com/4c0e4cbfb52bf05fa9957e61f35efad905790fb7/device/serial/buffer.cc
[modify] https://crrev.com/4c0e4cbfb52bf05fa9957e61f35efad905790fb7/device/serial/buffer.h
[modify] https://crrev.com/4c0e4cbfb52bf05fa9957e61f35efad905790fb7/device/serial/serial_io_handler.h
[modify] https://crrev.com/4c0e4cbfb52bf05fa9957e61f35efad905790fb7/device/serial/test_serial_io_handler.cc
[modify] https://crrev.com/4c0e4cbfb52bf05fa9957e61f35efad905790fb7/device/serial/test_serial_io_handler.h
[modify] https://crrev.com/4c0e4cbfb52bf05fa9957e61f35efad905790fb7/extensions/browser/api/serial/serial_apitest.cc
[modify] https://crrev.com/4c0e4cbfb52bf05fa9957e61f35efad905790fb7/services/device/serial/serial_io_handler_impl.cc
[modify] https://crrev.com/4c0e4cbfb52bf05fa9957e61f35efad905790fb7/tools/battor_agent/battor_connection_impl.cc
[modify] https://crrev.com/4c0e4cbfb52bf05fa9957e61f35efad905790fb7/tools/battor_agent/battor_connection_impl_unittest.cc
[modify] https://crrev.com/4c0e4cbfb52bf05fa9957e61f35efad905790fb7/tools/battor_agent/serial_utils.cc
[modify] https://crrev.com/4c0e4cbfb52bf05fa9957e61f35efad905790fb7/tools/battor_agent/serial_utils.h
[modify] https://crrev.com/4c0e4cbfb52bf05fa9957e61f35efad905790fb7/tools/battor_agent/serial_utils_unittest.cc

Components: Internals>Services>Device

Sign in to add a comment