Commit Graph

7172 Commits

Author SHA1 Message Date
Andy Wingo
5db3645882 Bug 1539136 - XrayWrappers filter out disabled DataView properties. r=kmag
Differential Revision: https://phabricator.services.mozilla.com//D25249

--HG--
extra : rebase_source : 1f0758c939945df368cceeb6c8e047c99b8d4542
2019-04-08 09:31:33 +02:00
Yoshi Cheng-Hao Huang
222255214e Bug 1534967 - Part 1: use RootedIdVector. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D25042
2019-04-08 10:46:53 +08:00
Andrew McCreight
90abea1653 Bug 1540301, part 5 - Replace instances of nsXPCWrappedJSClass with nsXPTInterfaceInfo. r=bzbarsky
nsXPCWrappedJSClass now only adds indirections and dynamic
allocations, so eliminate it. The class is kept around as a collection
of static helper functions to avoid needing to move around all of this
code and messing with history. In total, these patches save around 2kb
of dynamic allocations per process.

The major parts of this patch are:
* Dropping indirection for accessing things on nsXPTInterfaceInfo and
  renaming things from class to info.
* Removing the stuff related to instances of nsXPCWrappedJSClass
  existing (ctor, dtor, field, ISupports implementation, getter methods).
* Removing IID2WrappedJSClassMap, because we only need the map from IIDs
  to info.

I dropped the null check in TraverseNative because mInfo is never
cleared, while mClass was.

I dropped the forward declaration of nsXPCWrappedJSClass because no
instances of that class exist, so no function will take or return a
pointer to one.

Differential Revision: https://phabricator.services.mozilla.com/D26218

--HG--
extra : moz-landing-system : lando
2019-04-06 12:57:02 +00:00
Andrew McCreight
8f23fc71ea Bug 1540301, part 4 - Make nsXPCWrappedJSClass::DebugDump into an infallible static method. r=bzbarsky
Ultimately, this method is really about dumping XPConnect-ish
information about an nsXPTInterfaceInfo, so change it into a static
method that takes an info directly. This loses logging of the
nsXPCWrappedJSClass's ref count, but that is going away in the next
patch anyways.

Differential Revision: https://phabricator.services.mozilla.com/D26217

--HG--
extra : moz-landing-system : lando
2019-04-06 12:57:00 +00:00
Andrew McCreight
2ea25a6e9f Bug 1540301, part 3 - Eliminate nsIXPCWrappedJSClass. r=bzbarsky
This interface serves no real purpose, aside from some weird XPConnect
debugging function. If you are in a debugger already, you can just
call the nsXPCWrappedJSClass DebugDump method directly.

For now, I changed nsXPCWrappedJSClass to just implement nsISupports,
but this will go away later.

I also devirtualized DebugDump(), because it is no longer an XPCOM
method.

Differential Revision: https://phabricator.services.mozilla.com/D26216

--HG--
extra : moz-landing-system : lando
2019-04-06 12:56:53 +00:00
Andrew McCreight
d320f01e48 Bug 1540301, part 2 - Make nsXPCWrappedJSClass::CallMethod() into a static method. r=bzbarsky
The first idea here is that |this| is actually the GetClass() of the
|wrapper| argument (the one call site looks like
"GetClass()->CallMethod(this, ...)"), so we can locally reconstruct it
when CallMethod is a static method.

The second idea here is that the only real use of the
nsXPCWrappedJSClass is to grab some data from the nsXPTInterfaceInfo
in a few places. This means that we can take a pointer to the info
early on in the function and use that rather than go through the
nsXPCWrappedJSClass. This in turn means that because the info is
statically allocated we no longer need to do a kungFuDeathGrip on the
wrapper's nsXPCWrappedJSClass.

Differential Revision: https://phabricator.services.mozilla.com/D26215

--HG--
extra : moz-landing-system : lando
2019-04-06 12:56:51 +00:00
Andrew McCreight
5d994e0f0e Bug 1540301, part 1 - Make trivially static nsXPCWrappedJSClass methods static. r=bzbarsky
There are a number of nsXPCWrappedJSClass methods that don't use any
data from |this|, so go ahead and make them static. This is one step
towards eliminating nsXPCWrappedJSClass entirely.

In addition, devirtualize a few methods, because they are going to
have to get devirtualized anyways, and there's no need for them to be
virtual.

Differential Revision: https://phabricator.services.mozilla.com/D26214

--HG--
extra : moz-landing-system : lando
2019-04-06 12:56:49 +00:00
Andrew McCreight
184afc9483 Bug 1541684, part 4 - Remove nsXPCWrappedJSClass:mDescriptors. r=nika
This field now just caches the IsReflectable() field from the method
info, so get rid of it.

Differential Revision: https://phabricator.services.mozilla.com/D26071

--HG--
extra : moz-landing-system : lando
2019-04-05 23:48:20 +00:00
Andrew McCreight
8f597c742f Bug 1541684, part 3 - Statically compute if a method is reflectable. r=nika
XPCConvert::IsMethodReflectable() is derived entirely from
nsXPTMethodInfo, so we can compute it at build time and include it in
nsXPTMethodInfo. It is the only use of mNotXPCOM and mHidden, so we
can get rid of those fields at the same time.

This paves the way for getting rid of XPCWrappedJSClass::mDescriptors
in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D26070

--HG--
extra : moz-landing-system : lando
2019-04-05 23:48:18 +00:00
Andrew McCreight
a8dbd5d65f Bug 1541684, part 2 - Remove nsXPCWrappedJSClass::mIID. r=nika
This is already stored on mInfo.

Differential Revision: https://phabricator.services.mozilla.com/D26069

--HG--
extra : moz-landing-system : lando
2019-04-05 23:48:11 +00:00
Andrew McCreight
c1d8f269ef Bug 1541684, part 1 - Remove XPCWrappedJSClass::mRuntime. r=bzbarsky
There is only a single XPC JS runtime now, so there's no need to keep a
special pointer around.

Differential Revision: https://phabricator.services.mozilla.com/D26068

--HG--
extra : moz-landing-system : lando
2019-04-05 23:48:09 +00:00
Sylvestre Ledru
03c8e8c2dd Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D26098

--HG--
extra : moz-landing-system : lando
2019-04-05 21:41:42 +00:00
Boris Zbarsky
39bd790515 Bug 1541513 part 7. Stop using AutoJSContext in XPConnect. r=mccr8
The change to the second FindTearOff call in XPCWrappedNative::GetNewOrUsed is
fixing a longstanding bug that was introduced in bug 903891 when the sense of
the check was incorrectly reversed.  Luckily that code is unreached in
practice, because the two PreCreate hooks we have left never create the wrapper.

Differential Revision: https://phabricator.services.mozilla.com/D26007

--HG--
extra : moz-landing-system : lando
2019-04-04 18:12:18 +00:00
Boris Zbarsky
cb3918b746 Bug 1541513 part 6. Stop using AutoJSContext in XPCWrappedNativeInfo. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D26006

--HG--
extra : moz-landing-system : lando
2019-04-04 13:14:40 +00:00
Boris Zbarsky
10328fb59d Bug 1541513 part 5. Stop using AutoJSContext in XPCWrappedNativeProto. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D26005

--HG--
extra : moz-landing-system : lando
2019-04-04 02:10:05 +00:00
Boris Zbarsky
5057288ed8 Bug 1541513 part 4. Stop using AutoJSContext in NativeData2JS. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D26003

--HG--
extra : moz-landing-system : lando
2019-04-04 02:08:47 +00:00
Boris Zbarsky
6f668b8c00 Bug 1541513 part 3. Stop using AutoJSContext in NativeInterface2JSObject. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D26002

--HG--
extra : moz-landing-system : lando
2019-04-04 02:07:53 +00:00
Boris Zbarsky
953426c78f Bug 1541513 part 2. Stop using AutoJSContext in some simple XPCConvert cases. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D26000

--HG--
extra : moz-landing-system : lando
2019-04-03 23:33:35 +00:00
Boris Zbarsky
6c53c36a79 Bug 1541513 part 1. Stop requiring a JSContext for JS_SetAllNonReservedSlotsToUndefined. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D25999

--HG--
extra : moz-landing-system : lando
2019-04-05 07:36:32 +00:00
Csoregi Natalia
ba58e936bd Backed out changeset 4ad80127f89f (bug 1519636) for bustage on MarkupMap.h and nsAccessibilityService.cpp. CLOSED TREE 2019-04-05 09:48:19 +03:00
Sylvestre Ledru
d1c1878603 Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D26098

--HG--
extra : moz-landing-system : lando
2019-04-04 21:36:16 +00:00
Narcis Beleuzu
ed1878b2ce Backed out 4 changesets (bug 1541684) for bustages on xpcprivate.h . CLOSED TREE
Backed out changeset b021ea89cf04 (bug 1541684)
Backed out changeset 16d5f0b792d4 (bug 1541684)
Backed out changeset a37029984f13 (bug 1541684)
Backed out changeset 900f639d72a3 (bug 1541684)
2019-04-05 03:57:09 +03:00
Andrew McCreight
1a6c8f3740 Bug 1541684, part 4 - Remove nsXPCWrappedJSClass:mDescriptors. r=nika
This field now just caches the IsReflectable() field from the method
info, so get rid of it.

Differential Revision: https://phabricator.services.mozilla.com/D26071

--HG--
extra : moz-landing-system : lando
2019-04-04 21:01:26 +00:00
Andrew McCreight
98dd357c68 Bug 1541684, part 3 - Statically compute if a method is reflectable. r=nika
XPCConvert::IsMethodReflectable() is derived entirely from
nsXPTMethodInfo, so we can compute it at build time and include it in
nsXPTMethodInfo. It is the only use of mNotXPCOM and mHidden, so we
can get rid of those fields at the same time.

This paves the way for getting rid of XPCWrappedJSClass::mDescriptors
in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D26070

--HG--
extra : moz-landing-system : lando
2019-04-04 21:01:24 +00:00
Andrew McCreight
a838eacb5c Bug 1541684, part 2 - Remove nsXPCWrappedJSClass::mIID. r=nika
This is already stored on mInfo.

Differential Revision: https://phabricator.services.mozilla.com/D26069

--HG--
extra : moz-landing-system : lando
2019-04-04 21:01:22 +00:00
Andrew McCreight
bd9b8350ab Bug 1541684, part 1 - Remove XPCWrappedJSClass::mRuntime. r=bzbarsky
There is only a single XPC JS runtime now, so there's no need to keep a
special pointer around.

Differential Revision: https://phabricator.services.mozilla.com/D26068

--HG--
extra : moz-landing-system : lando
2019-04-04 21:02:15 +00:00
Narcis Beleuzu
24dbe577a5 Backed out changeset 389b6bbd76db (bug 1519636) for bustages on MarkupMap.h . CLOSED TREE 2019-04-05 00:27:56 +03:00
Sylvestre Ledru
399dbd28fe Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D26098

--HG--
extra : moz-landing-system : lando
2019-04-04 20:12:23 +00:00
Boris Zbarsky
8b2ada715e Bug 1541600 part 2. Stop using AutoJSContext for the slow script dialog. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D26224

--HG--
extra : moz-landing-system : lando
2019-04-04 20:00:36 +00:00
Andrew McCreight
ec3b52a535 Bug 1541677, part 2 - Remove the unused XPIDL version of GetInterfaceInfo. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D26066

--HG--
extra : moz-landing-system : lando
2019-04-04 05:05:04 +00:00
Andrew McCreight
2f250e281e Bug 1541677, part 1 - Remove unused cx arg to the nsXPCWrappedJSClass ctor. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D26065

--HG--
extra : moz-landing-system : lando
2019-04-04 05:04:41 +00:00
Petr Sumbera
c54d6f748b Bug 1434726 - Avoid SIGBUS on SPARC systems in HashIIDPtrKey r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D25429

--HG--
extra : moz-landing-system : lando
2019-04-02 17:27:23 +00:00
Eden Chuang
72b79c6fbd Bug 1442778 - Add "chromeContext" parameter to console API and console service messages. r=smaug
1. Adding a new attribute chromeContext in ConsoleEvent
2. Adding a new boolean attribute isFromChromeContext in nsIConsoleMessage
3. Sending IsFromChromeContext to the parent process

Differential Revision: https://phabricator.services.mozilla.com/D23330

--HG--
extra : moz-landing-system : lando
2019-04-01 22:42:34 +00:00
Jonathan Kew
243b72de64 Bug 1533428 - patch 1 - Use fully-qualified name for mozilla::ipc::FileDescriptor in AutoMemMap.h, rather than depending on a 'using' declaration. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D22908

--HG--
extra : moz-landing-system : lando
2019-04-01 14:32:12 +00:00
Nathan Froyd
206cdc4471 Bug 1540273 - fix undefined behavior in nsXPCWrappedJSClass; r=mccr8
Left shifts exhibit undefined behavior if the sign bit changes, which
would happen in this code for indices that are 31 mod 32.  Fix this by
always making sure the shifted value is an unsigned integer.

Differential Revision: https://phabricator.services.mozilla.com/D25476

--HG--
extra : moz-landing-system : lando
2019-03-29 22:58:07 +00:00
Sylvestre Ledru
ef0bfc3822 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D24168

--HG--
extra : moz-landing-system : lando
2019-03-31 15:12:55 +00:00
Oana Pop Rus
a759d6f62b Merge inbound to mozilla-central. a=merge 2019-03-29 23:54:39 +02:00
Jan de Mooij
126dd4fe64 Bug 1534902 - Move more of XPConnect's PreWrap code into the JS engine. r=kmag
This ensures the JS shell and browser behave the same way and it's nice for fuzzing.

Differential Revision: https://phabricator.services.mozilla.com/D25204

--HG--
extra : moz-landing-system : lando
2019-03-29 09:06:31 +00:00
Tom Schuster
9d316167b9 Bug 1536860 - Telemetry for deprecated Array generics. r=jorendorff datareview=chutten
Differential Revision: https://phabricator.services.mozilla.com/D24208

--HG--
extra : moz-landing-system : lando
2019-03-28 17:15:37 +00:00
Peter Van der Beken
85c5f963e6 Bug 1532025 - Remove support for WrappedNatives from PreserveWrapper, since we don't have DOM objects using WrappedNatives anymore. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D21832

--HG--
extra : moz-landing-system : lando
2019-03-28 14:19:53 +00:00
Jan de Mooij
3ad6efea42 Bug 1382650 part 4 - Split Ion warmup threshold JitOption in 'normal' and 'full' options. r=nbp
Also adds a javascript.options.ion.full.threshold browser pref and similar shell
flags.

This doesn't rename the existing prefs yet.

Differential Revision: https://phabricator.services.mozilla.com/D24156

--HG--
extra : moz-landing-system : lando
2019-03-27 18:57:58 +00:00
Jason Orendorff
785ed53165 Bug 1537609 - Cap the stack size at 2MB on Windows. r=jandem
In bug 256180, the size of the stack on 64-bit Windows was changed from 2MB to
8MB, and on 32-bit Windows, from 1MB to 1.5MB. This is so large that it takes
significantly longer for a runaway recursive function to throw "too much
recursion", which causes terrible performance in scripts obfuscated using
obfuscator.io.

This patch leaves the actual stack size as-is, but changes the
JS-engine-specific stack quota back to 2MB on 64-bit Windows (6MB if ASAN is
enabled). 32-bit Windows is unaffected by the new cap.

Differential Revision: https://phabricator.services.mozilla.com/D24597

--HG--
extra : moz-landing-system : lando
2019-03-27 15:12:00 +00:00
Yoshi Cheng-Hao Huang
7f012345b7 Bug 1521732 - Part 5: RootedObjectVector. r=sfink,jonco
s/AutoObjectVector/RootedObjectVector/g

Depends on D23185

Differential Revision: https://phabricator.services.mozilla.com/D23186

--HG--
extra : moz-landing-system : lando
2019-03-26 14:00:51 +00:00
Yoshi Cheng-Hao Huang
edbc333422 Bug 1521732 - Part 3: Use RootedValueVector instead. r=sfink,jonco
s/AutoValueVector/RootedValueVector/g

Depends on D23183

Differential Revision: https://phabricator.services.mozilla.com/D23184

--HG--
extra : moz-landing-system : lando
2019-03-26 13:58:20 +00:00
Jason Orendorff
1c204efb75 Bug 1495072 - Part 2: Add pref for the await fix. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D24255

--HG--
extra : moz-landing-system : lando
2019-03-26 18:16:55 +00:00
Cosmin Sabou
78fc71e3c3 Backed out changeset 7fa7d6e6dedc (bug 1442778) for devtools failures on browser_webconsole_check_stubs_console_api.js CLOSED TREE 2019-03-26 20:27:55 +02:00
Eden Chuang
5e4df764d9 Bug 1442778 - Add "chromeContext" parameter to console API and console service messages. r=smaug
1. Adding a new attribute chromeContext in ConsoleEvent
2. Adding a new boolean attribute isFromChromeContext in nsIConsoleMessage
3. Sending IsFromChromeContext to the parent process

Differential Revision: https://phabricator.services.mozilla.com/D23330

--HG--
extra : moz-landing-system : lando
2019-03-26 15:18:20 +00:00
Andy Wingo
baaa715e33 Bug 1538488 - Fix XPConnect/BigInt test when bigint is off r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D24667

--HG--
extra : moz-landing-system : lando
2019-03-26 07:17:47 +00:00
sakshaat
d781937a67 Bug 1517483 - Get rid of nsIScriptSecurityManager::IsSystemPrincipal r=bzbarsky
Replaced instances of callers in both C++ and JS files to query the state from the principal directly.

Differential Revision: https://phabricator.services.mozilla.com/D22532

--HG--
extra : moz-landing-system : lando
2019-03-24 20:36:25 +00:00
Tom Schuster
d65d068e74 Bug 1222552 - Fix xpconnect test. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D24537

--HG--
extra : moz-landing-system : lando
2019-03-22 18:11:10 +00:00
Tom Schuster
dc40a0d446 Bug 1222552 - Remove String generics. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D24406

--HG--
extra : moz-landing-system : lando
2019-03-22 18:11:08 +00:00
Matthew Gaudet
872e0839a3 Bug 1505574 - Remove Unboxed Objects Option Code r=iain
Differential Revision: https://phabricator.services.mozilla.com/D24048

--HG--
extra : moz-landing-system : lando
2019-03-22 15:33:12 +00:00
Andy Wingo
83128e6945 Bug 1531293 - Enable javascript.options.bigint on Nightly r=jandem,kmag
Differential Revision: https://phabricator.services.mozilla.com/D21528

--HG--
extra : moz-landing-system : lando
2019-03-22 08:57:44 +00:00
Jason Orendorff
b0968b1c83 Bug 1536887 - Remove obsolete getter syntax in an old test file. r=jwalden
Noticed by Ian Moody [:Kwan] while watching test output. (!)

The test was introduced in bug 515475, 10 years ago. However, the syntax used
in this patch seems to have been removed from SpiderMonkey around that time,
maybe even before the patch landed; that is, this is not among the syntax
removed in bug 517580. As far as I can tell, this test has never functioned
properly.

Differential Revision: https://phabricator.services.mozilla.com/D24236

--HG--
extra : moz-landing-system : lando
2019-03-20 20:41:01 +00:00
Olli Pettay
1dc9c72510 Bug 1536266, remove unused XPCVariant::mCCGeneration, r=mbrodesser
Differential Revision: https://phabricator.services.mozilla.com/D24016

--HG--
extra : moz-landing-system : lando
2019-03-19 14:52:35 +00:00
Chris Peterson
3f655a7340 Bug 1534878 - xpcom: Rename NS_InitXPCOM2() to NS_InitXPCOM(). r=froydnj
--HG--
extra : rebase_source : 6e7a46cf49f78e46e12d1e7fc76aba6f0c377be0
2019-03-14 23:38:09 -07:00
Sylvestre Ledru
4aa92e3091 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D22514
2019-03-13 10:19:06 +01:00
David Major
e5773183d6 Bug 1528074 - Remove MSVC warning flags that clang-cl doesn't understand r=chmanchester
Per the previous patch, clang-cl only understands five MSVC-style warning flags: 7219c7e9af/clang/include/clang/Driver/CLCompatOptions.td (L188-L197)

This patch removes the flags that clang-cl doesn't understand.

Differential Revision: https://phabricator.services.mozilla.com/D22588

--HG--
extra : moz-landing-system : lando
2019-03-13 20:19:08 +00:00
Jason Orendorff
8d46729792 Bug 1529758 - Add a pref for fields. r=tcampbell
This creates a shell command-line option, `--enable-experimental-fields`, and a
Gecko pref, `javascript.options.experimental.fields`.

Both are off by default everywhere, for now.

Differential Revision: https://phabricator.services.mozilla.com/D22045

--HG--
extra : moz-landing-system : lando
2019-03-12 19:14:57 +00:00
Ciure Andrei
0d9d47364c Backed out changeset 2b5f40fc403b (bug 1529758) for FullParseHandler build bustages CLOSED TREE 2019-03-12 19:28:03 +02:00
Jason Orendorff
51eb0a44fd Bug 1529758 - Add a pref for fields. r=tcampbell
This creates a shell command-line option, `--enable-experimental-fields`, and a
Gecko pref, `javascript.options.experimental.fields`.

Both are off by default everywhere, for now.

Differential Revision: https://phabricator.services.mozilla.com/D22045

--HG--
extra : moz-landing-system : lando
2019-03-12 16:42:41 +00:00
Jeff Walden
8c1d08c491 Bug 1534437 - Make JSFlatString::new_ always take ownership of the |chars| passed to it, and add the same sensible ownership handling to a bunch of callers. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D23043

--HG--
extra : rebase_source : 60741661edc946794e97736dd013ed6eb9609d56
extra : amend_source : 0379248e2bee7588180739224b8008d927ab03f7
2019-03-08 22:28:08 -08:00
Jeff Walden
b299df2f1a Bug 1533636 - Don't bother explicitly aligning when XDRing char16_t data: the operations we use to perform the little/native-endian conversion will correctly translate into, or translate out of, unaligned memory. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D22654

--HG--
extra : rebase_source : 2013431c35fff24bb003671dc257005903ff3c07
2019-03-06 13:36:47 -08:00
Jason Orendorff
e6312a3716 Bug 1533413 - Add Symbol.matchAll to list of expected RegExp methods. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D22583

--HG--
extra : moz-landing-system : lando
2019-03-11 10:20:38 +00:00
Jan de Mooij
d105968a3d Bug 1533302 part 3 - Use UniquePtr for CompartmentPrivate's XPCWrappedNativeScope. r=mccr8
`CompartmentPrivate::GetScope()` was added so callers don't have to do `scope.get()`
manually. The `scope` field is now private and was renamed to `mScope`.

Also replaces some `CompartmentPrivate::Get(obj)->scope` instances with
`ObjectScope(obj)`. It's equivalent but shorter.

Differential Revision: https://phabricator.services.mozilla.com/D22664

--HG--
extra : moz-landing-system : lando
2019-03-09 10:44:18 +00:00
Jan de Mooij
caa37e0fbf Bug 1533302 part 2 - Tie XPCWrappedNativeScope lifetime to CompartmentPrivate. r=mccr8
XPCWrappedNativeScope is now allocated and destroyed with the CompartmentPrivate
that owns it. In follow-up bugs we could merge the two classes (see bug 1032928).

This also removes the dying-scopes list. XPCJSRuntime now stores the list of all
scopes as mozilla::LinkedList.

Differential Revision: https://phabricator.services.mozilla.com/D22492

--HG--
extra : moz-landing-system : lando
2019-03-08 13:28:47 +00:00
Jan de Mooij
b196cb4d46 Bug 1533302 part 1 - Remove unused XPCWrappedNativeScope::IsDyingScope. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D22491

--HG--
extra : moz-landing-system : lando
2019-03-07 19:05:36 +00:00
Andrea Marchesini
8e20bbbc9a Bug 1525245 - Stabilize cookiePolicy/cookiePermission for live documents - part 12 - nsICookieSettings for the channel creation, r=ckerschb,asuth,Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D21538

--HG--
extra : moz-landing-system : lando
2019-03-08 09:04:11 +00:00
arthur.iakab
93997623bd Merge mozilla-central to autoland a=merge on a CLOSED TREE 2019-03-08 00:14:12 +02:00
Doug Thayer
cc84fd752b Bug 1533056 - Move test_startup_caches out of marionette unit tests r=whimboo
Renamed the test to reflect that it is really just a test of the script preloader
as well. I just moved it to get it close to the ScriptPreloader and near existing
tests.

Differential Revision: https://phabricator.services.mozilla.com/D22330

--HG--
rename : testing/marionette/harness/marionette_harness/tests/unit/test_startup_caches.py => js/xpconnect/tests/marionette/test_preloader_telemetry.py
extra : moz-landing-system : lando
2019-03-07 06:30:38 +00:00
Ciure Andrei
712dd2bb8c Backed out 16 changesets (bug 1525245) for perma failing test_document_cookie.html CLOSED TREE
Backed out changeset 3fd27215698f (bug 1525245)
Backed out changeset d9a9e8e77873 (bug 1525245)
Backed out changeset 0e6f7be92e3f (bug 1525245)
Backed out changeset 6790802e2fa5 (bug 1525245)
Backed out changeset a5a9e01116ed (bug 1525245)
Backed out changeset 66e19a0c38dd (bug 1525245)
Backed out changeset fb90d51ba853 (bug 1525245)
Backed out changeset 4772db3625b3 (bug 1525245)
Backed out changeset 9affaf0cb998 (bug 1525245)
Backed out changeset a91b7ebe8bdd (bug 1525245)
Backed out changeset c2a13a7480e1 (bug 1525245)
Backed out changeset abe4482fa137 (bug 1525245)
Backed out changeset b3920c0bcf84 (bug 1525245)
Backed out changeset 0821b81f2724 (bug 1525245)
Backed out changeset 70bed2ad7899 (bug 1525245)
Backed out changeset 5f72ba232cc8 (bug 1525245)
2019-03-07 17:54:18 +02:00
Andrea Marchesini
6856f88972 Bug 1525245 - Stabilize cookiePolicy/cookiePermission for live documents - part 12 - nsICookieSettings for the channel creation, r=ckerschb,asuth,Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D21538

--HG--
extra : moz-landing-system : lando
2019-03-07 10:21:15 +00:00
Lars T Hansen
deeddf1721 Bug 1488205 - Repurpose the --wasm-gc switch for GC. r=jseward
Differential Revision: https://phabricator.services.mozilla.com/D21692

--HG--
extra : rebase_source : 83d2b48fd76a03a8cf175e5f820b4b33f087e4d2
extra : histedit_source : e90289fdb70c787a90a338a2d64e902f4051b34c
2019-03-01 09:55:31 +01:00
Olli Pettay
37d309e927 Bug 1412485, disable legacy touch APIs on desktop, r=masayuki
Hiding document.createEvent("TouchEvent"), document.createTouch, document.createTouchList and ontouch* event
handlers on desktop to follow what Chrome has done.
This patch explicitly does not remove createTouch or createTouchList everywhere, although those seem to have been
removing already on some other browsers.
Devtools use TOUCHEVENTS_OVERRIDE_ENABLED for touch event testing, and this patch keeps the old behavior per discussion
with devtools devs.

Differential Revision: https://phabricator.services.mozilla.com/D22081

--HG--
extra : rebase_source : 562588a289632ba2f11db7f3ac8782c26c3b05f8
2019-03-04 13:35:53 +02:00
Doug Thayer
55db157391 Bug 1364235 - Collect telemetry stats on startup cache hits and misses r=kmag
In bug 1264235 we have some indication that observed bugs with the
startup cache might have been resolved, but we don't really know
until we collect data. Collecting these stats will give us the
ability to have more certainty that the startup cache is functioning
correctly in the wild.

Differential Revision: https://phabricator.services.mozilla.com/D19573

--HG--
extra : moz-landing-system : lando
2019-03-05 16:52:57 +00:00
Jan de Mooij
68ebf9f2e2 Bug 1530608 part 2 - Use the isSameCompartment JS testing function in test_sharedChromeCompartment.html. r=bzbarsky
Depends on D21568

Differential Revision: https://phabricator.services.mozilla.com/D21569

--HG--
extra : moz-landing-system : lando
2019-02-28 19:51:42 +00:00
Gurzau Raul
a218f01445 Merge mozilla-central to autoland. a=merge CLOSED TREE 2019-03-01 15:14:00 +02:00
Cameron Kaiser
651429b4c2 Bug 1512162 - Reenable stack protection for ppc64le in XPConnect. r=bholley 2019-02-27 19:31:08 -08:00
Boris Zbarsky
3f1bb52920 Bug 1530146 part 2. Back out the fix for bug 1526624, since it's no longer needed. r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D21482

--HG--
extra : moz-landing-system : lando
2019-03-01 00:19:53 +00:00
Boris Zbarsky
05b3097da8 Bug 1530146 part 1. Switch XrayWaiver to always being same-realm with its target. r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D21481

--HG--
extra : moz-landing-system : lando
2019-03-01 02:54:41 +00:00
Greg Tatum
0477c3b4e0 Bug 1529125 - Add IOInterposerInit to xpc shell tests; r=froydnj
Add an RAII guarded initialization for the IO interposer to the
initialization process for xpc shell tests. This ensures that whenever
an xpcshell tests uses the IOInterposer, that it will correctly
catch all registered threads, and will not miss any.

Differential Revision: https://phabricator.services.mozilla.com/D20736

--HG--
extra : moz-landing-system : lando
2019-02-26 15:27:20 +00:00
Boris Zbarsky
2e5c884144 Bug 1489308 part 5. Align the work we do on document.open with the spec. r=mccr8,smaug
The main behavior changes are:

1) We no longer create a new Window when doing document.open().  We use the
same Window but remove all the event listeners on it and on the existing DOM
tree before removing the document's existing kids.

2) We no longer create a new session history entry.  The existing one always
gets replaced instead.

3) We now support document.open on documents that are not in a Window.

The reasons for the various test changes are as follows:

The change to browser_modifiedclick_inherit_principal.js is because we no
longer set the docshell to a wyciwyg URL when document.open() happens and the
test was depending on that to terminate.

browser_wyciwyg_urlbarCopying.js is being removed because it's trying to test
wyciwyg URIs, which no longer exist.

The changes in docshell/test/navigation are because document.open() no longer
affects session history.  One of the tests was testing the interactions there
and is being removed; another is being repurposed to just test that
document.open() does not affect history.length.

The change to test_x-frame-options.html is because document.open() now removes
event listeners on the window, which it didn't use to do (and in the specific
case in this test reused the existing inner too, so the listener was still
around in practice).  The new behavior matches other browsers.

The removal of test_bug172261.html is because document.open() no longer affects
session history, so you can't go back across it or forward to the "opened"
state, so the situation that test is trying to test no longer exists.

The changes to test_bug255820.html are because reloading a document after
document.open() will now just load the URL of the document that was the entry
document for the open() call, not reload the written content.  So there's not
much point testing reload behavior, and in this test it was just reloading the
toplevel test file inside the frames.

The change to test_bug346659.html is because now we no longer create a new
Window on document.open().

The change to test_bug1232829.html is because document.open() (implicit in this
test) no longer adds history entries, so the back() was just leaving the test
page instead of going back across the document.open().  The test is a
crashtest in practice, so might still be testing something useful about how
document.open() interacts with animations.

The change to test_bug715739.html is because the URL of the document after
document.open() is now the URL of the entry document, not a wyciwyg URL, so
reload() has different behavior than it used to.

The change to test_bug329869.html is because now when we go back we're
reloading the original document we had, not doing a wyciwyg load, and the
security info now doesn't include the untrusted script.

The changes to the wpt expectations are removing a bunch of expected failures
now that we pass those tests and disabling some tests that are fundamentally
racy and hence fail randomly.  The latter all have github issues filed for the
test problem.

The change to testing/web-platform/tests/common/object-association.js is fixing
tests that were not matching the spec (and were failing in other browsers).

The change to parser-uses-registry-of-owner-document.html is fixing tests that
were not matching the spec (and were failing in other browsers).

The change to document-write.tentative.html is because the test was buggy: it
was using the same iframe element for all its tests and racing loads from some
tests against API calls from other tests, etc.  It's a wonder it ever managed
to pass, independent of these patches (and in fact it doesn't pass according to
wpt.fyi data, even in Firefox).

The changes in html/browsers/history/the-history-interface are because
document.open() no longer adds history entries.  The test was failing in all
other browsers for the same reason.

The changes in html/browsers/history/the-location-interface are because
reloading a document.open()-created thing now loads the URL of the page that
was the entry document for the open() call.  The test was failing in all other
browsers.

The change to reload_document_open_write.html is because we now reload the url
of the document that entered the script that called open() when we reload, not
the written content.  Other browsers were failing this test too; Gecko with
the old document.open implementation was the only one that passed.

The change to http-refresh.py is to fix a test bug: it was not returning a
Content-Type header, so we were putting up helper app dialogs, etc.

The change to test_ext_contentscript.js is because we no create a new global
for document.open() calls.  Kris Maglione OKed this part.

Differential Revision: https://phabricator.services.mozilla.com/D17323

--HG--
extra : moz-landing-system : lando
2019-02-27 23:24:48 +00:00
Nika Layzell
8faa2cd588 Bug 1528383 - Allow getting 'wrappedJSObject' without the attribute being defined, r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D20016

--HG--
extra : moz-landing-system : lando
2019-02-26 21:19:11 +00:00
Ryan Hunt
611651806b Bug 1523969 part 13 - Move method definition inline comments to new line in 'js/'. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D21114

--HG--
extra : rebase_source : 40badf957a93abd4a96f54f5f1f69036cb8e022e
2019-02-25 16:09:04 -06:00
Brian Hackett
89247ca139 Bug 1447244 Part 5 - Add source ID to nsIScriptError and ConsoleEvent, r=smaug.
--HG--
extra : rebase_source : df10848e2b61bcff4837602567d518e4b1e316fb
2019-01-16 12:00:38 -10:00
Razvan Maries
d7a2f49ed8 Merge mozilla-inbound to mozilla-central a=merge 2019-02-23 06:15:14 +02:00
Kris Maglione
e97c8bb395 Bug 1527803: Make sure debug service is instantiated before starting Watchdog thread. r=erahm
The watchdog thread's stack is intentionally kept as small as possible, since
the work that it does is trivial and should not require much stack space.
One result of this is that the stack segment is generally too small to
instantiate a new service (and we really don't want to be instantiating
services on it anyway).

The debug service is generally instantiated before the watchdog thread tries
to touch it, but this isn't guaranteed (and, in particular, it often isn't for
xpcshell runs on some noopt debug builds). Instantiating it before starting
the watchdog thread solves this problem.

Differential Revision: https://phabricator.services.mozilla.com/D20869

--HG--
extra : rebase_source : 2f9c3e412a7ad9a0b6f84c61907e4a7508f3b18c
2019-02-22 13:03:06 -08:00
Paul Bone
5d3d1e589f Bug 1528867 - Add a new version of the GC_NURSERY_BYTES telemetry histogram r=chutten
Differential Revision: https://phabricator.services.mozilla.com/D20248

--HG--
extra : moz-landing-system : lando
2019-02-22 04:00:24 +00:00
Aaron Klotz
28466cb97e Bug 1460433: Part 1 - Change BasicDllServices to not do any dll notification callbacks; r=mhowell
BasicDllServices is used to gain access to the authenticode APIs in non-Gecko
contexts. One feature that WinDllServices provides is the ability to register
a callback interface to be notified when a DLL has been loaded.

This is not particularly useful in the BasicDllServices use case, and in the
"handle a launcher process failure on a background thread" use case, would
actually be harmful.

This patch modifies the DLLServices backend to offer a "basic" option that
omits the callback stuff.

Differential Revision: https://phabricator.services.mozilla.com/D19696

--HG--
extra : moz-landing-system : lando
2019-02-20 06:18:45 +00:00
Boris Zbarsky
6664f13df1 Bug 1523843 part 2. Use a single compartment for same-origin Realms in a single page (toplevel load). r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D19799

--HG--
extra : moz-landing-system : lando
2019-02-21 22:56:30 +00:00
Shivam Singhal
4064daf089 Bug 1528628 - Remove unused JSContext argument of JS_ObjectIsFunction. r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D20114

--HG--
extra : moz-landing-system : lando
2019-02-21 20:42:54 +00:00
Jan de Mooij
095c9d9c6f Bug 1527850 - Null out CompartmentPrivate's scope pointer when moving XPCWrappedNativeScope to the dying scopes list. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D19772

--HG--
extra : moz-landing-system : lando
2019-02-14 15:59:42 +00:00
Benjamin Bouvier
afec75505d Bug 1524337: Move WebAssembly reftypes/gc configuration to moz.configure; r=luke
Differential Revision: https://phabricator.services.mozilla.com/D19788

--HG--
extra : rebase_source : 35112254e9eb5f239650466cc73329ccc175af4a
extra : histedit_source : 5a1a1d6b663c46b9cb63998566e8f101cf19eb46
2019-02-14 12:59:38 +01:00
Mike Hommey
ef3ad686ee Bug 1512504 - Remove support for MSVC. r=froydnj
Consequently, this removes:
- MOZ_LIBPRIO, which is now always enabled.
- non_msvc_compiler, which is now always true.
- The cl.py wrapper, since it's not used anymore.
- CL_INCLUDES_PREFIX, which was only used for the cl.py wrapper.
- NONASCII, which was only there to ensure CL_INCLUDES_PREFIX still
  worked in non-ASCII cases.

This however keeps a large part of detecting and configuring for MSVC,
because we still do need it for at least headers, libraries, and midl.

Depends on D19614

Differential Revision: https://phabricator.services.mozilla.com/D19615

--HG--
extra : moz-landing-system : lando
2019-02-14 21:45:27 +00:00
Andy Wingo
7d559ef8c3 Bug 1527860 - Remove ENABLE_BIGINT #ifdef r=jandem,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D19766

--HG--
extra : moz-landing-system : lando
2019-02-14 15:03:44 +00:00
Florian Quèze
5de09797c0 Bug 1526508 - add profiler markers for importing a JS module, loading a JS XPCOM component or a subscript r=mstange
Bug 1526508 - add profiler markers for importing a JS module, loading a JS XPCOM component or a subscript

Differential Revision: https://phabricator.services.mozilla.com/D19228

--HG--
extra : moz-landing-system : lando
2019-02-11 17:53:22 +00:00
Nika Layzell
dbec7d4975 Bug 1526382 - Part 2: Make nsIClassInfo use Array<nsIIDRef> for 'interfaces', r=mccr8
This is a follow-up to the previous part, which actually changes one of
these callers to use Array<nsIIDRef> instead of [array] nsIIDPtr.

From doing this patch, it seems like we should consider changing
the type `nsIIDRef` to instead simply be `nsIID`, and treat it more like
the `AString` types from the POV of XPIDL. `nsIIDPtr` would then
continue to exist for backwards compatibility, but we can probably
remove almost all current consumers over time.

Depends on D19175

Differential Revision: https://phabricator.services.mozilla.com/D19176

--HG--
extra : moz-landing-system : lando
2019-02-13 21:42:08 +00:00
Nika Layzell
1c2a9c2b07 Bug 1526382 - Part 1: Split nsID& and nsID* in xpconnect, r=mccr8
Currently the [ref] and [ptr] types share the same underlying
implementation. This is unfortunate, and can cause correctness problems
with outparam refs (as an example).

By using the same tools used to allow other larger objects (such as
jsid, nsTArray, and nsString) to be stored directly in the nsXPTCVariant
object, this patch directly stores the nsID in the nsXPTCVariant object
when calling from JS into C++.

Using this new strategy avoids an nsID* allocation every time we pass
one over XPConnect, and should also allow us to simplify callers.

In addition, some special casing is added to xpidl to make it possible
to use the nsid reference type objects directly inside of Array<T>,
which will allow us to remove `[array] nsIIDPtr` callers.

Differential Revision: https://phabricator.services.mozilla.com/D19175

--HG--
extra : moz-landing-system : lando
2019-02-13 21:42:00 +00:00
Boris Zbarsky
e40194db78 Bug 1527413 part 1. Give JSIterateCompartmentCallback a return value that can be used to stop the iteration. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D19559

--HG--
extra : moz-landing-system : lando
2019-02-13 14:10:19 +00:00
Jan de Mooij
6b8698ce2d Bug 1526588 - Fix some issues with js::GetFirstGlobalInCompartment and XPCWrappedNativeScope::UpdateWeakPointersInAllScopesAfterGC. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D19493

--HG--
extra : moz-landing-system : lando
2019-02-13 06:41:44 +00:00