nsGlobalWindowInner, WorkerGlobalScopeBase, BackstagePas and SandboxPrivate now
explicitly provide GetStorageKey implementation which explicitly block null and
expanded principals. All other globals (nsGlobalWindowOuter, SimpleGlobalObject,
ShadowRealmGlobalScope and WorkletGlobalScope) inherit the default
implementation which returns NS_ERROR_NOT_AVAILABLE.
Differential Revision: https://phabricator.services.mozilla.com/D162087
This patch starts to actually blocking opaque responses
for most type of the resources that are defined in the spec.
There are still pieces missing such as blocking JSON responses,
and this is why it's called partially implemented.
This patch was originally written by farre, and I made some
modifications based on it.
Depends on D155128
Differential Revision: https://phabricator.services.mozilla.com/D155129
The dom::MaybeWrapValue() method was calling `isObject()` rather than
`hasObjectPayload()`, causing an assertion failure when passed a value
representing an ExtendedPrimitive (record or tuple). This was causing a crash
when evaluating a record or tuple literal either in the navigation bar or
the developer console. In addition, js::ToBooleanSlow() was missing a case
for ExtendedPrimitives, which would also cause an assertion failure in the
same scenario.
For documentation, I also added explicit assertions to dom::...Wrap...()
methods defined in BindingUtils.h that aren't expected to support
ExtendedPrimitives.
I also added placeholders for pretty-printing records and tuples in the
console (fully rendering these values is left for Bug 1772157).
Depends on D156494
Differential Revision: https://phabricator.services.mozilla.com/D148062
Remove the conditional *Rooter member in the union conversion structure and switch
the regular union structure to use Rooted* for Record and Sequence that contains
js object (like what we do for Dictionary type). Codegen introudces a new type on
isMember in getJSToNativeConversionInfo() as we need to generate different conversion
code for Sequence and Record if they are union member which now use Rooted* instead
of *Rooter to root js object.
Differential Revision: https://phabricator.services.mozilla.com/D157326
Implement the common steps for the next method from
https://webidl.spec.whatwg.org/#es-asynchronous-iterator-prototype-object in
a base class, that all async iterable iterator objects inherit from. Natives
that implement an async iterable only need to implement the "getting the
next iteration result" part in their GetNextPromise method. This means they
don't have to create the object according to "CreateIterResultObject"
themselves, but can just create promise and often resolve it with a native
value directly. We've switched to a special JS::Value to signal "end of
iteration", but that's hidden inside the
iterator_utils::ResolvePromiseForFinished helper.
The WebIDL parser now uses the right return type for the generated "next"
method, which means that any exceptions in the binding code itself will
actually be correctly converted to a rejected promise instead of being
rethrown.
This also uses a class for the generated iterable iterator that's not
exposed outside the binding code. No other code should create and/or
wrap these anyway.
Differential Revision: https://phabricator.services.mozilla.com/D156323
Implement the common steps for the next method from
https://webidl.spec.whatwg.org/#es-asynchronous-iterator-prototype-object in
a base class, that all async iterable iterator objects inherit from. Natives
that implement an async iterable only need to implement the "getting the
next iteration result" part in their GetNextPromise method. This means they
don't have to create the object according to "CreateIterResultObject"
themselves, but can just create promise and often resolve it with a native
value directly. We've switched to a special JS::Value to signal "end of
iteration", but that's hidden inside the
iterator_utils::ResolvePromiseForFinished helper.
The WebIDL parser now uses the right return type for the generated "next"
method, which means that any exceptions in the binding code itself will
actually be correctly converted to a rejected promise instead of being
rethrown.
This also uses a class for the generated iterable iterator that's not
exposed outside the binding code. No other code should create and/or
wrap these anyway.
Differential Revision: https://phabricator.services.mozilla.com/D156323
One point of difference between the DoMarking fast path and other tracers is
handling the edge name. Passing this through to the concrete tracer and
handling it there removes this differemce.
Eventually we should be able to inline some of these these calls at which point
it should get optimsed away for tracers that ignore it.
Depends on D156559
Differential Revision: https://phabricator.services.mozilla.com/D156560
One point of difference between the DoMarking fast path and other tracers is
handling the edge name. Passing this through to the concrete tracer and
handling it there removes this differemce.
Eventually we should be able to inline some of these these calls at which point
it should get optimsed away for tracers that ignore it.
Depends on D156559
Differential Revision: https://phabricator.services.mozilla.com/D156560
Those will be consumed by DevTools webconsole so we can order messages
emitted within the same millisecond more precisely (see next patch in queue)
Differential Revision: https://phabricator.services.mozilla.com/D155545