Commit ae03e3a8 authored by Julie Jeongeun Kim's avatar Julie Jeongeun Kim Committed by Commit Bot

Move HidConnectionImpl constructor and destructor to private

This is a follow-up CL for the review comment from [1].
HidConnectionImpl has Create method with hiding the bare call to new
HidConnectionImpl. The constructor is used to access the created
object from tests.
This CL moves the constructor and the destructor to private and adds
friend class for HidConnectionImplTest.

[1] https://crrev.com/c/1941447/2/services/device/hid/hid_connection_impl.cc#48

Change-Id: Ic9ae9883ea0eb13b9616ecb477920220e370a066
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1947619
Commit-Queue: Julie Kim <jkim@igalia.com>
Reviewed-by: default avatarMatt Reynolds <mattreynolds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721842}
parent 2f0866e5
......@@ -29,13 +29,6 @@ class HidConnectionImpl : public mojom::HidConnection,
mojo::PendingRemote<mojom::HidConnectionClient> connection_client,
mojo::PendingRemote<mojom::HidConnectionWatcher> watcher);
HidConnectionImpl(
scoped_refptr<device::HidConnection> connection,
mojo::PendingReceiver<mojom::HidConnection> receiver,
mojo::PendingRemote<mojom::HidConnectionClient> connection_client,
mojo::PendingRemote<mojom::HidConnectionWatcher> watcher);
~HidConnectionImpl() final;
// HidConnection::Client implementation:
void OnInputReport(scoped_refptr<base::RefCountedBytes> buffer,
size_t size) override;
......@@ -52,6 +45,14 @@ class HidConnectionImpl : public mojom::HidConnection,
SendFeatureReportCallback callback) override;
private:
friend class HidConnectionImplTest;
HidConnectionImpl(
scoped_refptr<device::HidConnection> connection,
mojo::PendingReceiver<mojom::HidConnection> receiver,
mojo::PendingRemote<mojom::HidConnectionClient> connection_client,
mojo::PendingRemote<mojom::HidConnectionWatcher> watcher);
~HidConnectionImpl() final;
void OnRead(ReadCallback callback,
bool success,
scoped_refptr<base::RefCountedBytes> buffer,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment