Move from mojo::DataPipe to mojo::CreateDataPipe in //jingle
The DataPipe constructor has no way to check for errors if creation fails, so it CHECKs and crashes. CreateDataPipe offers a way to check the return value. Bug: 944990 Change-Id: I6d38e7a7877d626e181d72752c2a5501b65d8e93 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2657345 Reviewed-by: Sergey Ulanov <sergeyu@chromium.org> Commit-Queue: Robert Sesek <rsesek@chromium.org> Cr-Commit-Position: refs/heads/master@{#848723}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
9bc2a94b12
commit
65c4e9f405
@ -152,16 +152,21 @@ class MockProxyResolvingSocket : public network::mojom::ProxyResolvingSocket {
|
||||
void Connect(mojo::PendingRemote<network::mojom::SocketObserver> observer,
|
||||
network::mojom::ProxyResolvingSocketFactory::
|
||||
CreateProxyResolvingSocketCallback callback) {
|
||||
mojo::DataPipe send_pipe;
|
||||
mojo::DataPipe receive_pipe;
|
||||
mojo::ScopedDataPipeProducerHandle send_producer_handle;
|
||||
ASSERT_EQ(
|
||||
mojo::CreateDataPipe(nullptr, send_producer_handle, send_pipe_handle_),
|
||||
MOJO_RESULT_OK);
|
||||
|
||||
mojo::ScopedDataPipeConsumerHandle receive_consumer_handle;
|
||||
ASSERT_EQ(mojo::CreateDataPipe(nullptr, receive_pipe_handle_,
|
||||
receive_consumer_handle),
|
||||
MOJO_RESULT_OK);
|
||||
|
||||
observer_.Bind(std::move(observer));
|
||||
receive_pipe_handle_ = std::move(receive_pipe.producer_handle);
|
||||
send_pipe_handle_ = std::move(send_pipe.consumer_handle);
|
||||
|
||||
std::move(callback).Run(net::OK, base::nullopt, base::nullopt,
|
||||
std::move(receive_pipe.consumer_handle),
|
||||
std::move(send_pipe.producer_handle));
|
||||
std::move(receive_consumer_handle),
|
||||
std::move(send_producer_handle));
|
||||
}
|
||||
|
||||
void RunEvents(std::vector<Event>&& events);
|
||||
|
Reference in New Issue
Block a user