mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-19 01:46:35 +00:00
dawn_wire: Reject new callbacks if the client is disconnected
If the wire client is disconnected, it will not receive any messages from the server. Reject all callbacks that are created. Bug: dawn:556 Change-Id: I2eb2c449b1ca6c8ea3e74040ef095abfc46a9061 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/31161 Commit-Queue: Austin Eng <enga@chromium.org> Reviewed-by: Stephen White <senorblanco@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
01e969da33
commit
7ceffe8511
@@ -83,6 +83,7 @@ namespace dawn_wire { namespace client {
|
||||
}
|
||||
|
||||
void Client::Disconnect() {
|
||||
mDisconnected = true;
|
||||
mSerializer = ChunkedCommandSerializer(NoopCommandSerializer::GetInstance());
|
||||
if (mDevice != nullptr) {
|
||||
mDevice->HandleDeviceLost("GPU connection lost");
|
||||
@@ -94,4 +95,8 @@ namespace dawn_wire { namespace client {
|
||||
mDevices.Append(device);
|
||||
}
|
||||
|
||||
bool Client::IsDisconnected() const {
|
||||
return mDisconnected;
|
||||
}
|
||||
|
||||
}} // namespace dawn_wire::client
|
||||
|
||||
Reference in New Issue
Block a user