• Lan Wei's avatar
    Revert "[Nearby] Create concrete BluetoothSocket and implement ConnectToService." · c40cd06b
    Lan Wei authored
    This reverts commit 261661bb.
    
    Reason for revert:
    BluetoothSocketTest.TestInputStream/TestOutputStream fails on Linux TSan Tests
    https://ci.chromium.org/p/chromium/builders/ci/Linux%20TSan%20Tests/57982
    
    Original change's description:
    > [Nearby] Create concrete BluetoothSocket and implement ConnectToService.
    > 
    > Implement a concrete location::nearby::api::BluetoothSocket, created via
    > a bluetooth::mojom::Socket and Mojo DataPipes supplied by the newly
    > implemented BluetoothClassicMedium::ConnectToService().
    > 
    > Nearby Connections uses this BluetoothSocket to communicate with a
    > remote device. At a high-level, it first exchanges frames to encrypt
    > the connection, then delegates to its caller (e.g., Nearby Share)
    > to authenticate the connection, and finally expects its caller to
    > send and receive application-level messages. The following precautions
    > are taken to handle untrusted bytes received from remote devices:
    >   * Nearby Connections (including the code being added in this CL) is
    >     hosted in a Nearby utility process.
    >   * Whenever Nearby Connections provides bytes received from a remote
    >     device to its caller, even after it has been authenticated, the
    >     caller must not trust those bytes, and is responsible for first
    >     passing those bytes through the trusted NearbyDecoder interface
    >     (see go/nearby-chrome-mojo). NearbyDecoder is hosted in the same
    >     Nearby utility process.
    > 
    > api::BluetoothSocket is a synchronous interface, so this
    > implementation consumes the synchronous signatures of
    > bluetooth::mojom::Socket methods.
    > 
    > api::BluetoothSocket's subclasses are also synchronous interfaces,
    > but the Mojo DataPipes they consume only provide asynchronous
    > interfaces. This is reconciled by blocking on the caller thread when
    > waiting (via a mojo::SimpleWatcher) for the DataPipes to become
    > readable or writable (this is expected by the callers of
    > api::BluetoothSocket's subclasses). Mojo DataPipe operations are
    > handled on a separate task runner so that blocking on the calling
    > thread will not deadlock.
    > 
    > Please see design doc go/nearby-chrome-bt for more details.
    > 
    > Bug: b:154849033, b:158848873
    > Change-Id: I2e945277aa1f75b4ca378d0b961f7682ff25d812
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2322166
    > Commit-Queue: Ryan Hansberry <hansberry@chromium.org>
    > Reviewed-by: Alex Chau <alexchau@chromium.org>
    > Reviewed-by: James Vecore <vecore@google.com>
    > Reviewed-by: Reilly Grant <reillyg@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#797758}
    
    TBR=reillyg@chromium.org,hansberry@chromium.org,alexchau@chromium.org,vecore@google.com
    
    Change-Id: Ia33d32ae93a8900032e81f77d298553c5de82874
    No-Presubmit: true
    No-Tree-Checks: true
    No-Try: true
    Bug: b:154849033
    Bug: b:158848873
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2355253Reviewed-by: default avatarLan Wei <lanwei@chromium.org>
    Commit-Queue: Lan Wei <lanwei@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#797966}
    c40cd06b
adapter.h 3.75 KB