Changing isEvalAllowed to default to false in nightly builds.
As a ride-along, we adjust how we get the script filename
for telemetry, to get better results.
Differential Revision: https://phabricator.services.mozilla.com/D72644
The cast in InitWithNode is wrong. AsElement() asserts instead of
checking the flag, so we always pass an element (and if we didn't we'd
have type confusion problems). I audited the callers and we're fine.
Anyhow, always require an element, and add two convenience constructors
for C++ code.
Differential Revision: https://phabricator.services.mozilla.com/D73636
The cast in InitWithNode is wrong. AsElement() asserts instead of
checking the flag, so we always pass an element (and if we didn't we'd
have type confusion problems). I audited the callers and we're fine.
Anyhow, always require an element, and add two convenience constructors
for C++ code.
Differential Revision: https://phabricator.services.mozilla.com/D73636
There are various times when it would be useful to get the toplevel or parent
WindowContext from a window or browsing context. While this is already possible,
it's currently somewhat inconvenient.
Differential Revision: https://phabricator.services.mozilla.com/D73500
We set opener policy from the channel of the new document when creating a
WindowGlobalChild. However, we need to check if it's crossOriginIsolated even
when the WindowGlobalChild hasn't been created for the new inner window in some
cases.
To avoid checking the unset value of opener policy from the BrowsingContext,
this patch moves the setting the opener policy right before creating a native
global for a new inner window. So that the value of opener policy should always
be correct when validating it (IsSharedMemoryAllowed).
Differential Revision: https://phabricator.services.mozilla.com/D71534
CondVar already calls `AUTO_PROFILER_THREAD_SLEEP`, which shouldn't be called recursively.
mozilla::Monitor also uses CondVar, so it shouldn't be surrounded by `AUTO_PROFILER_THREAD_SLEEP` either.
Depends on D72850
Differential Revision: https://phabricator.services.mozilla.com/D72851
Previously the BrowsingContext was also being sent down, despite it being
obvious from the PBrowserBridge actor which the message was sent over.
Differential Revision: https://phabricator.services.mozilla.com/D72929
- Add new data member StyleSheet::mParentObject
- Clone Sheets before adding them to nsXULPrototypeCache
- Return mParentObject from GetParentObject if non-null
Differential Revision: https://phabricator.services.mozilla.com/D72725
Initially, IPCInternal{Request,Response} had contained IPCStreams which would
result in unecessary copying when sending the objects over IPC. The patch
makes these streams either:
1) ParentToParentStream (just a UUID)
2) ParentToChildStream (a PIPCBlobInputStream actor, acting as a handle)
3) ChildToParentStream (a real IPCStream)
These three types are union-ed together by the BodyStreamVariant IPDL structure.
This structure replaces the IPCStream members in IPCInternal{Request,Response}
so that, depending on the particular IPDL protocol, we can avoid cloning streams
and just pass handles/IDs instead.
As a side effect, this makes file-backed Response objects cloneable. Initially,
these Responses would be backed by an nsFileInputStream, which is not cloneable
outside the parent process. They are now backed by IPCBlobInputStreams, which
are cloneable.
One thing that's not really satisfactory (IMO), is the manual management of
IPCBlobInputStreamStorage so that no streams are leaked, e.g. if we store a
stream in the IPCBlobInputStreamStorage but fail to send an IPC message and
therefore fail to remove the stream from storage on the other side of the IPC
boundary (only parent-to-parent in this case).
Differential Revision: https://phabricator.services.mozilla.com/D73173
This provides web compatability with Chrome's interpretation of the spec at
https://drafts.csswg.org/css-device-adapt/#user-zoom-desc. This changes makes
us treat "the user cannot interactively change the zoom factor" as inclusive
of ANY method of the user agent changing zoom levels, regardless of whether or
not the user initiated an action.
So, in addition to preventing things like double-tap-to-zoom and pinch-zoom,
this change prevents zoom changes to fit all content into the viewport, or to
maintain visible content proportionality if the viewport is resized dynamically.
This also adds an assert to cases where Document::GetViewportInfo returns a
viewport with a non-positive scale factor that it also sets the auto scale
flag.
This also adds a tentative web-platform test.
Differential Revision: https://phabricator.services.mozilla.com/D72004
Adds IpdlQueue capability to PWebGL actors. The WebGLChild, used in content processes, implements SyncProducerActor and AsyncConsumerActor because it sends (sync and async) messages and receives responses to them that it reads as async messages. The WebGLParent, used in the compositor process, is a SyncConsumerActor and AsyncProducerActor for dual reasons.
Differential Revision: https://phabricator.services.mozilla.com/D68264
The IpdlQueue (de)serializes types into arrays that are then passed to another process via IPDL messages. This means much less bloat than generating IPDL routines for each of the commands we send with WebGL. This IPDL queue is fairly basic -- it simply sends "async" commands through an async IPDL message and sync commands through a sync message. Future extensions, such as a facility for buffering async messages to be sent in bulk, are planned.
The IpdlQueue uses an existing actor to send messages. That actor should derive from one of the provided base classes and implement any needed IPDL message. For example, if the actor is used as the comsumer for sync messages then it should subclass SyncConsumerActor and should Recv (via IPDL) the ExchangeIpdlQueueData message -- the handler method for which is defined in the SyncProducerActor base class.
Differential Revision: https://phabricator.services.mozilla.com/D68263
We need to separate WebGL actor construction and initialization since IpdlQueue initialization needs the actor to already exist.
Differential Revision: https://phabricator.services.mozilla.com/D68262
Move QueueParamTraits, which are common between PCQ and IpdlQueue, to a file they both include. This also changes the namespace of a handful of the classes, like the Marshaller.
Differential Revision: https://phabricator.services.mozilla.com/D68260
* Templatize ProducerView/ConsumerView/(Sync)CommandSource/(Sync)CommandSink to allow both Pcq and Ipdl versions, as the client code is identical.
* Rename Producer/Consumer -> PcqProducer/PcqConsumer.
Differential Revision: https://phabricator.services.mozilla.com/D68259
* Remove CommandSink from WebGLMethodDispatcher. The parameter is unneeded.
* Make MethodDispatcher code simpler. This removes a layer of complexity (CommandDispatchDriver) involved in finding the correct method for a given ID number.
* Require WebGL methods whose signatures don't allow them to be remoted to directly call on the host object. They are: ReadPixels, GetVRFrame, GetInternalFormatParameter, GetBufferSubData, GetLinkResult and TexImage.
* Fix a bunch of compilation issues with busted PcqParamTraits.
* implement PcqParamTraits for some missing types
Differential Revision: https://phabricator.services.mozilla.com/D68257
A lot of simple changes to prepare for later patches in the series:
* PcqCommand -> QueueCommand, PcqStatus -> QueueStatus, PcqParamTraits -> QueueParamTraits
* Consolidate BasicSink/Source into CommandSink/Source
* SyncCommandSource::mConsumer -> mResponseSink, SyncCommandSink::mProducer -> mResponseSource, CommandSource::mProducer -> mSource, CommandSink::mConsumer -> mSink
* Rename WebGLPcqParamTraits.h to WebGLQueueParamTraits.h
* ProducerConsumerQueue struct -> class.
* ProducerConsumerQueue::mProducer/mConsumer access -> ProducerConsumerQueue::TakeProducer/TakeConsumer
* Rename QueueStatus enum elements to follow style convention.
* Rename Status() to GetStatus() in ProducerView and ConsumerView to appease Linux.
* Rename CommandResult enum values to fit convention (and avoid Linux conflict with Success).
Differential Revision: https://phabricator.services.mozilla.com/D68256
This also allows us to remove JSID_FROM_BITS and gives us stronger assertions everywhere for the whack integer-string case.
Differential Revision: https://phabricator.services.mozilla.com/D72564
I am honstely still not convinced that this function should actually exists.
It seems like a convulted way of saying AtomToId, while also asserting that the atom is pinned.
Differential Revision: https://phabricator.services.mozilla.com/D72563
After the recent simplifications to the zoom code, they only take care
of forwarding the enlarge / decrease zoom messages.
We can do that via PBrowser instead, and get rid of the actors. We can
also remove ZoomChangeUsingMouseWheel. Zooming with the mouse wheel will
end up in a *ZoomChange event anyways, and the only consumer already
listened for them.
Differential Revision: https://phabricator.services.mozilla.com/D73175
We can reduce the size of the SSO by removing the element slot entirely, and instead retrieve the element through a callback function. The callback will take in the value in the private slot of the SSO, which is either a LoadedScript* (from the browser) or a JSObject* (from the shell). In addition, this removes the requirement of having a script dom element ready when parsing a JS script which can open up new opportunities for performance.
Differential Revision: https://phabricator.services.mozilla.com/D70417
This requires adding a new JSOptions field (for internal use within the shell),
as well as a new browser pref (to support possible Cranelift benchmarking on
aarch64).
Differential Revision: https://phabricator.services.mozilla.com/D72907
Even in comm-central and BlueGriffon, `nsISelectionController::*ForDelete()`
are not used. Therefore, we can remove them safely.
Differential Revision: https://phabricator.services.mozilla.com/D72296
In Document::HasStorageAccess(), we try to get the top-level document.
To check if the document is first-party to the top-level document. But,
this won't work for Fission since the top-level document could be
out-of-process.
In this patch, we use broswing context to get the top-level principal to
test if the document is thrid-party. If we cannot get the top-level
outer window, the top-level document should be cross-origin. So, we know
the answer. If the top-level document is available, we check the
principal to see if the document is first-party.
Differential Revision: https://phabricator.services.mozilla.com/D72664
This adds a splits the non-incremental threshold parameter into one for small heaps and one for large. What counts as large and small are controlled by the existing parameters that were previously used for dynamic heap growth. I also renamed the parameter from "non-incremental threshold" to "incremental limit".
The small heap parameter is increased to 1.4. This avoids non-incremental GC on facebook and reddit as reported in the dependent bugs and allows us to remove the splay latency hack that was previously necessary.
Differential Revision: https://phabricator.services.mozilla.com/D72903