Backed out changeset 53e483e319ed (bug 1921083) for causing leaks at nsGlobalWindowInner. CLOSED TREE

This commit is contained in:
Butkovits Atila 2024-09-27 16:48:12 +03:00
parent 028d69f48f
commit fb5f07ac46
5 changed files with 1 additions and 44 deletions

View File

@ -1362,10 +1362,6 @@ DOMInterfaces = {
'GPUTextureUsage': {
'concrete': False,
},
'WGSLLanguageFeatures': {
'nativeType': 'mozilla::webgpu::WGSLLanguageFeatures',
'headerFile': 'mozilla/webgpu/Instance.h',
},
# Glean

View File

@ -1544,8 +1544,6 @@ let interfaceNamesInGlobalScope = [
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "Window", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "WGSLLanguageFeatures", nightly: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "Worker", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "Worklet", insecureContext: false },

View File

@ -20,8 +20,6 @@
namespace mozilla::webgpu {
GPU_IMPL_CYCLE_COLLECTION(WGSLLanguageFeatures, mParent)
GPU_IMPL_CYCLE_COLLECTION(Instance, mOwner)
static inline nsDependentCString ToCString(const std::string_view s) {
@ -46,8 +44,7 @@ already_AddRefed<Instance> Instance::Create(nsIGlobalObject* aOwner) {
return result.forget();
}
Instance::Instance(nsIGlobalObject* aOwner)
: mOwner(aOwner), mWgslLanguageFeatures(new WGSLLanguageFeatures(this)) {}
Instance::Instance(nsIGlobalObject* aOwner) : mOwner(aOwner) {}
Instance::~Instance() { Cleanup(); }

View File

@ -23,30 +23,8 @@ struct GPURequestAdapterOptions;
namespace webgpu {
class Adapter;
class GPUAdapter;
class Instance;
class WebGPUChild;
class WGSLLanguageFeatures final : public nsWrapperCache,
public ChildOf<Instance> {
public:
GPU_DECL_CYCLE_COLLECTION(WGSLLanguageFeatures)
public:
explicit WGSLLanguageFeatures(Instance* const aParent) : ChildOf(aParent) {}
private:
void Cleanup() {}
protected:
~WGSLLanguageFeatures() { Cleanup(); };
public:
JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override {
return dom::WGSLLanguageFeatures_Binding::Wrap(aCx, this, aGivenProto);
}
};
class Instance final : public nsWrapperCache {
public:
GPU_DECL_CYCLE_COLLECTION(Instance)
@ -74,13 +52,8 @@ class Instance final : public nsWrapperCache {
void Cleanup();
nsCOMPtr<nsIGlobalObject> mOwner;
RefPtr<WGSLLanguageFeatures> mWgslLanguageFeatures;
public:
already_AddRefed<WGSLLanguageFeatures> WgslLanguageFeatures() const {
RefPtr<WGSLLanguageFeatures> features = mWgslLanguageFeatures;
return features.forget();
}
};
} // namespace webgpu

View File

@ -58,12 +58,6 @@ interface GPUSupportedFeatures {
readonly setlike<DOMString>;
};
[Func="mozilla::webgpu::Instance::PrefEnabled",
Exposed=(Window, DedicatedWorker), SecureContext]
interface WGSLLanguageFeatures {
readonly setlike<DOMString>;
};
[Func="mozilla::webgpu::Instance::PrefEnabled",
Exposed=(Window, DedicatedWorker), SecureContext]
interface GPUAdapterInfo {
@ -98,7 +92,6 @@ interface GPU {
[Throws]
Promise<GPUAdapter?> requestAdapter(optional GPURequestAdapterOptions options = {});
GPUTextureFormat getPreferredCanvasFormat();
[SameObject] readonly attribute WGSLLanguageFeatures wgslLanguageFeatures;
};
dictionary GPURequestAdapterOptions {