Bug 1838739 - Initialize result of SetAsGPUOutOfMemoryError. r=webgpu-reviewers,nical

Differential Revision: https://phabricator.services.mozilla.com/D181161
This commit is contained in:
Kelsey Gilbert 2023-06-16 18:16:28 +00:00
parent f3e0985c12
commit f2bc14357b
2 changed files with 5 additions and 4 deletions

View File

@ -18,6 +18,7 @@
#include "Buffer.h"
#include "ComputePipeline.h"
#include "DeviceLostInfo.h"
#include "OutOfMemoryError.h"
#include "PipelineLayout.h"
#include "Queue.h"
#include "RenderBundleEncoder.h"
@ -376,7 +377,7 @@ already_AddRefed<dom::Promise> Device::PopErrorScope(ErrorResult& aRv) {
return;
case PopErrorScopeResultType::OutOfMemory:
error.SetAsGPUOutOfMemoryError();
error.SetAsGPUOutOfMemoryError() = new OutOfMemoryError(self);
break;
case PopErrorScopeResultType::ValidationError:

View File

@ -20,13 +20,13 @@ class OutOfMemoryError final : public nsWrapperCache, public ChildOf<Device> {
public:
GPU_DECL_CYCLE_COLLECTION(OutOfMemoryError)
GPU_DECL_JS_WRAP(OutOfMemoryError)
OutOfMemoryError() = delete;
explicit OutOfMemoryError(const RefPtr<Device>& aParent)
: ChildOf<Device>(aParent) {}
private:
virtual ~OutOfMemoryError();
void Cleanup() {}
public:
};
} // namespace webgpu