Граф коммитов

908 Коммитов

Автор SHA1 Сообщение Дата
Wes Kocher 05c4aba599 Merge m-c to autoland, a=merge CLOSED TREE
MozReview-Commit-ID: 2dRRh6JLTIL
2017-09-11 15:21:36 -07:00
Andrew McCreight f89c72edb7 Bug 1377587, part 2 - Rename ExposedPropertiesOnly to OpaqueWithSilentFailing. r=krizsa
This class doesn't have anything to do with __exposedProps__ any more,
so give it a more descriptive name. We'd still like to remove it
entirely eventually.

MozReview-Commit-ID: 87KCpG6f8rI

--HG--
extra : rebase_source : 98a51a6af0fc8446dbcd8efa083d6c79286279d3
2017-09-07 11:17:16 -07:00
Andrew McCreight 2b68b38709 Bug 1377587, part 1 - Always act like __exposedProps__ is missing. r=krizsa
This patch gently removes support for __exposedProps__ by changing
ExposedPropertiesOnly::check() to always return false, while still
failing silently in deny for some kinds of access.

The tests that I changed all involve testing the behavior with
__exposedProps__. I adjusted them to expect it to fail, or to adjust
the error message they get when they fail. That seemed better than
deleting them entirely.

Note that test_bug1065185.html had a bug, so that it never executed
the first case. I fixed that, and then fixed up the test to work when
__exposedProps__ is not supported.

This also removes various bits of the test framework that use
__exposedProps__, but don't actually need to.

MozReview-Commit-ID: 8fvkAmITmXY

--HG--
extra : rebase_source : ef7e2c55adc12511f17f3865ebb46c343875f0b3
2017-08-22 14:24:11 -07:00
Jason Orendorff d438b03787 Bug 1363200 - JSAPI for realms: Clone hasInterposition bit from the scope to the CompartmentPrivate. r=mrbkap
The entire purpose of this patch is to support accessing this bit from
WrapperFactory (see the last hunk) without going through a particular
scope.

--HG--
extra : rebase_source : d2952e981f4b277e6ca565077c6e6d18c69c8df5
2017-06-27 11:06:42 -07:00
Kris Maglione e8446ea313 Bug 1396570: Null check getter/setter when JSPROP_GETTER/JSPROP_SETTER is set. r=bholley f=jandem
These flags don't guarantee that the getter and setter functions are defined.

MozReview-Commit-ID: GBcoRYoKHqL

--HG--
extra : rebase_source : 1234ec91cf05566a3130360b152bf2cb986ec1c3
2017-09-04 17:27:31 -07:00
Boris Zbarsky c395dbb95d Bug 1394598. Stop using a belt-and-suspenders opaque wrapper for eval and Function when they're being exposed by SpecialPowers. r=bholley 2017-09-01 16:30:57 -04:00
Jan de Mooij bc31f1ee31 Bug 1394835 part 1 - Spit JS_DefineProperty* APIs in separate data/accessor overloads. r=evilpie,bz 2017-08-30 15:35:06 +02:00
Jan de Mooij a5de55dced Bug 1389510 part 3 - Remove getProperty/setProperty hooks from ClassOps. r=evilpie 2017-08-25 10:12:16 +02:00
Jason Orendorff b3552cd3fb Bug 1363200 - JSAPI for realms: Move SetAddonCallInterposition to the CompartmentPrivate. r=bholley
--HG--
extra : rebase_source : d34087913dd18aeaf8908f4391bed14d0c6790f3
2017-06-27 08:07:27 -07:00
Jim Blandy dcfc353eae Bug 1383161 - Return a dead wrapper when asked to wrap a dead WindowProxy object. r=kmag 2017-07-28 15:16:21 -07:00
Nicholas Nethercote 53662318c9 Bug 1381727 (part 1) - Remove JS_smprintf_free(). r=sfink.
Because it's just a wrapper for js_free().

Furthermore, JS_smprintf() and friends return a JS::UniqueChars, which is also
wired up to free with js_free(). So having the indirection via
JS_smprintf_free() obfuscates things.

--HG--
extra : rebase_source : 1db80199dc801a2684fffe2a5fd5349a42c6941b
2017-07-25 09:09:23 +10:00
Brian Hackett a2b14f72a0 Bug 1355109 - Add IC for property reads on xrays, r=jandem,bz.
--HG--
extra : rebase_source : bc62ebf7f9c6fc006e95ede93087370ad7120303
2017-07-21 07:49:53 -07:00
Boris Zbarsky 58c5f32380 Bug 1381408. Make cross-origin-exposed non-symbol properties enumerable. r=bholley
The list of exposed properties can be gotten via
Object.getOwnPropertyNames/Symbols already, so there's nothing to be won from
the non-enumerability.

The web platform test changes are backports of
https://github.com/w3c/web-platform-tests/pull/6538 and
https://github.com/w3c/web-platform-tests/pull/6571 and
https://github.com/w3c/web-platform-tests/pull/6583

The js/xpconnect/tests/mochitest/*crossOriginObject* tests being removed are
just older versions of the web platfrom test.
2017-07-19 11:47:39 -04:00
Ting-Yu Chou 1b9d7682c6 Bug 1377815 - Remove redundant unwrapping in resolveOwnProperty() of XrayTraits and its subclasses. r=bholley
Removing the redundant unwrapping improves ~15% for the micro benchmark (bug
1348095 comment 3) on my desktop. Replace the parameter jsWrapper of
resolveOwnProperty() because it is not used.

MozReview-Commit-ID: ULHX8vyMrZ

--HG--
extra : rebase_source : b76e688f53722cfd24466668b68043366f25e917
2017-07-03 09:44:46 +08:00
Jan de Mooij 53de04c6f6 Bug 1375505 part 1 - Change iterator code to return JSObject* instead of returning bool + outparam. r=evilpie 2017-06-28 21:00:43 -07:00
Nicholas Nethercote 58786e1ea7 Bug 1375392 - Tweak the PROFILER_LABEL* macros. r=mstange.
This patch makes the following changes to the macros.

- Removes PROFILER_LABEL_FUNC. It's only suitable for use in functions outside
  classes, due to PROFILER_FUNCTION_NAME not getting class names, and it was
  mostly misused.

- Removes PROFILER_FUNCTION_NAME. It's no longer used, and __func__ is
  universally available now anyway.

- Combines the first two string literal arguments of PROFILER_LABEL and
  PROFILER_LABEL_DYNAMIC into a single argument. There was no good reason for
  them to be separate, and it forced a '::' in the label, which isn't always
  appropriate. Also, the meaning of the "name_space" argument was interpreted
  in an interesting variety of ways.

- Adds an "AUTO_" prefix to PROFILER_LABEL and PROFILER_LABEL_DYNAMIC, to make
  it clearer they construct RAII objects rather than just being function calls.
  (I myself have screwed up the scoping because of this in the past.)

- Fills in the 'js::ProfileEntry::Category::' qualifier within the macro, so
  the caller doesn't need to. This makes a *lot* more of the uses fit onto a
  single line.

The patch also makes the following changes to the macro uses (beyond those
required by the changes described above).

- Fixes a bunch of labels that had gotten out of sync with the name of the
  class and/or function that encloses them.

- Removes a useless PROFILER_LABEL use within a trivial scope in
  EventStateManager::DispatchMouseOrPointerEvent(). It clearly wasn't serving
  any useful purpose. It also serves as extra evidence that the AUTO_ prefix is
  a good idea.

- Tweaks DecodePool::SyncRunIf{Preferred,Possible} so that the labelling is
  done within them, instead of at their callsites, because that's a more
  standard way of doing things.

--HG--
extra : rebase_source : 318d1bc6fc1425a94aacbf489dd46e4f83211de4
2017-06-22 17:08:53 +10:00
Kris Maglione 9c02fdf113 Bug 1363301: Always provide live wrappers for ScriptSourceObjects. r=shu,bholley
MozReview-Commit-ID: LTNN66FywU4

--HG--
extra : rebase_source : 6fc6bd6077229fe511b02116b9e3f9eb1c99f2fa
2017-06-14 15:38:59 -07:00
Jan de Mooij 83f290de99 Bug 1370608 part 1 - Move newEnumerate hook from ObjectOps to ClassOps. r=evilpie,bz 2017-06-14 10:37:44 +02:00
Ting-Yu Chou 2ac7ffc557 Bug 1363963 - Check whether there are expando object attached before trying to retrieve it. r=bholley
In most cases no expando object has ever been attached, we don't need to do a
lot of things and realize it in the last minute.

MozReview-Commit-ID: 5u9ivZQj5L8

--HG--
extra : rebase_source : 71405f978a7c832a6694206bf0410debe596967c
2017-05-26 10:04:40 +08:00
Kris Maglione d82e509e37 Bug 1354733: Part 2 - Never rewrap dead wrappers. r=bholley
MozReview-Commit-ID: 2oSGtKe9pkI

--HG--
extra : rebase_source : 48fb1050ebfdf6e3c6f16cda13842b3e1eb4eb06
2017-05-20 11:51:05 -07:00
Kris Maglione 6960f047b8 Bug 1354733: Part 1 - Allow creating DeadObjectProxies directly. r=till
MozReview-Commit-ID: HnFgiRcA7l5

--HG--
extra : rebase_source : 0337ac2451f3a72ef3feae1d05fbf426fec21d4f
2017-05-20 11:54:51 -07:00
Jan de Mooij f480e9ecdf Bug 1237504 - Refactor proxy slot layout to allow proxies to have more than 2 slots. r=bz,jonco
The patch makes the following proxy changes:

* The number of slots in ProxyValueArray is now dynamic and depends on the number of reserved slots we get from the Class.
* "Extra slots" was renamed to "Reserved slots" to make this clearer.
* All proxy Classes now have 2 reserved slots, but it should be easy to change that for proxy Classes that need more than 2 slots.
* Proxies now store a pointer to these slots and this means GetReservedSlot and SetReservedSlot can be used on proxies as well. We no longer need GetReservedOrProxyPrivateSlot and SetReservedOrProxyPrivateSlot.

And some changes to make DOM Proxies work with this:

* We now store the C++ object in the first reserved slot (DOM_OBJECT_SLOT) instead of in the proxy's private slot. This is pretty nice because it matches what we do for non-proxy DOM objects.
* We now store the expando in the proxy's private slot so I removed GetDOMProxyExpandoSlot and changed the IC code to get the expando from the private slot instead.
2017-04-28 14:12:28 +02:00
Bill McCloskey 3e774f9f8a Bug 1359245 - Eliminate nsXPConnect::GetContextInstance() (r=mccr8)
This method assumes there is one global XPCJSContext. This patch eliminates
uses of it.

MozReview-Commit-ID: L2AkBGh5TnC
2017-04-27 15:34:46 -07:00
Andrew McCreight fe0bcc3a40 Bug 1338272 - Require that the return value of MaybeSetPendingException is used. r=bz
Most of the time, the return value of this method should be checked,
because behavior should depend on whether or not an exception is
thrown. However, if it is called immediately after a throw it doesn't
need to be checked because it will always return true. bz said there
is no public API that lets you assume there is an exception because it
would be "too easy to misuse".

MozReview-Commit-ID: CqyicBbcNjW

--HG--
extra : rebase_source : a5b74ba88a927a90d491ceb8f0b750a67f62b0f4
2017-02-14 16:17:02 -08:00
Bill McCloskey 172e502215 Revert "Bug 1340719 - Throw an exception if accessing Xray from wrong docgroup (r=bholley)"
This reverts commit ff10f4faedd42f13ed2899cf4ea05c47411aba95.
2017-04-07 14:23:06 -07:00
Bill McCloskey fcdb251c4b Bug 1340719 - Throw an exception if accessing Xray from wrong docgroup (r=bholley)
MozReview-Commit-ID: BBrRsk3KvGb
2017-04-05 13:26:20 -07:00
Jon Coppeard 0c82b7b16d Bug 1322539 - Call ExposeObjectToActiveJS on the targets of xray wrappers r=sfink 2017-03-29 10:53:12 +01:00
Boris Zbarsky e786ca31c0 Bug 1348095 part 3. Cache the proto of an Xray on its holder, so we don't have to keep re-wrapping it. r=bholley
MozReview-Commit-ID: I78AoSB3TNW
2017-03-23 03:06:25 -04:00
Boris Zbarsky e2c99615af Bug 1348095 part 2. Give all the Xray holders a JSClass that has a slot for caching a prototype. r=bholley
MozReview-Commit-ID: ID9vMG3iJfZ
2017-03-23 03:06:25 -04:00
Boris Zbarsky ab35f8679e Bug 1348095 part 1. Remove the unused reserved slots from the XPCWN xray holder. r=bholley
MozReview-Commit-ID: 5IRrE8EmL9A
2017-03-23 03:06:25 -04:00
Carsten "Tomcat" Book 69710f6637 Backed out changeset 60471d1feaa4 (bug 1348095) for bustage 2017-03-23 08:46:07 +01:00
Carsten "Tomcat" Book 601d56a765 Backed out changeset 3efe3c6f4e7f (bug 1348095) 2017-03-23 08:45:48 +01:00
Carsten "Tomcat" Book aa7af8949a Backed out changeset 8ba41a1bd062 (bug 1348095) 2017-03-23 08:45:45 +01:00
Boris Zbarsky 0660340117 Bug 1348095 part 3. Cache the proto of an Xray on its holder, so we don't have to keep re-wrapping it. r=bholley
MozReview-Commit-ID: I78AoSB3TNW
2017-03-23 03:06:25 -04:00
Boris Zbarsky ad63ed3278 Bug 1348095 part 2. Give all the Xray holders a JSClass that has a slot for caching a prototype. r=bholley
MozReview-Commit-ID: ID9vMG3iJfZ
2017-03-23 03:06:25 -04:00
Boris Zbarsky 0341ce9cc9 Bug 1348095 part 1. Remove the unused reserved slots from the XPCWN xray holder. r=bholley
MozReview-Commit-ID: 5IRrE8EmL9A
2017-03-23 03:06:25 -04:00
Boris Zbarsky c63be1e971 Bug 1347706. Update to spec change for [[SetPrototypeOf]] on cross-origin objects. It should return true if null is passed. r=bholley
MozReview-Commit-ID: 42je5yfBRee
2017-03-16 17:43:49 -04:00
Boris Zbarsky 2ab128503c Bug 1344443. Fix [[SetPrototypeOf]] on cross-origin objects to follow the spec. r=bholley,waldo
MozReview-Commit-ID: JI9fbQTS0PS
2017-03-08 03:14:38 -05:00
Ehsan Akhgari df3bce859e Bug 1344974 - Part 3: Speed up principal access checks in WrapperFactory::Rewrap() by eliminating virtual dispatch and inling; r=bholley 2017-03-07 00:29:44 -05:00
Jon Coppeard 82cbd987a2 Bug 1338623 - Add a slower but more exact gray marking check for checking correctness r=sfink r=mccr8 2017-03-02 10:22:47 +00:00
Ehsan Akhgari 4f4a529bd2 Bug 1342719 - Optimize away a virtual function call in AccessCheck::isChrome; r=bholley 2017-02-27 09:39:50 -05:00
Olli Pettay 66be2f31cc Bug 1342244, try to avoid extra CompartmentPrivate::Get calls during Rewrap, r=bholley
--HG--
extra : rebase_source : 951f392a2d19a509ce951213686684cc326f4895
2017-02-24 15:03:38 +02:00
Kris Maglione d1e03c1b46 Bug 1322273: Return DeadObjectProxy when wrapping for nuked compartment. r=bholley
MozReview-Commit-ID: V07P0eZvKO

--HG--
extra : rebase_source : 822441921b2b0a968a7dec5a532bba5535cb871b
extra : absorb_source : dd03f3197d5a4c09d228c2168726f9ae2408a7bb
extra : source : e74563742aafb580f88ef17f2121dd385e37755a
2017-02-22 19:11:52 -08:00
Sylvestre Ledru 27e7b32872 Bug 1338086 - Remove useless else blocks in order to reduce complexity in js/ r=bbouvier
MozReview-Commit-ID: Giwp0K1YoBH

--HG--
extra : rebase_source : e557ce010d00b1d6986229ab8a880c196d4162c1
2017-02-14 15:50:56 +01:00
Jan de Mooij 447fa1b7be Bug 1338880 - Optimize WrapperFactory::Rewrap a bit by avoiding GetXrayType/IsContentXBLScope calls in the non-xray case. r=bholley 2017-02-12 22:45:25 +01:00
Tooru Fujisawa 33a302accc Bug 1320408 - Part 22: Remove JSContext* parameter from ProxyObject::renew and Wrapper::Renew. r=jandem 2017-02-08 23:04:57 +09:00
Tim Huang 72200b06f7 Bug 1319773 - Part 3: Making the WrapperFactory ignores the First Party Domain of the originAttributes when rewrapping the wrapper. r=mrbkap
--HG--
extra : rebase_source : 6013d2b7386f907af761098d006949ba07c163d7
2017-01-18 20:34:31 +08:00
Boris Zbarsky 0041276515 Bug 1335654 part 4. Fix some CrossOriginXrayWrapper error reporting bits to follow the HTML spec for cross-origin objects. r=bholley 2017-02-02 12:48:49 -05:00
Boris Zbarsky bcc1d4ab44 Bug 1335654 part 3. Implement actually throwing a SecurityError when cross-origin property accesses are denied. r=bholley 2017-02-02 12:48:49 -05:00
Boris Zbarsky 72ca8d1730 Bug 1335654 part 2. Change the deny() methods of our wrapper security policies to take a JSContext and a mayThrow boolean. r=bholley 2017-02-02 12:48:49 -05:00