Bug 1882660 [wpt PR 44844] - IDB: Consolidate previously extended WPT files into...
[gecko.git] / dom / webgpu / ObjectModel.cpp
blob9e8bddc5ef59dfbb3e4195453e856bc9fc50110b
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"
8 #include "Adapter.h"
9 #include "ShaderModule.h"
10 #include "CompilationInfo.h"
11 #include "Device.h"
12 #include "CommandEncoder.h"
13 #include "Instance.h"
14 #include "Texture.h"
15 #include "nsIGlobalObject.h"
17 namespace mozilla::webgpu {
19 template <typename T>
20 ChildOf<T>::ChildOf(T* const parent) : mParent(parent) {}
22 template <typename T>
23 ChildOf<T>::~ChildOf() = default;
25 template <typename T>
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