Commit Graph

6087 Commits

Author SHA1 Message Date
Jan de Mooij
a70dbf7123 Bug 1119777 - Remove non-standard Function.prototype.isGenerator. r=arai,kmag 2017-11-03 17:27:43 +01:00
Sebastian Hengst
68106833b3 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: xcHQOq7Rbv
2017-11-02 22:59:04 +01:00
Boris Zbarsky
0bbe6f4940 Bug 1412741. Back out the fix for bug 1381408, because that change doesn't look like it's web-compatible. r=peterv
MozReview-Commit-ID: LSYYAt0bAkT
2017-11-02 13:02:55 -04:00
David Keeler
6034b39937 bug 1357815 - 3/4: support SHA256 in PKCS#7 signatures on add-ons r=dveditz,jcj
As a result of this patch, the hash algorithm used in add-on signature
verification will come from the PKCS#7 signature. If SHA-256 is present, it will
be used. SHA-1 is used as a fallback. Otherwise, the signature is invalid.

This means that, for example, if the PKCS#7 signature only has SHA-1 but there
are SHA-256 hashes in the signature file and/or manifest file, only the SHA-1
hashes in the signature file and manifest file will be used, if they are present
(and verification will fail if they are not present). Similarly, if the PKCS#7
signature has SHA-256, there must be SHA-256 hashes in the signature file and
manifest file (even if SHA-1 is also present in the PKCS#7 signature).

MozReview-Commit-ID: K3OQEpIrnUW

--HG--
extra : rebase_source : 704a2a18e166bfaf3e3d944d13918054bd012000
2017-10-24 15:27:53 -07:00
Benjamin Bouvier
3f6c053b6e Bug 1391633: Remove the JS_AOT_USAGE telemetry value; r=luke
The use counters JS_ASMJS and JS_WASM will measure usage in a more interesting
fashion.

MozReview-Commit-ID: BhZTWKN1oTQ

--HG--
extra : rebase_source : 5ffc84b34418a2422afd6384f8ebbe67b94c6717
2017-08-18 16:11:15 +02:00
Margareta Eliza Balazs
a63fdbeabb Merge inbound to mozilla-central r=merge a=merge 2017-10-31 12:46:19 +02:00
Chris Peterson
1df202b177 Bug 1412048 - Replace NS_RUNTIMEABORT("...") with MOZ_CRASH("..."). r=froydnj
And remove unreachable code after MOZ_CRASH().

MozReview-Commit-ID: 6ShBtPRKYlF

--HG--
extra : rebase_source : 0fe45a59411bda663828336e2686707b550144ae
extra : source : 8473fd7333d2abe1ea1cc176510c292a5b34df45
2017-10-24 23:30:31 -07:00
Kris Maglione
316ad3a257 Bug 1404743: Add better diagnostic crash reasons for URLPreloader failure. r=mccr8 data-r=rweiss
The crash reports for this section of code suggest that in some cases, we're
ending up with a null Omnijar archive when trying to pre-load files. Since the
pre-load file list is determined in the previous session, and the startup
cache (where the pre-load list is stored) is cleared whenever the build ID
changes, it should never be possible for the given omnijar archive to be
missing here.

These crashes also tend to appear in conjunction with crashes due to failures
in the GetSharedGlobal function, and may have a similar cause.

This change adds better diagnostic information to these crashes, and should at
least tell us which omnijar archive we're failing to get, and the archive path
that caused us to load that archive. It may not tell us much, but it may point
to data corruption, or provide some other clues.

MozReview-Commit-ID: EKq3r4eG5ii

--HG--
extra : rebase_source : 745f99b8d5d7fbbf8511b62082d224899cdff947
2017-10-29 19:12:37 -07:00
Kris Maglione
6e74abe6ee Bug 1403348: Add debugging assertions for more AsyncStartup failure modes. r=baku
Since we don't currently know where or how loading the service is failing, we
need logging in two places:

1) In ServiceWorkerRegistrar, which will tell us about any JS errors that
occur in the factory constructor.

2) In the XPConnect module loader, which will tell us about any JS errors
which happen while loading the top-level module script.

If the load fails due to a non-JS error, we'll simply get a nsresult failure
code, which well be less informative, but will still tell us something about
the failure mode.

MozReview-Commit-ID: 1CsDegJfiho

--HG--
extra : rebase_source : c998e0393d3cb8aca008da47dfce985d0c3affb6
2017-10-29 18:17:34 -07:00
Kris Maglione
257d9118dc Bug 1409249: Require singleton constructors to return explicit already_AddRefed. r=froydnj
Right now, NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR expects singleton
constructors to return already-addrefed raw pointers, and while it accepts
constructors that return already_AddRefed, most existing don't do so.

Meanwhile, the convention elsewhere is that a raw pointer return value is
owned by the callee, and that the caller needs to addref it if it wants to
keep its own reference to it.

The difference in convention makes it easy to leak (I've definitely caused
more than one shutdown leak this way), so it would be better if we required
the singleton getters to return an explicit already_AddRefed, which would
behave the same for all callers.


This also cleans up several singleton constructors that left a dangling
pointer to their singletons when their initialization methods failed, when
they released their references without clearing their global raw pointers.

MozReview-Commit-ID: 9peyG4pRYcr

--HG--
extra : rebase_source : 2f5bd89c17cb554541be38444672a827c1392f3f
2017-10-16 21:08:42 -07:00
Rofael Aleezada
626c4563b7 Bug 818634 - Remove support for Date.prototype.toLocaleFormat. r=gandalf, r=anba 2017-10-18 21:51:32 -05:00
Tom Schuster
d3b457113a Bug 638054 - Remove or fix tests outside JS using watch/unwatch. r=bz,fitzgen 2017-10-24 20:48:14 +02:00
Andrew McCreight
cd3f453103 Bug 1407735 - Make the JS loader XPCOM component use a singleton. r=kmag
mozJSComponentLoader is created using XPCOM. However, you can only
call it once or it'll crash. This patch fixes that by using a
singleton macro.

MozReview-Commit-ID: Bq2k7nv9dKA

--HG--
extra : rebase_source : d2008da7628edf5db283c8a44c17e741f7ae0a96
2017-10-23 13:53:58 -07:00
Nicholas Nethercote
3842370ed8 Bug 1405541 (attempt 2) - Split AUTO_PROFILER_LABEL_DYNAMIC into three macros. r=mstange.
It's easy to mess up the scoping so that (a) the label is pushed and then
immediately popped, and/or (b) the string doesn't live long enough. It's also
easy to do a utf16-to-utf8 conversion unnecessarily when the profiler is
inactive. This patch splits that macro into three new ones that are harder to
mess up.

- AUTO_PROFILER_LABEL_DYNAMIC_CSTR: same as current.
- AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING: for nsCStrings.
- AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING: for nsStrings.

--HG--
extra : rebase_source : 3e2bbec4737b696e1c86579ae54be4cb3186c100
2017-10-13 16:12:57 +11:00
Boris Zbarsky
6a07397359 Bug 1354730. Disable named property object (aka global scope polluter) behavior for all Xrays. r=kmag
MozReview-Commit-ID: KmbXFfSzH0N
2017-10-16 10:58:09 -04:00
Nicholas Nethercote
78030c0e7b Bug 1409598 - Change nsIXPCScriptable::className and nsIClassInfo::{contractID,classDescription} from string to AUTF8String. r=froydnj.
This lets us replace moz_xstrdup() of string literals with AssignLiteral(),
among other improvements.

--HG--
extra : rebase_source : 9994d8ccb4f196cf63564b0dac2ae6c4370defb4
2017-10-18 13:17:26 +11:00
Matt Howell
da35b53add Bug 1348087 Part 2 - Add a new XPC_MSG_DEF required by tests for this bug. r=rstrong
MozReview-Commit-ID: 7kmTO18DZUZ

--HG--
extra : source : d551141c88de846330e007973d0d6ad02d6a961e
2017-09-08 14:00:27 -07:00
Jason Orendorff
c51aa0ae1e Bug 1407414 - Crash in js::GetOwnPropertyDescriptor. r=bz
--HG--
extra : rebase_source : 809c17494fa0aafcc0964593510457d1b3712ddc
2017-10-17 16:25:40 +01:00
Nicholas Nethercote
7f098bdb9c Bug 1409227 (part 4) - Replace nsMemory::Clone(id, sizeof(nsID)) with nsID::Clone(id). r=mccr8.
This change requires introducing nsID::Clone(). Because it's infallible, the
patch also removes some redundant failure-handling code. (nsMemory::Clone() is
also infallible, so this code was redundant even before this change.)

--HG--
extra : rebase_source : ef22757d3fa814320490bf7e19e822b8f0c4bdc3
2017-10-18 10:39:20 +11:00
Nicholas Nethercote
1fdf1c46d3 Bug 1409227 (part 3) - Replace nsMemory::Clone(s, sizeof(s)) with moz_xstrdup(s). r=froydnj.
The new code is slightly less efficient because it requires measuring the
string length, but these strings are all short so it shouldn't matter.

Note that the case in DataToString() is a little different. The std::min() that
was there appears to be excessive caution -- this code is always printf'ing
some kind of number, so 32 chars should never be reached -- but it was bogus
anyway, because if 32 was exceeded then (a) we would have overflowed `buf`, and
(b) we'd be returning a non-null-terminated string.

--HG--
extra : rebase_source : b666ad72c09d8c32b98bb9abc9dce1bd0c912c9b
2017-10-17 13:28:40 +11:00
Nicholas Nethercote
3076238153 Bug 1409227 (part 2) - Replace nsMemory::Clone(s, strlen(s)+1) with moz_xstrdup(s). r=erahm.
They are equivalent -- both infallible, both requiring measuring the length of
the string -- but moz_xstrdup is much more readable. (One place deals with
16-bit strings and so uses NS_strdup instead, which is also infallible.)

The patch also removes some failure-path code that will never execute due to
the infallibility.

--HG--
extra : rebase_source : 115574cf55db90b60e6bee59e5dc6ee409374159
2017-10-17 13:09:29 +11:00
Boris Zbarsky
32ad6dfdd7 Back out bug 1354730 to reopen CLOSED TREE.
MozReview-Commit-ID: RzUofi384C
2017-10-16 14:34:23 -04:00
Boris Zbarsky
211cfa1cfd Bug 1354730. Disable named property object (aka global scope polluter) behavior for all Xrays. r=kmag
MozReview-Commit-ID: KmbXFfSzH0N
2017-10-16 10:58:09 -04:00
Kris Maglione
bd6d63772a Bug 1407428: Hand out a const array reference for expanded principal whiteList. r=krizsa
The current API makes the life time and ownership of the result array unclear
without careful reading. The result array is always owned by the principal,
and its lifetime tied to the lifetime of the principal itself. Returning a
const array reference makes this clear, and should prevent callers from
accidentally modifying the returned array.

MozReview-Commit-ID: 3f8mhynkKAj

--HG--
extra : source : 237acf2879f6222bc4b076c377bf026d18a6ebef
extra : amend_source : dfaf6e88e3c4758f7fdcf7fb422d457edafab1b7
2017-10-10 15:00:16 -07:00
Sebastian Hengst
11a2b8ef67 Backed out changeset 237acf2879f6 (bug 1407428) for frequent crashes, e.g. in xpcshell's test_bug248970_cookie.js. r=backout on a CLOSED TREE
--HG--
extra : amend_source : 1ccac4fb953566239cba8db7d6f8bdca4ce48b35
2017-10-16 00:00:15 +02:00
Kris Maglione
7d8f8ea3d6 Bug 1407428: Hand out a const array reference for expanded principal whiteList. r=krizsa
The current API makes the life time and ownership of the result array unclear
without careful reading. The result array is always owned by the principal,
and its lifetime tied to the lifetime of the principal itself. Returning a
const array reference makes this clear, and should prevent callers from
accidentally modifying the returned array.

MozReview-Commit-ID: 3f8mhynkKAj

--HG--
extra : rebase_source : d2a5e0862f8c964fb5a3e46b50c2e9629b218699
extra : amend_source : 27d7a7ef5da6fe2aa1104009b6ee067465db73e1
2017-10-10 15:00:16 -07:00
Brian Hackett
ed36a3172e Bug 1355109 - Add IC for property reads on xrays, r=jandem,bz.
MozReview-Commit-ID: 942dk0gNh23
2017-07-21 07:49:53 -07:00
Jason Orendorff
2db41f075d Bug 1396466 - Remove Xray expando chains from the weakmap when transplanting nodes. r=bz
--HG--
extra : rebase_source : aa90385160666b155cc8dbad63bcfa34d3e50d32
extra : amend_source : 6b9ebda268a6198f5e0143e5449f9d62ef1aed76
2017-10-10 10:42:18 -05:00
Sebastian Hengst
051f888cef Backed out changeset 759a43ebc6bf (bug 1405541) for asserting in devtools/client/performance/test/browser_perf-console-record-03.js on Windows 7. r=backout
--HG--
extra : amend_source : 3df3e75c561cbc42db104ec1a6f6026ef021e3c7
2017-10-11 13:15:26 +02:00
Nicholas Nethercote
add7e65972 Bug 1405541 - Split AUTO_PROFILER_LABEL_DYNAMIC into three macros. r=mstange.
It's easy to mess up the scoping so that (a) the label is pushed and then
immediately popped, and/or (b) the string doesn't live long enough. It's also
easy to do a utf16-to-utf8 conversion unnecessarily when the profiler is
inactive.

This patch splits that macro into three new ones that are harder to mess up.

- AUTO_PROFILER_LABEL_DYNAMIC_CSTR: same as current.
- AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING: for nsCStrings.
- AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING: for nsStrings.

--HG--
extra : rebase_source : 53c8b43b6a1be06d00618a133e28bf95c46a3ba3
2017-10-11 13:03:34 +02:00
Phil Ringnalda
bd5ca8f40d Backed out changeset 901a16fec9fc (bug 1405541) for Windows assertion failures
MozReview-Commit-ID: DRGWXU4Tbfk
2017-10-10 23:28:33 -07:00
Nicholas Nethercote
b23fb68ae3 Bug 1405541 - Split AUTO_PROFILER_LABEL_DYNAMIC into three macros. r=mstange.
It's easy to mess up the scoping so that (a) the label is pushed and then
immediately popped, and/or (b) the string doesn't live long enough. It's also
easy to do a utf16-to-utf8 conversion unnecessarily when the profiler is
inactive.

This patch splits that macro into three new ones that are harder to mess up.

- AUTO_PROFILER_LABEL_DYNAMIC_CSTR: same as current.
- AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING: for nsCStrings.
- AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING: for nsStrings.

--HG--
extra : rebase_source : 59f77df0124249bfd11fee3585420a17b4201d37
2017-10-04 13:44:24 +11:00
Jason Orendorff
65e620a4eb Bug 1404107 - Refactor: Move some reparenting complexity into XPConnect. r=mrbkap,r=bz
--HG--
extra : rebase_source : 817ef532b2fe67bc901339aa19d84bf571adfc71
2017-10-05 11:49:43 -05:00
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