mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +09:00
Issue #1442 - Part 14 - Starting body consuming and passing the JSContext down from the binding entrypoints to where the ReadableStream could be read. https://bugzilla.mozilla.org/show_bug.cgi?id=1128959
This commit is contained in:
parent
ef550b2579
commit
842b9d47b3
15 changed files with 192 additions and 77 deletions
|
|
@ -701,9 +701,14 @@ private:
|
|||
request.SetAsUSVString().Rebind(loadInfo.mFullURL.Data(),
|
||||
loadInfo.mFullURL.Length());
|
||||
|
||||
// This JSContext will not end up executing JS code because here there are
|
||||
// no ReadableStreams involved.
|
||||
AutoJSAPI jsapi;
|
||||
jsapi.Init();
|
||||
|
||||
ErrorResult error;
|
||||
RefPtr<Promise> cachePromise =
|
||||
mCacheCreator->Cache_()->Put(request, *response, error);
|
||||
mCacheCreator->Cache_()->Put(jsapi.cx(), request, *response, error);
|
||||
if (NS_WARN_IF(error.Failed())) {
|
||||
nsresult rv = error.StealNSResult();
|
||||
channel->Cancel(rv);
|
||||
|
|
@ -1668,8 +1673,13 @@ CacheScriptLoader::Load(Cache* aCache)
|
|||
|
||||
mozilla::dom::CacheQueryOptions params;
|
||||
|
||||
// This JSContext will not end up executing JS code because here there are
|
||||
// no ReadableStreams involved.
|
||||
AutoJSAPI jsapi;
|
||||
jsapi.Init();
|
||||
|
||||
ErrorResult error;
|
||||
RefPtr<Promise> promise = aCache->Match(request, params, error);
|
||||
RefPtr<Promise> promise = aCache->Match(jsapi.cx(), request, params, error);
|
||||
if (NS_WARN_IF(error.Failed())) {
|
||||
Fail(error.StealNSResult());
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue