WireServer: Don't allow freeing the Device

BUG=chromium:907278
BUG=chromium:911155

Change-Id: I6ec721b34b214bb242ac0d217e6ab12832c7323a
Reviewed-on: https://dawn-review.googlesource.com/c/2842
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2018-12-07 16:25:36 +00:00 committed by Commit Bot service account
parent 1d2850a129
commit 67737f1d4a

View File

@ -625,6 +625,12 @@ namespace dawn_wire {
//* reference / release and only send destroy on refcount = 0.
{% set Suffix = as_MethodSuffix(type.name, Name("destroy")) %}
bool Handle{{Suffix}}(const char** commands, size_t* size) {
//* Freeing the device has to be done out of band.
{% if type.name.canonical_case() == "device" %}
return false;
{% endif %}
const auto* cmd = GetCommand<{{Suffix}}Cmd>(commands, size);
if (cmd == nullptr) {
return false;