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

623 Коммитов

Автор SHA1 Сообщение Дата
Bobby Holley 83fe833e66 Bug 987669 - Add Xray support for FooError.prototype.name. r=gabor 2014-07-11 09:09:22 -07:00
Bobby Holley d4e5d6b652 Bug 987669 - Implement Xray support for the data properties on ErrorObject instances. r=gabor 2014-07-11 09:09:21 -07:00
Bobby Holley d2fd703dac Bug 987669 - Implement IsErrorObjectKey and do more at compile-time. r=gabor 2014-07-11 09:09:21 -07:00
Chris Peterson 6f5eb4b6c9 Bug 1036778 - Replace MOZ_ASSUME_UNREACHABLE with MOZ_CRASH in js/xpconnect. r=bholley 2014-06-29 20:42:36 -07:00
Bobby Holley c6ad0230b3 Bug 1034262 - Honor the wantXrays of both sides of the membrane when computing same-origin wrappers. r=gabor
The basic problem in the testcase is that one compartment requests same-origin
Xrays via wantXrays=true (the default for Sandboxes) while the other does not.
The current code only considers the wantXrays flag of the compartment performing
the access, so we end up in a situation where we have same-origin compartments,
but Xray in one direction and Transparent in the other.

This is a problem for crossCompartmentFunction.apply(null, [arg]). If both
globals get transparent wrappers, there's obviously no problem. And if both
globals get XrayWrappers, then the |apply| happens on the XrayWrapper of the
function in the caller's compartment. So the Array is unpacked in the caller's
compartment, and again we have no problem.

But if the caller gets Transparent and the callee gets Xrays, then we end up
invoking |apply| from the callee's side, which then gets an XrayWrapper to the
array. This XrayWrapper may do surprising things, leading to the odd situation
in the testcase.

Same-origin Xrays are kind of broken anyway, but I don't think we'll ever be
able to get rid of them. So the most sensible thing to do is probably to honor
the flag (if set) from either compartment. This patch does that.
2014-07-10 10:04:30 -07:00
Bobby Holley 4a9f9e844b Bug 1034239 - Replace GentlyOpaque with an "Xray-to-nothing" wrapper. r=gabor
I did this wrong before. Making this a SecurityWrapper means that the caller does
not subsumes the target, and that the target therefore needs to be protected
from the caller. But GentlyOpaque was supposed to be an analog of PermissiveXray
for use when no useful XrayTraits exist, so it should behave similarly.

If we make this a Filtering Security Wrapper, we get a bunch of assertions where we
expect CheckedUnwrap to succeed for a chrome-side wrapper. And we can't making it
a Filtering Non-Security Wrapper, because then the filtering policy isn't even
consulted (an optimization in jsproxy.cpp).

Really, we want all of the Xray machinery (like the ability to waive and to place
expandos), and we just don't want to resolve any properties. This patch does this.
2014-07-10 09:31:37 -07:00
Bobby Holley bba8240dd7 Bug 1034239 - Add Proxies to ForceCOWBehavior. r=gabor 2014-07-10 09:31:37 -07:00
Jan de Mooij b986e6ec0f Bug 1034627 part 3 - Fix SandboxDump, AccessCheck.cpp to work with Latin1 strings and nursery strings. r=bholley 2014-07-10 17:36:35 +02:00
Bobby Holley ec0078e10d Bug 1033927 - Drop support for custom [object XrayWrapper [object ClassName]] stringification. r=peterv 2014-07-07 13:11:24 -07:00
Jan de Mooij 44da586636 Bug 1034191 - Make nsDependentJSString users work with Latin1 strings and nursery-allocated strings. r=bz 2014-07-05 17:30:54 +02:00
Bobby Holley f0dce63c2c Bug 1029933 - Introduce and use ParentKeyForStandardClass. r=Waldo 2014-07-04 12:41:28 -07:00
Bobby Holley 98413afdad Bug 1029933 - Introduce the concept of "dependent" standard classes and handle them in the ClassSpec infrastructure. r=Waldo 2014-07-04 12:41:28 -07:00
Bobby Holley 71f1a77169 Bug 1032317 - Make CompartmentPrivate and XPCWrappedNativeScope accessors infallible. r=gabor 2014-07-03 09:40:52 -07:00
Bobby Holley 7bfa2b8c8f Bug 1033920 - Handle null in XrayWrapper::setPrototypeOf. v1 r=efaust
From ac73068c4494c0df74329482e57f64ba8ec93cb4 Mon Sep 17 00:00:00 2001
2014-07-02 21:06:28 -07:00
Bobby Holley 9e1742f3c3 Bug 1033253 - Null-check the result of JS_GetFunctionId. r=bz 2014-07-02 11:02:11 -07:00
Steve Fink 04d4a79438 Bug 1022773 - Return value rooting for XPConnect, r=bholley
--HG--
extra : rebase_source : 7dd3b1585bbc3d6a4a22812771495dedf600d7e0
2014-06-25 15:35:37 -07:00
Eric Faust 19ae308309 Bug 1027402 - Part 4: Mark Proxy Handler uses const. (r=jorendorff, r=bz) 2014-06-27 04:44:08 -07:00
Eric Faust 04ec29520a Bug 1027402 - Part 3: Mark all Proxy Handler methods const. (r=jorendorff, r=bz) 2014-06-27 04:44:06 -07:00
Eric Faust 992c8dde5a Bug 1027402 - Part 2: Mark Proxy Handler instances as const. (r=bholley, r=bz over IRC) 2014-06-27 04:44:04 -07:00
Eric Faust d6d3b525f2 Bug 1027402 - Part 1: Remove set* from BaseProxyHandler. (r=bholley) 2014-06-27 04:44:02 -07:00
Carsten "Tomcat" Book e4f5e9f3a3 Backed out changeset 2c6403818106 (bug 1027402) for bustage on a CLOSED TREE 2014-06-27 14:21:46 +02:00
Carsten "Tomcat" Book cbe01cdaa8 Backed out changeset 346912776f97 (bug 1027402) 2014-06-27 14:21:22 +02:00
Carsten "Tomcat" Book 76beb8d59f Backed out changeset 285c853fedfa (bug 1027402) 2014-06-27 14:21:20 +02:00
Carsten "Tomcat" Book 0c7ea5265d Backed out changeset 96443362db6f (bug 1027402) 2014-06-27 14:21:17 +02:00
Eric Faust 6f7e434c6b Bug 1027402 - Part 4: Mark Proxy Handler uses const. (r=jorendorff, r=bz) 2014-06-27 04:44:08 -07:00
Eric Faust 62d61ccf3f Bug 1027402 - Part 3: Mark all Proxy Handler methods const. (r=jorendorff, r=bz) 2014-06-27 04:44:06 -07:00
Eric Faust 6091687271 Bug 1027402 - Part 2: Mark Proxy Handler instances as const. (r=bholley) 2014-06-27 04:44:04 -07:00
Eric Faust 89bdda2ed7 Bug 1027402 - Part 1: Remove set* from BaseProxyHandler. (r=bholley) 2014-06-27 04:44:02 -07:00
Jason Orendorff 76d9f6e407 Bug 645416, part 22 - Remove JSCompartment::wrapId. r=terrence.
This is unnecessary now that object jsids no longer exist. Both string and
symbol jsids point only to GC things in the atoms compartment, which are safe
to pass to any compartment without wrapping.

--HG--
extra : rebase_source : 82c21e8474df05b1bb42c14d872c981205bbe879
2014-06-23 10:57:02 -05:00
Bobby Holley a5aa04cdbc Bug 976148 - Support the .name and .length properties of Function instances. r=gabor 2014-06-19 09:57:06 -07:00
Bobby Holley 5549a2a2cc Bug 976148 - Support the 'prototype' property for standard constructors. r=gabor 2014-06-19 09:57:06 -07:00
Bobby Holley 02c638ea36 Bug 976148 - Implement Xrays to Function objects. r=gabor 2014-06-19 09:57:06 -07:00
Bobby Holley 3963ab573b Bug 987163 - Implement Xrays for TypedArrays. r=gabor 2014-06-17 10:16:08 -07:00
Bobby Holley a5a0be7595 Bug 987163 - Drop special COW support for TypedArrays. r=gabor
From now on, if someone wants to expose a TypedArray to content, they should
use Cu.cloneInto.
2014-06-17 10:16:08 -07:00
Bobby Holley 78b6ce807b Bug 987163 - Fix some squelched OOMs. r=gabor 2014-06-17 10:16:08 -07:00
Bobby Holley e25ce66bda Bug 987163 - Convert from |switch| statements to |if| statements. r=gabor
I realized that the switches are going to be cumbersome for Array stuff, because
we'll have to enumerate each kind of TypedArray as a separate case: statement.
Let's just use |if| so that we can call a helper.
2014-06-17 10:16:08 -07:00
Terrence Cole 5590758a75 Bug 1017650 - Remove the unused |proto| arg from the wrapping machinery; r=efaust 2014-06-16 11:59:59 -07:00
Bobby Holley 07bee3c907 Bug 1020609 - Implement Xrays to Arrays. r=bz 2014-06-11 15:16:07 -07:00
Bobby Holley 0f251a891e Bug 1020609 - Make configurability check in Xray defineProperty match the spec. r=bz
This code is basically emulating the ES semantics with respect to non-configurable
properties. Non-configurable value properties can still be writable, in which case
their value and writability may be updated.
2014-06-11 15:16:06 -07:00
Chris Peterson c04dc8b035 Bug 1018680 - Fix jsd_xpc.cpp warning and mark js/ductwork, js/jsd, and js/xpconnet as FAIL_ON_WARNINGS. r=ejpbruel 2014-05-31 19:50:24 -07:00
Bobby Holley 699946fc90 Bug 1022016 - Redesign nsDependentJSString API to be less of a footgun. r=gabor 2014-06-10 20:15:56 -07:00
Trevor Saunders dd19f59774 bug 1021171 - don't return nulllptr in functions returning bool r=bz,waldo 2014-06-06 15:31:30 -04:00
Bobby Holley 9db935d49b Bug 987111 - Flip on Object Xrays. r=gabor 2014-06-05 22:32:39 -07:00
Bobby Holley 42f7024f5e Bug 987111 - Implement delete_ for Object Xrays. r=gabor 2014-06-05 22:32:39 -07:00
Bobby Holley cad5e8f936 Bug 987111 - Implement defineProperty for Object Xrays. r=gabor 2014-06-05 22:32:39 -07:00
Bobby Holley 88e63325ae Bug 987111 - Implement resolveOwnProperty and enumerateNames for Object instances. r=gabor 2014-06-05 22:32:38 -07:00
Bobby Holley a2ee510ecb Bug 987111 - Make JSProto_Object COWs take precedence over Xrays. r=gabor 2014-06-05 22:32:38 -07:00
Bobby Holley bbc449149e Bug 987111 - Handle the Object.prototype case in Xray getPrototypeOf. r=gabor 2014-06-05 22:32:38 -07:00
Bobby Holley 6bb5e95a97 Bug 987111 - Fill out existing_desc with all properties, not just |own| ones. r=gabor
This gives us strictly more information than we had before, which turns out to
be useful. We can still get the old behavior by testing the identity of
desc.object(), which I've done in one of the two existing uses for existing_desc.
The other (in DOMXrayTraits::defineProperty) is actually more correct with the
full (non-own) lookup.
2014-06-05 22:32:38 -07:00
Vivien Nicolas bc803a18da Bug 1015887 - Expose realFrameElement to Chrome JS. r=bholley 2014-06-04 20:11:05 +02:00
Wes Kocher 915f3c652a Backed out 13 changesets (bug 987111) for disagreeing with some patch from b-i or fx-team in tonight's merge to hopefully fix a CLOSED TREE
Backed out changeset d4e390ceac27 (bug 987111)
Backed out changeset 5f88b5ef9496 (bug 987111)
Backed out changeset cdfd24ddf448 (bug 987111)
Backed out changeset 7883150e5471 (bug 987111)
Backed out changeset 407c7ca82ada (bug 987111)
Backed out changeset e7140ccf7e09 (bug 987111)
Backed out changeset 0a4d18d6306f (bug 987111)
Backed out changeset e7b7548867d9 (bug 987111)
Backed out changeset 944d128f135a (bug 987111)
Backed out changeset 33860f30fc4f (bug 987111)
Backed out changeset 518a915fb81b (bug 987111)
Backed out changeset 7576a51cf72e (bug 987111)
Backed out changeset 1a8dc1af9de6 (bug 987111)
2014-06-04 22:12:50 -07:00
Bobby Holley c6742de97a Bug 987111 - Flip on Object Xrays. r=gabor 2014-06-04 15:12:27 -07:00
Bobby Holley a9aed971d9 Bug 987111 - Implement delete_ for Object Xrays. r=gabor 2014-06-04 15:12:27 -07:00
Bobby Holley 98b02626d5 Bug 987111 - Implement defineProperty for Object Xrays. r=gabor 2014-06-04 15:12:27 -07:00
Bobby Holley 6e9bc694e8 Bug 987111 - Implement resolveOwnProperty and enumerateNames for Object instances. r=gabor 2014-06-04 15:12:27 -07:00
Bobby Holley 5fce5dd4ab Bug 987111 - Make JSProto_Object COWs take precedence over Xrays. r=gabor 2014-06-04 15:12:26 -07:00
Bobby Holley 6c6c52d3ec Bug 987111 - Handle the Object.prototype case in Xray getPrototypeOf. r=gabor 2014-06-04 15:12:26 -07:00
Bobby Holley ce6b82c251 Bug 987111 - Fill out existing_desc with all properties, not just |own| ones. r=gabor
This gives us strictly more information than we had before, which turns out to
be useful. We can still get the old behavior by testing the identity of
desc.object(), which I've done in one of the two existing uses for existing_desc.
The other (in DOMXrayTraits::defineProperty) is actually more correct with the
full (non-own) lookup.
2014-06-04 15:12:26 -07:00
Ryan VanderMeulen 3d3ce28f0f Backed out 5 changesets (bug 1015871, bug 1020257, bug 1015887, bug 1005888, bug 1015894) for desktop B2G mochitest failures on a CLOSED TREE.
Backed out changeset dbcb9974b640 (bug 1020257)
Backed out changeset 3220b7b2efc9 (bug 1015894)
Backed out changeset 4e23647ae247 (bug 1015887)
Backed out changeset 59df0cdacc15 (bug 1015871)
Backed out changeset e7124b07804b (bug 1005888)
2014-06-04 16:07:06 -04:00
Vivien Nicolas 34a46b6121 Bug 1015887 - Expose realFrameElement to Chrome JS. r=bholley 2014-06-04 20:11:05 +02:00
Bill McCloskey 9157c8fd4d Bug 1017310 - Rename *XBLScope to *ContentXBLScope in xpconnect (r=bholley) 2014-06-02 18:04:21 -07:00
Bobby Holley 13813ca2bf Bug 972987 - Implement Xrays to self-hosted methods and properties. r=till,gabor 2014-06-02 13:55:20 -07:00
Bobby Holley 09f9f51b84 Bug 992958 - Add support for prototype JSPropertySpecs on ClassSpec. r=luke 2014-05-23 16:53:03 -07:00
Julien Levesy 38b0b1f449 Bug 1006692 - Replaced nsScriptSecurityManager::SubjectIsPrivileged and AccessCheck::IsCallerChrome by nsContentUtils::IsCallerChrome. r=bholley 2014-05-19 13:39:00 +02:00
Bobby Holley 2513cf740a Bug 1001198 - Explicitly fire up the SSM from nsXPConnect. r=gabor 2014-05-06 23:17:43 -07:00
Bobby Holley 8ba3be8772 Bug 997987 - Cache the system principal on nsContentUtils and remove nsIScriptSecurityManager::SubjectPrincipalIsSystem. r=Ms2ger,sr=bz 2014-05-06 15:43:03 -07:00
Jon Coppeard 1216544376 Bug 959787 - Handlify remaining JS APIs r=terrence r=bz r=bholley 2014-04-30 10:10:33 +01:00
Michael Shuen e76fd87034 Bug 972385 - Make JS::AutoValueVector subscript operator return handles. r=jonco, smaug 2014-04-28 16:53:00 +02:00
Birunthan Mohanathas c48b86b0c6 Bug 866289 - Make mode lines consistent in js/xpconnect/ for 4 space indented files. r=Ms2ger 2014-04-03 07:58:00 -04:00
Jason Orendorff 4740c9dea6 Bug 547140, part 4 - Remove flags argument from resolve hooks. r=Waldo. 2014-04-25 16:11:02 -05:00
Jason Orendorff 6e21c723d2 Bug 547140, part 2 - Remove flags argument from JS_GetPropertyDescriptor and friends. r=Waldo. 2014-04-25 16:11:01 -05:00
Jason Orendorff e51a8c4a20 Bug 547140, part 1 - Remove JSRESOLVE_ASSIGNING. r=Waldo. 2014-04-25 16:11:00 -05:00
Jason Orendorff f66a185e68 Bug 987007, part 2 - Handle assignment to named and indexed setters without using JSRESOLVE_ASSIGNING. r=bz, r=bholley.
--HG--
extra : rebase_source : a26eb85a086a18219a4d423cd7ad49a92cfd2584
2014-04-25 15:07:18 -05:00
Peter Van der Beken 4b64c1bee2 Bug 993057 - Fix Xrays to disallow indexed expando properties on Xrays for Window with a WebIDL binding. r=bholley.
--HG--
extra : rebase_source : a7762fc56b9ad1801be22aa3380f430b44082f9e
2014-02-15 22:12:35 +01:00
Bobby Holley 2ca3777187 Bug 958326 - Remove same-compartment security wrapper machinery. r=mrbkap 2014-03-26 10:59:20 -03:00
Bobby Holley 4146c05d55 Bug 975042 - Enable JS Xray for the Date object. r=peterv 2014-03-23 11:02:14 -03:00
Bobby Holley 56aac00a06 Bug 975042 - Implement resolveOwnProperty and enumerateNames trap. r=peterv 2014-03-23 11:02:13 -03:00
Bobby Holley a9d3924c56 Bug 975042 - Make enumerateNames trap virtual. r=peterv 2014-03-23 11:02:13 -03:00
Bobby Holley 8eb80b2fd1 Bug 975042 - Implement getPrototypeOf. r=peterv 2014-03-23 11:02:13 -03:00
Bobby Holley f08d932ce0 Bug 975042 - Implement createHolder. r=peterv 2014-03-23 11:02:13 -03:00
Bobby Holley 60e8547108 Bug 975042 - Implement the easy trait hooks. r=peterv 2014-03-23 11:02:13 -03:00
Bobby Holley 9c97f0b173 Bug 975042 - Basic Xray infrastructure and boilerplate. r=peterv
All of this machinery asserts if it actually get used. But it won't be used at
present, because we have an empty whitelist of JSProtoKeys.
2014-03-23 11:02:12 -03:00
Bobby Holley c34dd9877d Bug 975042 - Remove the special COW support for Date. r=peterv
As soon as Date is on Xrays, this stuff won't work anyway. Henceforth, content
access to chrome Date objects is forbidden, and APIs should use something like
|new contentWindow.Date()| for any Date object they wish to expose to content.
2014-03-23 11:02:12 -03:00
Carsten "Tomcat" Book 9099b263ed Backed out changeset f787c0fa465e (bug 975042) for B2G ICS Emulator M7 Orange on a CLOSED TREE 2014-03-21 08:48:40 +01:00
Carsten "Tomcat" Book 0bc70db9d7 Backed out changeset 351371062c26 (bug 975042) 2014-03-21 08:47:48 +01:00
Carsten "Tomcat" Book f816ce48b9 Backed out changeset 449ade4078c0 (bug 975042) 2014-03-21 08:47:47 +01:00
Carsten "Tomcat" Book ac8230799d Backed out changeset 59a38e0e27bb (bug 975042) 2014-03-21 08:47:45 +01:00
Carsten "Tomcat" Book 2c95000099 Backed out changeset 8ac7fa583164 (bug 975042) 2014-03-21 08:47:44 +01:00
Carsten "Tomcat" Book 5f92d5b6fa Backed out changeset 6c25a4bfd449 (bug 975042) 2014-03-21 08:47:43 +01:00
Carsten "Tomcat" Book 9f22e17a78 Backed out changeset f7d97dc26289 (bug 975042) 2014-03-21 08:47:42 +01:00
Carsten "Tomcat" Book 239b34fee5 Backed out changeset 1b62c8f1c211 (bug 975042) 2014-03-21 08:47:41 +01:00
Bobby Holley 1973d9aa6a Bug 975042 - Enable JS Xray for the Date object. r=peterv 2014-03-20 23:47:24 -03:00
Bobby Holley 838db9bb08 Bug 975042 - Implement resolveOwnProperty and enumerateNames trap. r=peterv 2014-03-20 23:47:24 -03:00
Bobby Holley 5cc38c0e83 Bug 975042 - Make enumerateNames trap virtual. r=peterv 2014-03-20 23:47:24 -03:00
Bobby Holley 3364cb667b Bug 975042 - Implement getPrototypeOf. r=peterv 2014-03-20 23:47:24 -03:00
Bobby Holley a00932c5e2 Bug 975042 - Implement createHolder. r=peterv 2014-03-20 23:47:24 -03:00
Bobby Holley 9115f9b416 Bug 975042 - Implement the easy trait hooks. r=peterv 2014-03-20 23:47:23 -03:00
Bobby Holley eb2c3f8bbb Bug 975042 - Basic Xray infrastructure and boilerplate. r=peterv
All of this machinery asserts if it actually get used. But it won't be used at
present, because we have an empty whitelist of JSProtoKeys.
2014-03-20 23:47:23 -03:00
Bobby Holley 6567ce6262 Bug 975042 - Remove the special COW support for Date. r=peterv
As soon as Date is on Xrays, this stuff won't work anyway. Henceforth, content
access to chrome Date objects is forbidden, and APIs should use something like
|new contentWindow.Date()| for any Date object they wish to expose to content.
2014-03-20 23:47:23 -03:00
Bobby Holley fbb9b62de8 Bug 825392 - Remove SOWs. r=bz 2014-03-19 13:35:45 -03:00