Commit Graph

6104 Commits

Author SHA1 Message Date
Jason Orendorff
f719f95f29 Bug 1404107 - Fix cloning expando chains when reparenting DOM objects. r=bz,r=mrbkap
--HG--
extra : rebase_source : fac045a54af8fba9e3ac46012aaf3b8a4b7b480c
extra : source : 53838f13462feb5db5542ee6d5bc7e24172fb51f
2017-09-29 10:33:13 -05:00
Nicholas Nethercote
8a68e6fb83 Bug 1403868 (part 4) - Reduce tools/profiler/public/*.h to almost nothing in non-MOZ_GECKO_PROFILER builds. r=mstange.
Currently the Gecko Profiler defines a moderate amount of stuff when
MOZ_GECKO_PROFILER is undefined. It also #includes various headers, including
JS ones. This is making it difficult to separate Gecko's media stack for
inclusion in Servo.

This patch greatly simplifies how things are exposed. The starting point is:

- GeckoProfiler.h can be #included unconditionally;

- everything else from the profiler must be guarded by MOZ_GECKO_PROFILER.

In practice this introduces way too many #ifdefs, so the patch loosens it by
adding no-op macros for a number of the most common operations.

The net result is that #ifdefs and macros are used a bit more, but almost
nothing is exposed in non-MOZ_GECKO_PROFILER builds (including
ProfilerMarkerPayload.h and GeckoProfiler.h), and understanding what is exposed
is much simpler than before.

Note also that in BHR, ThreadStackHelper is now entirely absent in
non-MOZ_GECKO_PROFILER builds.
2017-10-04 09:11:18 +11:00
Kris Maglione
30d4691c07 Bug 1404741: Don't call mozJSComponentLoader::CompilationScope during URLPreloader critical section. r=mccr8
The URLPreloader's initialization code accesses the Omnijar cache off-main
thread. It can do so safely only as long as the main thread is blocked, or
running code which is guaranteed never to touch Omnijar, while its critical
section runs.

While that was guaranteed for previous versions of the code, some invariants
changed when we began using the component loader's shared global for initial
compilation. Once the global is created, we can safely use it to initialize
compilation. But creating the global invokes a large amount of Gecko code,
some of which touches Omnijar in the process.

MozReview-Commit-ID: 48WoIZtGPTo

--HG--
extra : rebase_source : 9bd5d884e32cfa59c022edb00078aac050acb20b
2017-10-06 15:09:11 -07:00
David Major
7e599076a6 Bug 1405735 - Make worker JS context options respect safe mode. r=billm
--HG--
extra : amend_source : 94345cc176019885832a57c5d441b3ed5cc63973
2017-10-06 12:50:50 -04:00
Mike Hommey
4fe7459180 Bug 1403366 - Stop requiring argv[0] for XRE_GetBinaryPath and the underlying BinaryPath::Get. r=froydnj
--HG--
extra : rebase_source : ac7bb0d7766fce5b6325c34c2868b26eec594e18
2017-09-28 10:37:27 +09:00
Robert Helmer
b5691ba8af Bug 1348981 - provide method to re-initialize URLPreloader for xpcshell tests r=kmag
MozReview-Commit-ID: rnjEJc1Uir

--HG--
extra : rebase_source : ee273d624c3d4a4ec21506574f1e203fce4b2d45
2017-09-21 11:24:14 -07:00
Robert Helmer
cb1aad0897 Bug 1348981 - add Cu.readURI helper for sync file reading on startup r=kmag
MozReview-Commit-ID: 1yz25afCUDs

--HG--
extra : rebase_source : 549e28b7ceeb6556156d8f6e4d2a7470852d64c0
2017-09-19 12:13:08 -07:00
Tom Ritter
26f1bc6cd8 Bug 1404147 Cast constants to the type they are compared to r=smaug
MozReview-Commit-ID: JQDZTBOALZm

--HG--
extra : rebase_source : 5cb3ed5da7f99defd524247ff798c9c501ef851a
2017-09-28 17:47:43 -05:00
Sebastian Hengst
fb83346aed Backed out changeset a8a2b3d99ed9 (bug 1348981) 2017-10-04 15:43:57 +02:00
Sebastian Hengst
261978bbab Backed out changeset d96c54a045a4 (bug 1348981) 2017-10-04 15:43:51 +02:00
Dão Gottwald
0300b0c60d Bug 543535 - Remove ISO8601DateUtils.jsm. r=mak
MozReview-Commit-ID: 6k7sS6TUCYL

--HG--
extra : rebase_source : bdfe8cfd3ce93f88f38b9d0cd2e2961a6202b0aa
2017-10-04 12:34:11 +02:00
Robert Helmer
fe1edf420d Bug 1348981 - provide method to re-initialize URLPreloader for xpcshell tests r=kmag
MozReview-Commit-ID: rnjEJc1Uir

--HG--
extra : rebase_source : ee273d624c3d4a4ec21506574f1e203fce4b2d45
2017-09-21 11:24:14 -07:00
Robert Helmer
4e1a79dc01 Bug 1348981 - add Cu.readURI helper for sync file reading on startup r=kmag
MozReview-Commit-ID: 1yz25afCUDs

--HG--
extra : rebase_source : 549e28b7ceeb6556156d8f6e4d2a7470852d64c0
2017-09-19 12:13:08 -07:00
Sebastian Hengst
1d5497084d Backed out changeset 582d112281f9 (bug 1403366) 2017-10-04 01:27:07 +02:00
Sebastian Hengst
4be222f271 Backed out changeset f397bfb365e1 (bug 1348981) 2017-10-04 01:00:21 +02:00
Sebastian Hengst
3c14e73ba8 Backed out changeset 199b3fe8114f (bug 1348981) 2017-10-04 01:00:15 +02:00
Mike Hommey
3b34606aa6 Bug 1403366 - Stop requiring argv[0] for XRE_GetBinaryPath and the underlying BinaryPath::Get. r=froydnj
--HG--
extra : rebase_source : ac7bb0d7766fce5b6325c34c2868b26eec594e18
2017-09-28 10:37:27 +09:00
Robert Helmer
9ade6ed8ac Bug 1348981 - provide method to re-initialize URLPreloader for xpcshell tests r=kmag
MozReview-Commit-ID: rnjEJc1Uir

--HG--
extra : rebase_source : ee273d624c3d4a4ec21506574f1e203fce4b2d45
2017-09-21 11:24:14 -07:00
Robert Helmer
4c5dbf3bf6 Bug 1348981 - add Cu.readURI helper for sync file reading on startup r=kmag
MozReview-Commit-ID: 1yz25afCUDs

--HG--
extra : rebase_source : 549e28b7ceeb6556156d8f6e4d2a7470852d64c0
2017-09-19 12:13:08 -07:00
Sebastian Hengst
006ae28b0a Backed out changeset 3eb67e350f38 (bug 1403366) 2017-09-29 17:19:46 +02:00
Mike Hommey
31399bfad2 Bug 1403366 - Stop requiring argv[0] for XRE_GetBinaryPath and the underlying BinaryPath::Get. r=froydnj
--HG--
extra : rebase_source : f61fd84dcc801f84f4838d357c795ce07928a4e6
2017-09-28 10:37:27 +09:00
Blake Kaplan
205489b432 Bug 1396110 - Fix races during watchdog shutdown. r=billm
This patch also ensures that we won't accidentally try stopping slow scripts
when we're shutting down the watchdog manager.

MozReview-Commit-ID: EMb0enfivd8

--HG--
extra : rebase_source : b27205c4d593caa1c33534591686e85fba9f0d41
2017-09-20 15:23:28 -07:00
Kris Maglione
98d4287346 Bug 1402503: Part 1 - Fix slow script add-on ID detection. r=mixedpuppy
MozReview-Commit-ID: EYhOn2TQCq1

--HG--
extra : rebase_source : f7831fa04a8616109ff91d66a5dedf0b827527cb
extra : histedit_source : 20fa03b4f4970b872201d6f4feed7a08a98fa348
2017-09-25 10:52:11 -07:00
Chris Peterson
e10b7338b7 Bug 1402666 - Part 2: Replace Replace(NS_LITERAL_CSTRING("")) with ReplaceLiteral(""). r=erahm
MozReview-Commit-ID: Ho2DHuomdi3

--HG--
extra : rebase_source : c2221823a8beea9f72810e5aec2231336dcb4622
extra : source : b8dcb71d823cf20014043bc5bde2052a974a98de
2017-09-15 19:27:59 -07:00
Wes Kocher
acf8913934 Merge m-c to inbound, a=merge
MozReview-Commit-ID: IsbKCdZU2Ui
2017-09-26 17:14:31 -07:00
Wes Kocher
22a72df7fe Merge inbound to m-c a=merge
MozReview-Commit-ID: 6viJ4wRxLa8
2017-09-26 15:54:51 -07:00
Brian Hackett
c021969355 Backed out changeset 072f8d4a9964 (bug 1355109) for causing crashes with various extensions. a=lizzard
--HG--
extra : source : 520e300d1266d19aea623eb723587acc03751d50
2017-09-26 14:12:25 -04:00
Jan de Mooij
dbca189324 Bug 1153592 part 2 - Remove JSPROP_SHARED; ensure accessor props don't have slots. r=evilpie 2017-09-26 12:26:50 +02:00
Jan de Mooij
68e468c3ff Bug 1403136 - Clean up JSSetterOp code now that slotful setters are gone. r=evilpie 2017-09-26 22:26:40 +02:00
Andrew McCreight
1a24cc1d71 Bug 958643, part 6 - Remove some unused forward decls. r=krizsa
MozReview-Commit-ID: yMpU0hDUXP

--HG--
extra : rebase_source : 154cab1e7673490c824525e46a36ebd359872021
2017-09-20 12:02:47 -07:00
Andrew McCreight
75bb849fa3 Bug 958643, part 5 - Eliminate XPCJSObjectHolder. r=krizsa
It is now unused.

MozReview-Commit-ID: AzXW6qHdSOW

--HG--
extra : rebase_source : f60697cff778843c36a1e75f3e4f8779bc356d40
2017-09-20 10:26:16 -07:00
Andrew McCreight
e61cf2cc18 Bug 958643, part 4 - Inline CreateHolderIfNeeded. r=krizsa
The last argument is always null, so we don't need this function any more.

MozReview-Commit-ID: 5YWMO9ywZK3

--HG--
extra : rebase_source : 56bce2611135bb1b30e7f8ad763e13f112d2395f
2017-09-20 10:21:59 -07:00
Andrew McCreight
13c3d91b7f Bug 958643, part 3 - Remove always-null second second argument to XPCConvert::NativeInterface2JSObject. r=krizsa
MozReview-Commit-ID: CQvJ1bZBLyS

--HG--
extra : rebase_source : 0da1274aa8d6b3584ac0103ddf8884e993887574
2017-09-20 10:20:48 -07:00
Andrew McCreight
8ee8721f0d Bug 958643, part 2 - Remove always-null last argument to NativeInterface2JSObject. r=krizsa
MozReview-Commit-ID: G9F6wlMWCl9

--HG--
extra : rebase_source : 313a40850965fc1a2488ef60deaf9d1cb2705806
2017-09-20 10:15:06 -07:00
Andrew McCreight
78601602bf Bug 958643, part 1 - Remove the unused nsXPConnect::WrapNativeHolder. r=krizsa
MozReview-Commit-ID: AOQYLS8FFrf

--HG--
extra : rebase_source : ce8f98c71d43f12235ead8280ba4ee0c84cb0238
2017-09-20 10:12:35 -07:00
Chris Peterson
98b2f2fcd6 Bug 870698 - Part 7: Replace Insert(NS_LITERAL_CSTRING("")) with InsertLiteral(""). r=erahm
The NS_LITERAL_CSTRING macro creates a temporary nsLiteralCString to encapsulate the string literal and its length, but AssignLiteral() can determine the string literal's length at compile-time without nsLiteralCString.

MozReview-Commit-ID: DbTW5Bhd9E1

--HG--
extra : rebase_source : b27f666e5ca832d814fb6846208474e1ec66e5f4
extra : source : 9ff4e11402a9a43ed90298a9c354b0164cf9414f
2017-09-07 18:15:42 -07:00
Chris Peterson
a0c8081df4 Bug 870698 - Part 4: Replace Equals("") with EqualsLiteral(""). r=erahm
MozReview-Commit-ID: G1GhyvD29WK

--HG--
extra : rebase_source : 115842c37a40041bdca7b4e1ff0a5680b02ced15
extra : source : 90bfff9c01d80086cdc17637f310e898fea295ea
2017-09-06 01:13:45 -07:00
Chris Peterson
45aa2a8e8e Bug 870698 - Part 2: Replace Append("") with AppendLiteral(""). r=erahm
MozReview-Commit-ID: CrkIP4iHP1U

--HG--
extra : rebase_source : 5dc4e91a3f1860773c199f1abf3f66479218834a
extra : intermediate-source : ba51cc79847f2b43ba616f4a5d2bbc6958ca9f6d
extra : source : 1fda2fa990cc918c748ffa14fcc5dbe13fe3bdc3
2017-09-03 22:14:11 -07:00
Chris Peterson
9f4c1f5278 Bug 870698 - Part 1: Replace Assign("") with AssignLiteral(""). r=erahm
MozReview-Commit-ID: A0u9PP49OW3

--HG--
extra : rebase_source : 7d5286959f510eb4b7df1b7e32d5b9b58719c48b
extra : intermediate-source : f552b4a78236c42bc09030b3eb008725a3edb9c8
extra : source : 26ac4a1014f6661a70e3bf9f552407e12c2c3981
2017-09-03 22:12:56 -07:00
Nicholas Nethercote
e3c9cbb969 Bug 1401813 - Rename Null[C]String() as Void[C]String(). r=erahm.
XPCOM's string API doesn't have the notion of a "null string". But it does have
the notion of a "void string" (or "voided string"), and that's what these
functions are returning. So the names should reflect that.

--HG--
extra : rebase_source : 4e3f982e0873877174a08a25413595ff66f7d20e
2017-09-22 14:35:46 +10:00
Nicholas Nethercote
1aef116268 Bug 1401100 - Remove nsIMemoryReporterCallback. r=erahm.
nsIHandleReportCallback, typedef of nsIMemoryReporterCallback, has been the
preferred name for a long time and is used in most places. This patch removes
nsIMemoryReporterCallback.

--HG--
extra : rebase_source : c675076b4f98d93d96235dad890e31e0b0e6c277
2017-09-22 08:09:29 +10:00
Kris Maglione
f37317cad0 Bug 1369533: Return dead wrappers rather than null for dead CallbackObject values. r=bz
We don't have access to an appropriate context to create the dead wrapper in
when the callback is nuked, so instead, this patch creates a new dead wrapper
in the caller compartment each time the property is accessed. This is the same
behavior we'd get when trying to re-wrap a cross-compartment dead wrapper, so
it's consistent with the way we handle these situations elsewhere.

MozReview-Commit-ID: 3cMeR4z8EOe

--HG--
extra : rebase_source : 7e8cf4a195ef64deb7677ce4ac9818d342815667
2017-09-04 17:21:06 -07:00
Andrew McCreight
767b21fb24 Bug 1176342, part 2 - De-COM the flags for InitClassesWithNewWrappedGlobal. r=mrbkap
MozReview-Commit-ID: 4QFtHPIzUd0

--HG--
extra : rebase_source : e7b8c4156be165c44ddb2e7be557e52438c63d42
2017-09-19 13:12:50 -07:00
Andrew McCreight
36eb42025b Bug 1176342, part 1 - De-COM InitClassesWithNewWrappedGlobal. r=mrbkap
MozReview-Commit-ID: EfRQW3QUXCG

--HG--
extra : rebase_source : 895694d28cc228cfb095639880738c84767e08a8
2017-09-18 16:35:39 -07:00
Blake Kaplan
d5d500f633 Bug 1398396 - Initialize the locale stuff on runtimes instead of contexts. r=billm
MozReview-Commit-ID: Il9HAqYdTzK

--HG--
extra : rebase_source : 29a294c02bc2be1534766f33192854f51984883e
2017-09-11 15:46:14 -07:00
Jon Coppeard
1077972535 Bug 1396613 - Update the object moved hook to allow it to be called when tenuring nursery objects r=sfink r=mccr8 2017-09-19 12:31:30 +01:00
Andrew McCreight
292c80dfbd Bug 1400406 - js/xpconnect/moz.build contains a reference to a non-existent directory. r=gps
Also, MOZ_XPCTOOLS does not appear to be a thing any more.

MozReview-Commit-ID: 99BR9rl4EnD

--HG--
extra : rebase_source : 3712b7b2b180b583ca761cdc5d6ddf17728e8b74
2017-09-15 14:35:15 -07:00
Kris Maglione
9217c2da0e Bug 1399997: Part 3 - Update module environment tests with TODOs for shared module eval bindings. r=tcampbell
MozReview-Commit-ID: LVTNnN3HlKK

--HG--
extra : rebase_source : 79fffe7cd39ac8b27865cf9504fd9d1808b75198
2017-09-14 13:08:17 -07:00
Kris Maglione
a70175c241 Bug 1398895: Part 2 - Ensure component loader initialization after user prefs load. r=mccr8
The script precompiler needs to begin its work very early in the startup
process in order to be effective. At the moment, this means before user
preferences are loaded. It also needs to be able to compile scripts into
the shared JSM global when that's in use, in order to avoid unnecessary script
clones.

Since we can't know whether global sharing is enabled by that point, instead,
we just always compile module scripts into the shared module global rather
than the XPC compillation scope.

This also changes the global sharing tests to make a failure to respect the
user preference value a fatal error.

MozReview-Commit-ID: G0NkSOl2vU9

--HG--
extra : rebase_source : 4b5e1b10c14dd5cc6609bc589310d12b44f830f5
2017-09-11 13:52:13 -07:00
Ryan VanderMeulen
277d6a438f Merge m-c to inbound. a=merge 2017-09-14 10:52:18 -04:00
Ted Campbell
9b5f5a54bb Bug 1398601 - Fix wunused-variable errors when MOZ_DIAGNOSTIC_ASSERT isn't available. a=RyanVM
MozReview-Commit-ID: 1kvKcQBqog9
2017-09-14 06:35:00 -04:00
Wes Kocher
ff68b95b87 Merge inbound to central, a=merge
MozReview-Commit-ID: ClVRh99eIUo
2017-09-14 00:03:28 -07:00
Nicholas Nethercote
abfa282e96 Bug 1399727 - Fix double-reporting of memory in ScriptPreloader. r=kmag.
DMD indicates double-reporting for mURL, indicating that it is shared.

--HG--
extra : rebase_source : b6e82cc3e4dbba9a59750b6be8117597034f23d7
2017-09-14 15:09:50 +10:00
Florian Quèze
c3c302fe33 Bug 1398198 - browser_startup.js should show the stack when a JS file was loaded earlier than expected, r=felipe,mccr8. 2017-09-13 21:19:53 +02:00
Ted Campbell
21a47b7f15 Bug 1398601 - Add testcase for loading subscripts within a JSM r=kmag
MozReview-Commit-ID: I09eoUnQYCG

--HG--
extra : rebase_source : f423ba10de2fcd6034e6ee98e1dc0d99731ea882
2017-09-10 14:57:04 -04:00
Ted Campbell
8b2e8b3fe5 Bug 1398601 - Fix subscript loader when using JSM global sharing r=kmag
When using the subscript loader with JSM global sharing, it was possible
that subscript would pollute the global of all JSMs in the sharing.

MozReview-Commit-ID: 1ah5JUAZwBA

--HG--
extra : rebase_source : 45a3974cb80ede0cb3beea92f895679c5ea7aa4b
2017-09-10 14:23:32 -04:00
Ted Campbell
0388c3314f Bug 1398601 - Add global/non-syntactic prefix to subscript loader cache r=kmag
We want to be able to store scripts compiled with or without
non-syntactic support in cache when we toggle JSM global sharing. In
current code this script is cloned on execution, but with JSM global
sharing we have would hit assertions.

MozReview-Commit-ID: 2pVTTxLpx6S

--HG--
extra : rebase_source : b123de20f216161c408bba75c8c0fd81be0508df
2017-09-12 18:05:08 -04:00
Phil Ringnalda
606b8426bb Backed out 5 changesets (bug 1398601) for unexpected crashtest assertions
Backed out changeset b728872f4d9a (bug 1398601)
Backed out changeset 05957a92b1a5 (bug 1398601)
Backed out changeset f5c26c3407c0 (bug 1398601)
Backed out changeset eddc38b0afd0 (bug 1398601)
Backed out changeset 776a65d43a5e (bug 1398601)

MozReview-Commit-ID: 9lfUtdlZy7F
2017-09-12 20:11:49 -07:00
Ted Campbell
df5f95b7e2 Bug 1398601 - Add testcase for loading subscripts within a JSM r=kmag
MozReview-Commit-ID: I09eoUnQYCG

--HG--
extra : rebase_source : e9f9efb194e2e6e9b18820e3535eeef47234ea4c
2017-09-10 14:57:04 -04:00
Ted Campbell
7845fe7c7a Bug 1398601 - Fix subscript loader when using JSM global sharing r=kmag
When using the subscript loader with JSM global sharing, it was possible
that subscript would pollute the global of all JSMs in the sharing.

MozReview-Commit-ID: 1ah5JUAZwBA

--HG--
extra : rebase_source : 202904e30b582c788ec440c406607ba98b8836e6
2017-09-10 14:23:32 -04:00
Ted Campbell
eb7051b3b5 Bug 1398601 - Add global/non-syntactic prefix to subscript loader cache r=kmag
We want to be able to store scripts compiled with or without
non-syntactic support in cache when we toggle JSM global sharing. In
current code this script is cloned on execution, but with JSM global
sharing we have would hit assertions.

MozReview-Commit-ID: 2pVTTxLpx6S

--HG--
extra : rebase_source : 5913a43a2dfddf74187f08ab9c53babe377bd706
2017-09-12 18:05:08 -04:00
Jason Orendorff
b311db1626 Bug 1363200 - JSAPI for realms: Split xpc::RealmPrivate from xpc::CompartmentPrivate. r=mrbkap
--HG--
extra : rebase_source : c4bc2da0e808f1ab7a4bfab407a61ef15d3785a5
extra : intermediate-source : a2cc554590772b94071af1df59fc62a6766a6924
extra : source : 0e7c0edaa224d2ccaa4d410fd89d859256b0dc67
2017-06-08 11:07:10 -05:00
Jason Orendorff
ddaf859c55 Bug 1363200 - JSAPI for realms: Change a few XPConnect methods to take Realm arguments instead of JSCompartments. r=mrbkap
This also introduces JS::GetObjectRealmOrNull, which returns an object's realm,
or null if the object is a cross-compartment wrapper. In the new order,
wrappers can't have realms, since they must be shared across all realms in a
compartment. We're introducing this new function early (even though it's
*currently* possible to assign a realm to wrappers) in order to see in
advance if the possibility of returning null will cause problems.
(It looks like it won't.)

--HG--
extra : rebase_source : e55ebbbc4edf2a18ce267198928246592060e339
extra : source : d6bfce1187aa13dbfab03f9566ff7b05b6705e70
2017-06-28 12:31:53 -07:00
Sebastian Hengst
ecf716b8bb merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: CmMBcpJapLy
2017-09-12 11:35:15 +02:00
Phil Ringnalda
7f896e1985 Backed out 4 changesets (bug 1398601) for Windows Marionette crashes @ ExecuteInExtensibleLexicalEnvironment
Backed out changeset 7aac2595bc17 (bug 1398601)
Backed out changeset 7a4bb5a1848a (bug 1398601)
Backed out changeset dd4af7998505 (bug 1398601)
Backed out changeset e9816be61b49 (bug 1398601)

MozReview-Commit-ID: LLJ99dkRQEg
2017-09-11 20:20:16 -07:00
Ted Campbell
d09e551152 Bug 1398601 - Add testcase for loading subscripts within a JSM r=kmag
MozReview-Commit-ID: I09eoUnQYCG

--HG--
extra : rebase_source : b0950f8b5e98ee3bc52fa03067d904687feefcf5
2017-09-10 14:57:04 -04:00
Ted Campbell
ff55566d27 Bug 1398601 - Fix subscript loader when using JSM global sharing r=kmag
When using the subscript loader with JSM global sharing, it was possible
that subscript would pollute the global of all JSMs in the sharing.

MozReview-Commit-ID: 1ah5JUAZwBA

--HG--
extra : rebase_source : 5fecf7dc61019431d67bcee4199e40a8278c8c64
2017-09-10 14:23:32 -04:00
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
Kris Maglione
1b2f22b34a Bug 1396366: Make sure the URLPreloader cache is only written once. r=erahm
MozReview-Commit-ID: FA1BPQ5c6nP

--HG--
extra : rebase_source : 68137a0378cfb2138144c8f53b6b25352c21233d
2017-09-08 13:44:32 -07:00
Jason Orendorff
51b4fbde26 Bug 1363200 - JSAPI for realms: Move XPCWrappedNativeScope::mIsAddonScope to CompartmentPrivate. r=mrbkap
--HG--
extra : rebase_source : e4407cea6fe0b1c87ed00c0c93123b43cb64ad69
2017-07-12 16:41:57 -05:00
Jason Orendorff
ce74f6c158 Bug 1363200 - JSAPI for realms: Move mIsContentXBLScope to the CompartmentPrivate. r=mrbkap
In the new order, it will be a compartment-level bit rather than a
realm-level bit, so it does not belong on the Scope.

--HG--
extra : rebase_source : 44aa4620f7fd7f8d253c8c7f09bf8c97c00ff061
extra : source : 5a9c01720d7929e43aa70341d3821bfaa2479592
2017-07-12 15:00:47 -05: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
Nicholas Nethercote
50c7852f4d Bug 1397628 - Don't auto-atomize strings passed from script. r=kmag.
If you pass a string from script to an IDL method that takes an nsIAtom,
XPConnect will automagically atomize the string for you.

But nsIAtom is no longer scriptable (see the blockers for bug 1392883,
especially bug 1396694). So the code to convert can be removed.

--HG--
extra : rebase_source : af85fa48c1988348d3a9a81b05ed43403d3b730a
2017-09-07 14:37:56 +10:00
Kris Maglione
8c91f29845 Bug 1398499: Part 3 - Add Marionette tests for global sharing. r=mccr8
This tests both that the settings have the desired effect and that switching
between sharing enabled and sharing disabled without a startup cache flush
does not cause any issues.

Tests for user pref changes are currently non-fatal, since they're known not
to work reliably.

MozReview-Commit-ID: 1ZFwyiNf3da

--HG--
extra : rebase_source : c38bd92d2137c90f8c4d202b7009612b45ff4be9
2017-09-09 17:33:01 -07:00
Kris Maglione
60e49ffdd4 Bug 1398499: Part 2 - Add MOZ_LOADER_SHARE_GLOBAL env var to toggle global sharing. r=mccr8
User preference changes currently don't reliably take effect before component
loader initialization, which means they can't be used to write reliable tests.
Environment variables don't have this problem, so adding an environment
variable override makes testing much easier. It's also fairly convenient
during development, when we need to switch between different configurations
for testing.

MozReview-Commit-ID: 8PufRQNRnoU

--HG--
extra : rebase_source : c5ca2f3cb18a8398c95bbbf86e2cd27430f5161a
2017-09-09 14:59:45 -07:00
Kris Maglione
8b676de4b0 Bug 1398499: Part 1 - Use separate cache paths for shared/unshared scripts. r=mccr8
Scripts for use in shared globals need to be compiled for non-syntactic
scopes, while scripts for standalone globals should be compiled as global
scripts for better performance.

Since the startup cache and script preloader store scripts as they were
compiled in the last session, when global sharing settings may have been
different, it can lead to a mismatch, and a crash, due to loading the wrong
type of script.

Using a separate cache path for each type of script fixes this problem, since
it ensures that the cached script will always be of the type we expect.

MozReview-Commit-ID: DnNb2Xi6KeL

--HG--
extra : rebase_source : d2474d1da3f8e1066c21a7c65693ea09ec5b8074
2017-09-09 14:59:00 -07:00
Kris Maglione
e872679b9f Bug 1381976: Part 2 - Cleanup private/protected members and mark class final. r=mccr8
MozReview-Commit-ID: Kn9NfKC4GL8

--HG--
extra : rebase_source : 521043472a824fbcc07288e030f9c36601082c20
2017-08-25 13:29:51 -07:00
Kris Maglione
3529438886 Bug 1381976: Part 1 - Use the shared module global for script pre-compilation. r=mccr8
When we pre-compile scripts for a different global than they are eventually
executed in, we need to clone them into the new global before we can execute
them, which can be expensive. This also prevents us from using lazy parsing,
since lazy functions are currently eagerly compiled when cloned.

Since the vast majority of the scripts compiled by the preloader are executed
in the shared modules scope, initially compiling them there removes a lot of
startup overhead. For the few that aren't, we don't lose anything by compiling
them in the shared module global, but we also don't gain anything over
compiling them in the XPConnect compilation scope.

MozReview-Commit-ID: CEh42BmIMhL

--HG--
extra : rebase_source : 93f639022375dd3f0b8e06533e829ce4089d46b7
2017-08-25 19:36:44 -07:00
Andrew McCreight
4105546375 Bug 1186409 - Check to make sure we don't set some weird XPConnect flags on the shared global. r=kmag
I added the predicate so people can't just start grabbing the loader
global and doing scary things with it.

MozReview-Commit-ID: HzPtMzEm0Ln

--HG--
extra : rebase_source : a0bed5901e54dd1e64c7ef233cd58cdfb1f136d4
2017-06-06 14:41:27 -07:00
Andrew McCreight
1f0b9dc34f Bug 1186409 - Use a single global for all JSMs. r=kmag
This patch adds a preference jsloader.shareGlobal that makes it so
that JSMs share a single global, in order to reduce memory usage. The
pref is disabled by default, and will be enabled in a later bug. Each
JSM gets its own NonSyntacticVariablesObject (NSVO), which is used for
top level variable bindings and as the value of |this| within the JSM.

For the module loader, the main change is setting up the shared
global, and the NSVO for each JSM. A number of files are blacklisted
from the shared global, because they do things to the global that
would interfer with other JSMs. This is detailed in
mozJSComponentLoader::ReuseGlobal().

MozReview-Commit-ID: 3qVAc1c5aMI

--HG--
extra : rebase_source : fe7e2672be8d09d6b7cec25e08cd464ff3cd6573
2017-07-18 14:47:27 -07:00
Ted Campbell
3d936e31cf Bug 1394490 - Javascript loader environments test. r=kmag
This are some unit tests to track regressions in the environment
behavior exposed to embeddings for various javascript loaders inside
Gecko.

MozReview-Commit-ID: 8pn56Skwbat
2017-09-06 13:43:55 -04: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
Kris Maglione
b3ba0520ee Bug 1396449: Part 1 - Use WebExtensionPolicy objects in extension content principals. r=krizsa
Going through the extension policy service rather than using
WebExtensionPolicy objects directly adds a lot of unnecessary overhead to
common operations on extension principals, and also makes the code more
complicated than it needs to be.

We also use weak references to policy objects here, since principals should
ideally lose as much of their elevated privileges as possible once the
extension instance that created them has been destroyed (which is something we
couldn't handle easily when we simply tracked ID strings).

MozReview-Commit-ID: KDNvVdvLkIt

--HG--
extra : rebase_source : 1b567919d2461bd0315d1a7d89f330cbd585f579
2017-09-05 11:04:43 -07:00
Kris Maglione
f749e93f73 Bug 1363482: Part 6 - Add Cu.readFile helper to access the file preloader from JS. r=bholley
MozReview-Commit-ID: B7kSvhxbL4f

--HG--
extra : rebase_source : 3d9e11f6eba70e41786bf008eee8ec37ac4caec6
2017-08-31 17:02:06 -07:00
Kris Maglione
c4a2fd3bfb Bug 1363482: Part 2 - Allow pre-loading file and JAR entry contents off-thread during startup. r=erahm
MozReview-Commit-ID: 8bKzYpXBQvT

--HG--
extra : rebase_source : 6750d471a0a39338b5145e2dab9d953b4c30a63f
2017-08-30 15:47:17 -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
Sebastian Hengst
43bc951ac7 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: ES9rKhiQo10
2017-09-01 10:38:51 +02:00
Kris Maglione
6bad4f8ef7 Bug 1366511: Part 3 - Add mozilla::ToResult() to convert other result types to equivalent Result. r=nbp,ehsan
Also adds a mozilla/ResultExtensions.h header to define the appropriate
conversion functions for nsresult and PRResult. This is in a separate header
since those types are not available in Spidermonkey, and this is the pattern
other *Extensions.h headers follow.

Also removes equivalent NS_TRY macros and WrapNSResult inlines that served the
same purpose in existing code, and are no longer necessary.

MozReview-Commit-ID: A85PCAeyWhx

--HG--
extra : rebase_source : a5988ff770888f901dd0798e7717bcf6254460cd
2017-08-29 21:28:31 -07:00
Kris Maglione
c9899cb3fa Bug 1366511: Part 2 - Allow autoconverting Err(nsresult) to nsresult. r=ehsan,nbp
This allows MOZ_TRY and MOZ_TRY_VAR to be transparently used in XPCOM methods
when compatible Result types are used.

Also removes a compatibility macro in SimpleChannel.cpp, and an identical
specialization in AddonManagerStartup, which are no longer necessary after
this change.

MozReview-Commit-ID: 94iNrPDJEnN

--HG--
extra : rebase_source : 24ad4a54cbd170eb04ded21794530e56b1dfbd82
2017-08-29 21:28:22 -07:00
Bevis Tseng
215842a23c Bug 1392500 - Name the users of setTimeout() in Timer.jsm. r=billm,mccr8
1. Make nsINamed queriable on WrappedJSHolder.
2. Identify callers via |Cu.generateXPCWrappedJS(aCallback).QueryInterface(Ci.nsINamed).name|.

--HG--
extra : amend_source : 5d4201059f66e46c869c30a963921b6f7b91c389
2017-08-24 14:56:18 +08:00
Blake Kaplan
d383834094 Bug 1376507 - Handle a list of contexts instead of a single context. r=billm
This might be prematurely optimized as it uses two lists (one list of active
contexts and one list of inactive contexts) but I was really attracted by the
idea of being able to answer questions like "is any context active" by only
looking at a single context and not having to iterate the whole list every
time we needed to do anything.

It is really important that nobody touches any of the timestamps (or the
mActive member) outside of the Watchdog lock. I thought about trying to
encapsulate that data in its own class, but that felt like overkill. Let me
know if you disagree.

There are still a couple of uses of XPCJSContext::Get that probably need to be
stamped out, but I think doing so will depend on the details of how we map
JSContexts to XPCJSContext (and XPCJSRuntimes). I think that should wait for a
separate bug.

MozReview-Commit-ID: 9UZlh7Jutne

--HG--
extra : rebase_source : 039b50bc70547b03bc0724435de0a10a29fcf85e
2017-08-28 16:05:11 -07:00
Blake Kaplan
2c3b159a1a Bug 1376507 - Move state onto XPCJSContext. r=billm
The current code assumes it can store data about "the" XPCJSContext on the
WatchdogManager singleton. Once we have more than one XPCJSContext running
around, that won't be possible. This moves the needed data onto the
XPCJSContext itself and gives the WatchdogManager the proper context to
operate on.

MozReview-Commit-ID: AxyFKp9LmH3

--HG--
extra : rebase_source : 113e3b8986563016d43b25e753bde61f7af49291
2017-08-23 17:40:09 -07:00
Wes Kocher
e31150aea5 Backed out 2 changesets (bug 1376507) for build bustage a=backout
Backed out changeset 266611b269cc (bug 1376507)
Backed out changeset 04ecce0d1392 (bug 1376507)

MozReview-Commit-ID: JC6tERhgDoS
2017-08-31 17:08:29 -07:00
Blake Kaplan
c4cdfbe15a Bug 1376507 - Handle a list of contexts instead of a single context. r=billm
This might be prematurely optimized as it uses two lists (one list of active
contexts and one list of inactive contexts) but I was really attracted by the
idea of being able to answer questions like "is any context active" by only
looking at a single context and not having to iterate the whole list every
time we needed to do anything.

It is really important that nobody touches any of the timestamps (or the
mActive member) outside of the Watchdog lock. I thought about trying to
encapsulate that data in its own class, but that felt like overkill. Let me
know if you disagree.

There are still a couple of uses of XPCJSContext::Get that probably need to be
stamped out, but I think doing so will depend on the details of how we map
JSContexts to XPCJSContext (and XPCJSRuntimes). I think that should wait for a
separate bug.

MozReview-Commit-ID: 9UZlh7Jutne

--HG--
extra : rebase_source : a927511fbf5a7bbdb75f616b751ec3fb51e76903
2017-08-28 16:05:11 -07:00
Blake Kaplan
5c7a14294c Bug 1376507 - Move state onto XPCJSContext. r=billm
The current code assumes it can store data about "the" XPCJSContext on the
WatchdogManager singleton. Once we have more than one XPCJSContext running
around, that won't be possible. This moves the needed data onto the
XPCJSContext itself and gives the WatchdogManager the proper context to
operate on.

MozReview-Commit-ID: AxyFKp9LmH3

--HG--
extra : rebase_source : 113e3b8986563016d43b25e753bde61f7af49291
2017-08-23 17:40:09 -07:00
Kris Maglione
fdbe5511ae Bug 1394556: Part 2 - Compile all JSM/module scripts in strict mode. r=Mossop
MozReview-Commit-ID: 5BLvaHEFCqv

--HG--
extra : rebase_source : f28cdc2acf5f0c26885feeb48105513f2bf6f5ef
extra : histedit_source : 1ead5f8843a091aa0beba4ccb26681ac2078e934
2017-08-28 11:39:06 -07: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
Masatoshi Kimura
452d3a0896 Bug 1098412 - Remove __iterator__ implementation. r=luke
MozReview-Commit-ID: 6qqSSrB4Vvh

--HG--
extra : rebase_source : b8e6ef46d6bae1aecfe3874d81bd537e506bdba3
2017-08-24 22:17:40 +09:00