A bunch of loop-detection, etc, complexity goes away because mixins are not
interfaces and the mixin syntax does not allow various things we had to guard
against in terms of maplikes and whatnot.
Differential Revision: https://phabricator.services.mozilla.com/D46524
--HG--
extra : moz-landing-system : lando
Cross-origin objects are supposed to have null prototypes, and throw when
attempting to set the prototype to any value other than null. Ordinary
cross-origin objects handle this correctly. RemoteObjectProxy has hooks which
are meant to give them the same behavior, but which are never actually
triggered, because the proxy objects are missing the required lazy prototype
flags.
Simply using the built-in prototype slot and setting it to immutable triggers
the desired behavior with much less implementation overhead.
Differential Revision: https://phabricator.services.mozilla.com/D46735
--HG--
extra : moz-landing-system : lando
Object.hasOwnProperty called on a cross-origin object needs to return true for
any property returned by its property enumerator or get hook, and throw a
security error for anything else. Ordinary cross-origin objects currently
behave correctly, but RemoteObjectProxy objects return false for indexed
frame getters, and never throw security exceptions for inaccessible
properties.
This patch fixes both of those issues by removing the `hasOwn` hook and
falling back to the BaseProxyHandler implementation, which defers to the
`getOwnPropertyDescriptor` hook. This is slightly more expensive, since it
requires reifying property descriptors for every check, but it should be a
relatively uncommon operation on cross-origin objects, and should not be
particularly expensive for any properties of a RemoteObjectProxy.
Differential Revision: https://phabricator.services.mozilla.com/D46734
--HG--
extra : moz-landing-system : lando
We support calling WebIDL prototype methods on cross-compartment objects as
long as they're same-type and same-origin. Any attempt to call them on
cross-origin wrappers with security policies leads to a security error.
Remote object proxies look and behave like cross-origin objects, but are not
technically wrappers. This means that for non-cross-origin-accessible
method/getter calls, we just treat them as same-origin objects which do not
implement the correct interface. Aside from being confusing, this makes it
easy for web content to distinguish between remote and in-process objects with
the same interface, which they generally should not be able to do.
Treating remote object proxies as if they were opaque wrappers solves these
problems.
Differential Revision: https://phabricator.services.mozilla.com/D46495
--HG--
extra : moz-landing-system : lando
We can remove this once [PrimaryGlobal] goes away, but for now we need to not
have this issue, which actually bit me when converting NavigatorLanguage to a
mixin.
Differential Revision: https://phabricator.services.mozilla.com/D46510
--HG--
extra : moz-landing-system : lando
The changes to the return type of MerchantValidationEvent::init are because
Result doesn't allow having an ErrorResult (or any other type without a copy
constructor) as its error type. Plus we would have had the impedance mismatch
between Result<Ok, nsresult> (which is what URL resolution on the document
returns) and Result<Ok, ErrorResult> anyway.
Differential Revision: https://phabricator.services.mozilla.com/D46461
--HG--
extra : moz-landing-system : lando
It doesn't really make sense to enforce this behavior for calls on stack
variables (which presumably we then want to do something with) and doesn't
necessarily make sense to enforce it for member variables either.
Differential Revision: https://phabricator.services.mozilla.com/D46105
--HG--
extra : moz-landing-system : lando
The grammar changes parallel those in https://github.com/heycam/webidl/pull/700
We don't prevent having both a constructor operation and [Constructor] or
[ChromeConstructor], because those extended attributes are about to get
removed, once they are no longer used in our IDL.
Differential Revision: https://phabricator.services.mozilla.com/D45387
--HG--
extra : moz-landing-system : lando
Right now, we end up with the forward declaration of
nsIDOMWindowProxy, which does not exist, instead of the proper type.
Differential Revision: https://phabricator.services.mozilla.com/D45516
--HG--
extra : moz-landing-system : lando
This is so that SetUseCounter is as cheap as possible.
This is in preparation for hooking the CSS use counters to telemetry. We want
CSS use counters to be fast and be propagated at once to the parent page. This
will make sure to use the same setup as everywhere else.
Differential Revision: https://phabricator.services.mozilla.com/D44645
--HG--
extra : moz-landing-system : lando
This check is used to reject cross-origin objects from being passed in
as |any| or |object| parameters to WebIDL methods. Remote object
proxies are technically same-origin, but we want to make them behave
the same as when Fission is not enabled.
Differential Revision: https://phabricator.services.mozilla.com/D43105
--HG--
extra : moz-landing-system : lando
This check is used to reject cross-origin objects from being passed in
as |any| or |object| parameters to WebIDL methods. Remote object
proxies are technically same-origin, but we want to make them behave
the same as when Fission is not enabled.
Differential Revision: https://phabricator.services.mozilla.com/D43105
--HG--
extra : moz-landing-system : lando
These test that various DOM things fail when done
cross-origin. They'll fail in a different way if done cross-process,
so change the origin used so that it is same-process, but
cross-origin, even with Fission.
Differential Revision: https://phabricator.services.mozilla.com/D42678
--HG--
extra : moz-landing-system : lando
The nsAString overload of GetCallingLocation directly converts the
original source file name string into an nsAString. A number of
callers that want the source file name in an nsAString are calling the
nsACString overload of GetCallingLocation, then calling
NS_ConvertUTF8toUTF16. This results in an extra intermediate copy of
the original string data.
Differential Revision: https://phabricator.services.mozilla.com/D42727
--HG--
extra : moz-landing-system : lando
Add IDLInterfaceMixin with a new superclass shared with existing IDLInterfaceOrNamespace.
Differential Revision: https://phabricator.services.mozilla.com/D38802
--HG--
extra : moz-landing-system : lando
JSClass contained void* members corresponding to the internal pointer members of js::Class. This stores the internal members in JSClass and removes js::Class.
This leaves js::Class aliased to JSClass while we remove references to it. I also aliased Jsvalify and Valueify into global scope temporarily to make this compile. These get removed in the following patches.
I had to remove a few functions which now don't compile with js::Class being the same type as JSClass.
Differential Revision: https://phabricator.services.mozilla.com/D41983
--HG--
extra : moz-landing-system : lando
The problem is that if there is a leak at shutdown we can end up calling ClearWrapper on a wrapper that has already been cleared by the JS engine. The patch just relaxes the assertion to allow this. I tested this on try with a bunch of retriggers and it seems to fix the problem.
Differential Revision: https://phabricator.services.mozilla.com/D41938
--HG--
extra : moz-landing-system : lando
Otherwise we're computing (1ull << CHAR_BIT) * sizeof(...), which is not
quite what we wanted.
Differential Revision: https://phabricator.services.mozilla.com/D41773
--HG--
extra : moz-landing-system : lando
Merge js::FreeOp and JSFreeOp, but alias the former to the latter while we fix uses.
Differential Revision: https://phabricator.services.mozilla.com/D41410
--HG--
extra : moz-landing-system : lando
Merge js::FreeOp and JSFreeOp, but alias the former to the latter while we fix uses.
Differential Revision: https://phabricator.services.mozilla.com/D41410
--HG--
extra : moz-landing-system : lando
All .xul files have been loading as HTMLDocuments for a few weeks now, so
it should be safe to remove the XULDocument implementation.
Differential Revision: https://phabricator.services.mozilla.com/D41238
--HG--
extra : moz-landing-system : lando
`except Exception as exception` in Python 3 removes the `exception` variable in the outer scope whereas Python 2 does not. This mitigates the error caused by the Py3 behavior.
Differential Revision: https://phabricator.services.mozilla.com/D41194
--HG--
extra : moz-landing-system : lando
We could get rid of the need to specify the impl class at the callsite by
taking a T** instead of returning an already_AddRefed<T>, but I'm not sure
which is uglier...
The change from `globalHolder->GetGlobalJSObject()` to `global.Get()` is OK,
because `globalHolder` was coming from the nsISupports attached to
`global.Get()` anyway, so those are the same global JS object.
Differential Revision: https://phabricator.services.mozilla.com/D40060
--HG--
extra : moz-landing-system : lando
This requires replacing inclusions of it with inclusions of more specific prefs
files.
The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.
Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.
Differential Revision: https://phabricator.services.mozilla.com/D39138
--HG--
extra : moz-landing-system : lando
When we call GetRemoteOuterWindowProxy in the middle of a transplant,
the remote proxy that the function returns will be almost immediately
swapped with some other object. Rather than trying to fix up the
remote proxy map when that happens, this patch adds a new argument
that is a pointer to the object, if any, that the remote proxy is
going to be swapped to. This will be used in the remote proxy map.
Having a value in the remote proxy map that is not a remote proxy
could cause issues if somebody ends up calling
GetRemoteOuterWindowProxy() a second time before the transplant has
finished. To avoid that, my patch asserts that we are returning an
object with the appropriate class.
Differential Revision: https://phabricator.services.mozilla.com/D37598
--HG--
extra : moz-landing-system : lando
When we call GetRemoteOuterWindowProxy in the middle of a transplant,
the remote proxy that the function returns will be almost immediately
swapped with some other object. Rather than trying to fix up the
remote proxy map when that happens, this patch adds a new argument
that is a pointer to the object, if any, that the remote proxy is
going to be swapped to. This will be used in the remote proxy map.
Having a value in the remote proxy map that is not a remote proxy
could cause issues if somebody ends up calling
GetRemoteOuterWindowProxy() a second time before the transplant has
finished. To avoid that, my patch asserts that we are returning an
object with the appropriate class.
Differential Revision: https://phabricator.services.mozilla.com/D37598
--HG--
extra : moz-landing-system : lando
My preference was to annotate most of the failing tests with `fail-if` so that
if they start passing, the `fail-if` needs to be removed and they need to keep
passing. That doesn't work for tests that timeout, or which trigger failures
from their cleanup functions, however, so those tests need skip-if. And tests
with fail in their cleanup functions likely leave the browser in an
inconsistent state for subsequent tests, anyway, so really should be skipped
regardless.
There are some remaining tests which still fail because of crashes. I chose
not to skip them here, but to fix the crashes in separate bugs instead.
Differential Revision: https://phabricator.services.mozilla.com/D38247
--HG--
extra : rebase_source : 39ba8fec2e882cfe577c5f2b58ab7e4b461f1178
This allows us to create profiler markers whose description contains the name
of the function and its file / line number. This allows the profiler UI to
match up setTimeout callbacks for multiple instances of the same page load, in
order to create meaningful profile comparisons based on markers.
Differential Revision: https://phabricator.services.mozilla.com/D19192
--HG--
extra : moz-landing-system : lando
`= {}` can now be used to indicate that an optional dictionary should have the
default value of 'default-initialized dictionary'
Differential Revision: https://phabricator.services.mozilla.com/D36504
--HG--
extra : moz-landing-system : lando
Add [LegacyWindowAlias] extended attribute support for WebKitCSSMatrix and webkitURL.
Differential Revision: https://phabricator.services.mozilla.com/D35601
--HG--
extra : moz-landing-system : lando
`= {}` can now be used to indicate that an optional dictionary should have the
default value of 'default-initialized dictionary'
Differential Revision: https://phabricator.services.mozilla.com/D36504
--HG--
extra : moz-landing-system : lando
`= {}` can now be used to indicate that an optional dictionary should have the
default value of 'default-initialized dictionary'
Differential Revision: https://phabricator.services.mozilla.com/D36504
--HG--
extra : moz-landing-system : lando
Add [LegacyWindowAlias] extended attribute support for WebKitCSSMatrix and webkitURL.
Differential Revision: https://phabricator.services.mozilla.com/D35601
--HG--
extra : moz-landing-system : lando