Make the wire Client own ObjectAllocators and CommandSerializer

This moves ownership of ObjectAllocators and CommandSerializers
from the Device to the Client. There may be also be multiple
Devices, so New() now takes the Device the object belongs to.
Device allocation specializes New() to take the owning Client so
that we can get a pointer to the Client from any Dawn API object.

Bug: dawn:88
Change-Id: Ie4274d46313884c44a857159e95d236dc1141c0c
Reviewed-on: https://dawn-review.googlesource.com/c/4001
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Austin Eng
2019-01-30 02:31:37 +00:00
committed by Commit Bot service account
parent fd4688e8d0
commit cd4fd8e7cd
16 changed files with 207 additions and 112 deletions

View File

@@ -170,6 +170,10 @@ class WireTestsBase : public Test {
void TearDown() override {
dawnSetProcs(nullptr);
// Reset client before mocks are deleted.
// Incomplete callbacks will be called on deletion, so the mocks cannot be null.
mWireClient = nullptr;
// Delete mocks so that expectations are checked
mockDeviceErrorCallback = nullptr;
mockBuilderErrorCallback = nullptr;