mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1824515 - Make js/xpconnect/loader/ buildable outside of a unified build environment r=andi
Differential Revision: https://phabricator.services.mozilla.com/D173615
This commit is contained in:
parent
dd9aff0466
commit
c327880929
@ -65,7 +65,7 @@ already_AddRefed<ModuleLoadRequest> ComponentModuleLoader::CreateStaticImport(
|
||||
nsIURI* aURI, ModuleLoadRequest* aParent) {
|
||||
RefPtr<ComponentLoadContext> context = new ComponentLoadContext();
|
||||
RefPtr<ModuleLoadRequest> request = new ModuleLoadRequest(
|
||||
aURI, aParent->mFetchOptions, SRIMetadata(), aParent->mURI, context,
|
||||
aURI, aParent->mFetchOptions, dom::SRIMetadata(), aParent->mURI, context,
|
||||
false, /* is top level */
|
||||
false, /* is dynamic import */
|
||||
this, aParent->mVisitedSet, aParent->GetRootModule());
|
||||
@ -99,7 +99,7 @@ nsresult ComponentModuleLoader::StartFetch(ModuleLoadRequest* aRequest) {
|
||||
}
|
||||
|
||||
JSContext* cx = jsapi.cx();
|
||||
RootedScript script(cx);
|
||||
JS::RootedScript script(cx);
|
||||
nsresult rv =
|
||||
mozJSModuleLoader::LoadSingleModuleScript(this, cx, aRequest, &script);
|
||||
MOZ_ASSERT_IF(jsapi.HasException(), NS_FAILED(rv));
|
||||
|
@ -141,7 +141,7 @@ JSObject* ResolveModuleObjectProperty(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aModObj,
|
||||
const char* aName) {
|
||||
if (JS_HasExtensibleLexicalEnvironment(aModObj)) {
|
||||
RootedObject lexical(aCx, JS_ExtensibleLexicalEnvironment(aModObj));
|
||||
JS::RootedObject lexical(aCx, JS_ExtensibleLexicalEnvironment(aModObj));
|
||||
bool found;
|
||||
if (!JS_HasOwnProperty(aCx, lexical, aName, &found)) {
|
||||
return nullptr;
|
||||
|
@ -23,6 +23,8 @@
|
||||
#include "js/TypeDecls.h" // JSContext, JSObject, JS::MutableHandleVector
|
||||
#include "js/Value.h" // JS::Value
|
||||
#include "js/friend/ErrorMessages.h" // JSMSG_*
|
||||
#include "js/String.h"
|
||||
#include "js/Modules.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace loader {
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "mozilla/Vector.h"
|
||||
#include "mozilla/Result.h"
|
||||
#include "mozilla/loader/AutoMemMap.h"
|
||||
#include "MainThreadUtils.h"
|
||||
#include "nsClassHashtable.h"
|
||||
#include "nsIAsyncShutdown.h"
|
||||
#include "nsIFile.h"
|
||||
|
@ -64,5 +64,3 @@ LOCAL_INCLUDES += [
|
||||
]
|
||||
|
||||
include("/ipc/chromium/chromium-config.mozbuild")
|
||||
|
||||
REQUIRES_UNIFIED_BUILD = True
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "js/experimental/JSStencil.h"
|
||||
|
||||
#include "mozilla/BasePrincipal.h"
|
||||
#include "mozilla/Span.h"
|
||||
|
||||
using namespace JS;
|
||||
using namespace mozilla::scache;
|
||||
@ -47,7 +48,7 @@ nsresult ReadCachedStencil(StartupCache* cache, nsACString& cachePath,
|
||||
return rv; // don't warn since NOT_AVAILABLE is an ok error
|
||||
}
|
||||
|
||||
JS::TranscodeRange range(AsBytes(Span(buf, len)));
|
||||
JS::TranscodeRange range(AsBytes(mozilla::Span(buf, len)));
|
||||
JS::TranscodeResult code = JS::DecodeStencil(cx, options, range, stencilOut);
|
||||
return HandleTranscodeResult(cx, code);
|
||||
}
|
||||
@ -66,7 +67,7 @@ nsresult WriteCachedStencil(StartupCache* cache, nsACString& cachePath,
|
||||
}
|
||||
|
||||
// Move the vector buffer into a unique pointer buffer.
|
||||
UniqueFreePtr<char[]> buf(
|
||||
mozilla::UniqueFreePtr<char[]> buf(
|
||||
reinterpret_cast<char*>(buffer.extractOrCopyRawBuffer()));
|
||||
nsresult rv = cache->PutBuffer(PromiseFlatCString(cachePath).get(),
|
||||
std::move(buf), size);
|
||||
|
Loading…
Reference in New Issue
Block a user