1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "ObjectModel.h"
9 #include "ShaderModule.h"
10 #include "CompilationInfo.h"
12 #include "CommandEncoder.h"
15 #include "nsIGlobalObject.h"
17 namespace mozilla::webgpu
{
20 ChildOf
<T
>::ChildOf(T
* const parent
) : mParent(parent
) {}
23 ChildOf
<T
>::~ChildOf() = default;
26 nsIGlobalObject
* ChildOf
<T
>::GetParentObject() const {
27 return mParent
->GetParentObject();
30 void ObjectBase::GetLabel(nsAString
& aValue
) const { aValue
= mLabel
; }
31 void ObjectBase::SetLabel(const nsAString
& aLabel
) { mLabel
= aLabel
; }
33 template class ChildOf
<Adapter
>;
34 template class ChildOf
<ShaderModule
>;
35 template class ChildOf
<CompilationInfo
>;
36 template class ChildOf
<CommandEncoder
>;
37 template class ChildOf
<Device
>;
38 template class ChildOf
<Instance
>;
39 template class ChildOf
<Texture
>;
41 } // namespace mozilla::webgpu