Add WireClient::Disconnect to stop serializing commands

This prevents the client from continuing to send commands
when the wire connection has dropped. In Chromium this may
be because the connection to the GPU process is lost and the
transfer buffer may be destroyed.

This CL also adds a new helper to make testing callbacks
with mocks easier.

Bug: chromium:1070392
Change-Id: I6a69c32cc506069554ead18ee83a156ca70e2ce2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19160
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Austin Eng
2020-04-15 02:00:14 +00:00
committed by Commit Bot service account
parent beaaa5a601
commit 93bea5cb50
9 changed files with 271 additions and 8 deletions

View File

@@ -52,6 +52,10 @@ namespace dawn_wire {
ReservedTexture ReserveTexture(WGPUDevice device);
// Disconnects the client.
// Commands allocated after this point will not be sent.
void Disconnect();
private:
std::unique_ptr<client::Client> mImpl;
};