Backed out changeset 046f0f522ce7 (bug 1896709) Backed out changeset 0271e50308e6 (bug 1896709) Backed out changeset 26fac760de19 (bug 1896709) Backed out changeset 6fa3424dfc40 (bug 1896709) Backed out changeset b7bcb9904435 (bug 1896709) Backed out changeset c6878c5fdde4 (bug 1896709) Backed out changeset 8ca8a4082e44 (bug 1896709) Backed out changeset 20ff83806cc6 (bug 1896709) Backed out changeset 6c9338852a19 (bug 1896709) Backed out changeset e8615b5d82ab (bug 1896709) Backed out changeset 842f2047a4bd (bug 1896709) Backed out changeset 54eea04a7342 (bug 1896709) Backed out changeset 220b544127cb (bug 1896709) Backed out changeset 52ce0ebfb29a (bug 1896709) Backed out changeset 34fc79dc1ad7 (bug 1896709) Backed out changeset 50b0f6a23e3c (bug 1896709) Backed out changeset 89c4c6bb465a (bug 1896709)
61 lines
2.0 KiB
C++
61 lines
2.0 KiB
C++
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#include "mozilla/dom/ScriptLoadContext.h"
|
|
#include "mozilla/loader/SyncModuleLoader.h"
|
|
#include "mozilla/dom/WorkerLoadContext.h"
|
|
#include "mozilla/dom/worklet/WorkletModuleLoader.h" // WorkletLoadContext
|
|
#include "js/loader/LoadContextBase.h"
|
|
#include "js/loader/ScriptLoadRequest.h"
|
|
|
|
namespace JS::loader {
|
|
|
|
////////////////////////////////////////////////////////////////
|
|
// LoadContextBase
|
|
////////////////////////////////////////////////////////////////
|
|
|
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(LoadContextBase)
|
|
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
|
NS_INTERFACE_MAP_END
|
|
|
|
NS_IMPL_CYCLE_COLLECTING_ADDREF(LoadContextBase)
|
|
NS_IMPL_CYCLE_COLLECTING_RELEASE(LoadContextBase)
|
|
|
|
NS_IMPL_CYCLE_COLLECTION(LoadContextBase, mRequest)
|
|
|
|
LoadContextBase::LoadContextBase(ContextKind kind) : mKind(kind) {}
|
|
|
|
void LoadContextBase::SetRequest(ScriptLoadRequest* aRequest) {
|
|
MOZ_ASSERT(!mRequest);
|
|
mRequest = aRequest;
|
|
}
|
|
|
|
void LoadContextBase::GetProfilerLabel(nsACString& aOutString) {
|
|
aOutString.Append("Unknown Script Element");
|
|
}
|
|
|
|
mozilla::dom::ScriptLoadContext* LoadContextBase::AsWindowContext() {
|
|
MOZ_ASSERT(IsWindowContext());
|
|
return static_cast<mozilla::dom::ScriptLoadContext*>(this);
|
|
}
|
|
|
|
mozilla::loader::SyncLoadContext* LoadContextBase::AsSyncContext() {
|
|
MOZ_ASSERT(IsSyncContext());
|
|
return static_cast<mozilla::loader::SyncLoadContext*>(this);
|
|
}
|
|
|
|
mozilla::dom::WorkerLoadContext* LoadContextBase::AsWorkerContext() {
|
|
MOZ_ASSERT(IsWorkerContext());
|
|
return static_cast<mozilla::dom::WorkerLoadContext*>(this);
|
|
}
|
|
|
|
mozilla::dom::WorkletLoadContext* LoadContextBase::AsWorkletContext() {
|
|
MOZ_ASSERT(IsWorkletContext());
|
|
return static_cast<mozilla::dom::WorkletLoadContext*>(this);
|
|
}
|
|
|
|
} // namespace JS::loader
|