Move most of Ref's functionality in RefBase for reuse.

This will allow using the same logic for other kinds of smartpointers,
like NSRef<>

Bug: dawn:89
Change-Id: Idbe08208fdb38b236f52635bc913162e60baf0f0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/32160
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez
2020-11-12 11:47:59 +00:00
committed by Commit Bot service account
parent b70a5b02e9
commit 2089adc62a
6 changed files with 209 additions and 148 deletions

View File

@@ -43,14 +43,7 @@ class RCTest : public RefCounted {
};
struct RCTestDerived : public RCTest {
RCTestDerived() : RCTest() {
}
RCTestDerived(uint64_t payload) : RCTest(payload) {
}
RCTestDerived(bool* deleted) : RCTest(deleted) {
}
using RCTest::RCTest;
};
// Test that RCs start with one ref, and removing it destroys the object.