Commit Graph

3772 Commits

Author SHA1 Message Date
Boris Zbarsky
4330519678 Bug 832014 part 9. Switch AccessCheck to using the generated LocationBinding::IsPermitted method. r=bholley 2014-07-11 19:34:44 -04:00
Boris Zbarsky
618671a12c Bug 832014 part 8. Switch Location to WebIDL bindings. r=peterv,bholley 2014-07-11 19:32:46 -04:00
Bobby Holley
4776e65d38 Bug 1034682 - Set wantXrays to false for content XBL scopes. r=billm 2014-07-11 15:56:27 -07:00
Bobby Holley
a510cbf751 Bug 1034682 - Move remaining wacky wantXrays behavior to the JS entry point so that we don't have to worry about it when creating Sandboxes from C++. r=peterv 2014-07-11 15:56:27 -07:00
Bobby Holley
38ba3e44e0 Bug 1034682 - Remove nonsensical sandboxProto waiving in the wantXrays case. r=peterv
This doesn't make sense. wantXrays means that the WrapperFactory machinery gives
us Xrays in the same-origin case. When it's false, we don't have Xrays to
same-origin objects to begin with, so the waive is useless. Its only observable
effect comes in the situation of privileged (i.e. nsEP) sandboxes with a
less-privileged sandboxPrototype. And I see no reason why these things should get
a waived prototype.

It looks like this was added in 2010 for the Web Console in bug 611401. None of
that is applicable anymore.
2014-07-11 15:56:27 -07:00
Bobby Holley
e7024b77c9 Bug 987669 - Just use macros because MSVC and gcc don't have real constexpr support. r=me CLOSED TREE 2014-07-11 09:37:00 -07:00
Jan de Mooij
680e7363ee Bug 1034627 part 8 - Fix XPCConvert to work with Latin1 strings and nursery strings. r=bholley 2014-07-11 16:22:39 +02:00
Jan de Mooij
10540962e8 Bug 1034627 part 5 - Make quick stubs work with Latin1 strings and nursery strings. r=bz 2014-07-11 16:22:35 +02:00
Bobby Holley
05fbd0d662 Bug 987669 - Tests. r=gabor 2014-07-11 09:09:22 -07:00
Bobby Holley
c4700e5072 Bug 987669 - Turn on Xrays for Error objects. r=gabor 2014-07-11 09:09:22 -07:00
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
Bobby Holley
d204a01c8f Bug 940316 - Move werror to RuntimeOptions. r=jandem 2014-07-11 08:30:47 -07:00
Ed Morley
d8704a83d2 Backed out changeset 8f50bc05d337 (bug 1034627) for debug build failures 2014-07-11 15:46:53 +01:00
Ed Morley
9af578991f Backed out changeset bcba40acc0ac (bug 1034627) 2014-07-11 15:46:29 +01:00
Jan de Mooij
4e84888995 Bug 1034627 part 8 - Fix XPCConvert to work with Latin1 strings and nursery strings. r=bholley 2014-07-11 16:22:39 +02:00
Jan de Mooij
bcdc561427 Bug 1034627 part 5 - Make quick stubs work with Latin1 strings and nursery strings. r=bz 2014-07-11 16:22:35 +02:00
Jan de Mooij
cda5c814db Bug 1034627 part 6 - Fix XPCVariant to work with Latin1 strings and nursery strings. r=bholley
--HG--
extra : rebase_source : be029c174195192570da688250583157825e9e06
2014-07-11 09:38:55 +02:00
Jan de Mooij
42fd43e50e Bug 1034627 part 4 - Fix XPCComponents and XPCWrappedJSClass to work with Latin1 strings and nursery strings. r=bholley
--HG--
extra : rebase_source : 82d0a3ab83d9f10391da38c5c658627d1701f07a
2014-07-11 09:36:20 +02:00
Carsten "Tomcat" Book
ce57787693 Backed out changeset cf85693280c7 (bug 886570) frequent mochitest-3 errors on windows 2014-07-11 14:15:29 +02:00
Carsten "Tomcat" Book
4a0de0298f Backed out changeset f78470faff8e (bug 1034627) Valgrind Test failures on a CLOSED TREE 2014-07-11 11:00:52 +02:00
Carsten "Tomcat" Book
eb71d8cf86 Backed out changeset 110e44b996f8 (bug 1034627) for Valgrind Testfailures on a CLOSED TREE 2014-07-11 11:00:21 +02:00
Jan de Mooij
8ff8c31410 Bug 1034627 part 6 - Fix XPCVariant to work with Latin1 strings and nursery strings. r=bholley 2014-07-11 09:38:55 +02:00
Jan de Mooij
117c8ed18c Bug 1034627 part 4 - Fix XPCComponents and XPCWrappedJSClass to work with Latin1 strings and nursery strings. r=bholley 2014-07-11 09:36:20 +02:00
Ahmed Kachkach
50db9012f6 Bug 886570 - Initial integration of structured logs in mochitest. r=ahal,Ms2ger 2014-07-10 13:33:00 +02: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
Bill McCloskey
b7f2ddaeba Bug 1029248 - Allow CPOWs to be converted to native interfaces (r=mrbkap) 2014-07-10 16:47:26 -07:00
Bill McCloskey
e03b6322a0 Bug 1029248 - Clean up CPOW unwrapping (r=mrbkap) 2014-07-10 16:47:04 -07:00
Ms2ger
1a551c7ee8 Backout changeset 69c0707a144a for crashes on a CLOSED TREE. 2014-07-10 21:04:26 +02:00
Ms2ger
86555a0dfd Bug 1036777 - Remove the useAllocator argument to XPCConvert::JSData2Native; r=bholley
It turns out the useAllocator argument is only used for the dipper types
(nsXPTType::{T_ASTRING, T_DOMSTRING, T_UTF8STRING, T_CSTRING}), while we
only pass true in cases where we don't have a dipper type:

* XPCConvert::JSArray2Native errors on those types;
* GetNamedPropertyAsVariantRaw() passes an interface type;
* nsXPCWrappedJSClass::CallMethod passes !param.IsDipper() for the first
  calls and only reaches the last call for dependent types, which do not
  include any of the dipper types;
* CallMethodHelper::ConvertIndependentParam handles dipper types earlier
* and CallMethodHelper::ConvertDependentParam handles dependent types.
2014-07-10 20:23:24 +02: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
Jan de Mooij
edbd6779df Bug 1034627 part 2 - Fix xpconnect Dump and Print functions to work with Latin1 strings and nursery strings. r=bholley 2014-07-10 17:36:33 +02:00
Brian Hackett
00d8fa7118 Bug 1021790 - "Cleanup naming for scalar and typed array types", r=sfink 2014-06-06 09:36:00 -07:00
Jeff Walden
7a88795a72 Bug 953296 - Make the source-hook mechanism use mozilla::UniquePtr. r=jimb
--HG--
extra : rebase_source : c285fec8b38790fe78e3f29106011a928e12322e
2013-12-30 13:34:54 -06: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
1c19351c9a Bug 1029933 - Give BackstagePass an Enumerate hook to match its NewResolve hook. r=Waldo
This is required in order to avoid exposing resolve hook effects when
Object.freeze() is invoked on the global. The freeze() call first enumerates
the object, after which point any lazy properties need to be resolve so that
we can safely mark the object as non-extensible.
2014-07-04 12:41:27 -07:00
Boris Zbarsky
4c7f38333c Bug 1018583 part 2. Remove the returnStringOnly gunk from sandboxes. r=bholley 2014-07-04 01:22:50 -04:00
Carsten "Tomcat" Book
2271e217f3 Backed out changeset df2b43d4581e (bug 1018583) 2014-07-04 08:23:42 +02:00
Boris Zbarsky
3dc237819d Bug 1018583 part 2. Remove the returnStringOnly gunk from sandboxes. r=bholley 2014-07-04 01:22:50 -04:00
Bobby Holley
2d531b7c33 Bug 1032457 - Implement the |allowCallbacks| parameter to exportFunction. r=gabor 2014-07-03 11:00:54 -07:00
Bobby Holley
e99f0db620 Bug 1032457 - Separate out cloning and non-cloning function forwarders. r=gabor
We're going to add functionality to the cloning version, and the non-cloning
version is going away.
2014-07-03 11:00:54 -07:00
Bobby Holley
62998b097a Bug 1032457 - Rename ExportOptions to ExportFunctionOptions. r=gabor 2014-07-03 11:00:53 -07:00
Ryan VanderMeulen
658554a580 Backed out changesets 4a19dcbc7e7a and 4907115e02e3 (bug 1029248) for non-unified bustage.
CLOSED TREE
2014-07-03 13:19:29 -04:00