Commit Graph

6556 Commits

Author SHA1 Message Date
Andrea Marchesini
a053cf1c15 Bug 1476306 - Moving NullPrincipal/ContentPrincipal/SystemPrincipal under mozilla namespace - part 1 - NullPrincipal, r=ckerschb 2018-07-17 21:37:48 +02:00
Jan de Mooij
ef23676856 Bug 1475699 - Support invoking JS-implemented XPIDL methods/attributes marked as [implicit_jscontext]. r=mccr8 2018-07-17 18:11:03 +02:00
Margareta Eliza Balazs
ad89a11136 Backed out 7 changesets (bug 1475228) for causing Spidermonkey rust failures on Linux x64 debug
Backed out changeset e91802969fb7 (bug 1475228)
Backed out changeset 623af73419eb (bug 1475228)
Backed out changeset bf96bd78dc11 (bug 1475228)
Backed out changeset 104817d51d1b (bug 1475228)
Backed out changeset d3829c85f650 (bug 1475228)
Backed out changeset 74d10b32b3ea (bug 1475228)
Backed out changeset dde64fbe2f0d (bug 1475228)
2018-07-17 17:57:55 +03:00
Jon Coppeard
f168d91fd3 Bug 1475228 - Allow construction of a SourceBufferHolder from a UniquePtr r=jandem r=kmag 2018-07-17 14:30:23 +01:00
Jon Coppeard
89af4d641f Bug 1475228 - Make asynchronous compile APIs take SourceBufferHolders r=jandem 2018-07-17 14:30:23 +01:00
Jon Coppeard
4bf9e8dfe9 Bug 1475228 - Make synchronous compile APIs take SourceBufferHolders exclusively r=jandem 2018-07-17 14:30:22 +01:00
Kris Maglione
30e792ee5b Bug 1473631: Part 7 - Replace pref observers with callbacks in WatchdogManager. r=njn
MozReview-Commit-ID: 7Ctch5PYQzh

--HG--
extra : rebase_source : 80f491d1502a6cce25e5fb153e1d18777b4a3b78
2018-07-05 14:30:58 -07:00
Kris Maglione
0bfdb4329f Bug 1473631: Part 0a - Make preference callbacks typesafe. r=njn
I initially tried to avoid this, but decided it was necessary given the number
of times I had to repeat the same pattern of casting a variable to void*, and
then casting it back in a part of code far distant from the original type.

This changes our preference callback registration functions to match the type
of the callback's closure argument to the actual type of the closure pointer
passed, and then casting it to the type of our generic callback function. This
ensures that the callback function always gets an argument of the type it's
actually expecting without adding any additional runtime memory or
QueryInterface overhead for tracking it.

MozReview-Commit-ID: 9tLKBe10ddP

--HG--
extra : rebase_source : 7524fa8dcd5585f5a31fdeb37d95714f1bb94922
2018-07-06 12:24:41 -07:00
Jan de Mooij
594a3aa6d4 Bug 1475177 - Change sendCommand xpcshell function to only accept plain JSFunction callbacks. r=evilpie 2018-07-16 14:02:16 +02:00
Masayuki Nakano
5c3723acb2 Bug 1475461 - part 2: Make callers of PLDHashTable::Search() const methods if possible r=Ehsan
Some callers of PLDHashTable::Search() use const_cast, some others are not
const methods due to non-const PLDHashTable::Search().

This patch removes const_cast from the former and mark some methods of the
latter const.

MozReview-Commit-ID: C8ayoi7mXc1

--HG--
extra : rebase_source : 2cba0339756e3278ba6e5f0e8a11e68217a61d34
2018-07-13 19:01:53 +09:00
Kris Maglione
03bf0b5bdd Bug 1463587: Part 2 - Add a shared-memory structured clone key-value store. r=erahm,bz
This class allows one read-write copy of a map in the parent process to share
data with multiple read-only copies in child processes. The maps only hold
onto data as structured clone blobs, and deserialize them each time a key is
read.

This commit only provides the bare-bones data structures. Follow-ups will add
bindings, change events, and automatic flushes.

MozReview-Commit-ID: LimwfmFBNOi

--HG--
extra : rebase_source : e43985c39bd1cfd05a2ad536b0d7f74db494a753
extra : source : c27295337b4c16e2a178106a3aa873d2a0e5a1f4
2018-06-22 20:35:49 -07:00
Matthew Gaudet
5d0bf9c261 Bug 1469044: [Part 2] Remove remainder of MathCache r=jandem
--HG--
extra : rebase_source : 587d69130f2c6d50ca8e14bd0ccaf7a4f58285e8
2018-07-09 16:52:16 -04:00
Jan de Mooij
c5364bf395 Bug 1473865 part 5 - Use JS::GetNonCCWObjectGlobal in xpc::WindowGlobalOrNull. r=bz 2018-07-12 16:17:44 +02:00
Jan de Mooij
7967870e29 Bug 1473865 part 4 - Use xpc::WindowOrNull instead of xpc::WindowGlobalOrNull in a few places. r=bz 2018-07-12 16:17:44 +02:00
Jan de Mooij
083d62f388 Bug 1472973 part 15 - Use JS::GetNonCCWObjectGlobal in SandboxCallableProxyHandler::call. r=bz 2018-07-12 12:14:38 +02:00
Gurzau Raul
fff6ccd0b0 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-07-12 01:08:09 +03:00
Jan de Mooij
4f7b2378dc Bug 1474273 - Add xpc::CurrentNativeGlobal and use it instead of NativeGlobal(JS::CurrentGlobalOrNull(cx)). r=bz 2018-07-11 14:07:02 +02:00
imjching
3dcc4fd573 Bug 1416066 - Use XPConnect compilation scope for some non-cached local scripts with codebase principal when preload cache is enabled. r=kmag
When we use the preload cache for some non-cached local scripts in loadSubScript,
we will keep the global that the script was compiled for alive, resulting in a
leak.

We will compile these chrome:// and resource:// scripts with codebase principal in
the XPConnect compilation scope when using mozJSSubScriptLoader to load scripts
synchronously. When the script is evaluated, it will be cloned into the target
scope to be executed. By compiling the script in a different scope, we can avoid
keeping the global that the script was compiled for originally alive.

MozReview-Commit-ID: HYSTvmPCbyR

--HG--
extra : rebase_source : 1ee540e08b9eda9046539f6f20f596732a651034
2018-07-03 21:26:04 -04:00
imjching
0c7582c716 Bug 1416066 - Enable caching for scripts with codebase URLs of about:home, about:newtab, and about:welcome. r=kmag
MozReview-Commit-ID: HC3cNVxWLe6

--HG--
extra : rebase_source : eab95e34618bf1ac856b44db89800b615c6503b8
2018-07-03 21:24:52 -04:00
imjching
cee0b1d4b8 Bug 1416066 - Make ScriptPreloader wait for content-document-loaded to fire before writing cache for privileged processes. r=kmag,mconley
MozReview-Commit-ID: 2ElKqWN0clm

--HG--
extra : rebase_source : de5f7cf1a35700659cad9efe38a49e6772564665
2018-06-22 17:29:08 -04:00
imjching
c66f4c3e82 Bug 1416066 - Delay initialization of sProcessType for child processes in ScriptPreloader since remoteType in ContentChild is not ready yet. r=kmag
MozReview-Commit-ID: FTmQMbKhlR

--HG--
extra : rebase_source : c6414c627d05ce7510a97850c143d0b8e04c852c
2018-06-22 17:07:12 -04:00
imjching
62198551fb Bug 1416066 - Update script_cache.py to support new version of startup script cache file. r=kmag
MozReview-Commit-ID: IuNZ3kjLcak

--HG--
extra : rebase_source : ef9dcd24f9311956bcae303336b874f6cc358905
2018-06-26 14:02:22 -04:00
imjching
6cb83fd0dd Bug 1416066 - Set default ProcessType in ScriptPreloader to Uninitialized and update version of startup script cache file. r=kmag
MozReview-Commit-ID: FbpMLqrFSIq

--HG--
extra : rebase_source : ffe7056cc2f70730fab0d2c006a5eb838462676d
2018-06-22 16:58:22 -04:00
Boris Zbarsky
8f7c90d6be Bug 1473149. Add an external string variant that keeps a DynamicAtom alive. r=njn,rwood
The change to call AsStatic() in SetKnownLiveAtom is drive-by performance cleanup.
2018-07-10 11:21:42 -07:00
Kris Maglione
8ff07d3c3f Bug 1472495: Don't report shared memmapped cache as explicit memory. r=erahm
MozReview-Commit-ID: 7xWJOdg3mfg

--HG--
extra : rebase_source : 8bb19b94495ae99ec1c4083cd88bd8915003886f
extra : amend_source : e72654de7148415e6999632a0da3f598648685a6
2018-06-30 16:33:50 -07:00
Andreea Pavel
2ef6a9ab83 Merge mozilla-central to mozilla-inbound. a=merge on a CLOSED TREE 2018-07-08 00:54:23 +03:00
Bobby Holley
4da035394a Bug 1447856 - Make the watchdog tests actually wait for completion. r=arai
MozReview-Commit-ID: KjvUxJSrmtk

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

--HG--
extra : moz-landing-system : lando
2018-07-07 07:20:50 +00:00
Kris Maglione
2ced7f0d8b Bug 1471091: Follow-up: Fix crash in devtools tests when they execute process scripts multiple times. r=bustage 2018-07-07 13:15:44 -07:00
Kris Maglione
8751f930ce Bug 1471091: Avoid cloning and caching process scripts. r=mccr8
We only run process scripts once per process, so there's no need to compile
them for the compilation scope, or to keep a separate cloned copy alive for
the length of the session.

This patch changes the caching behavior of message managers to compile
single-use scripts directly for the target global, and avoid caching them for
the rest of the session. It also changes the preloader to drop references to
these scripts after they've been executed and/or encoded, as appropriate.

MozReview-Commit-ID: EfKo2aYbBxl

--HG--
extra : rebase_source : aebc5812bef4413d497ac4fdb59aced00a5a4c8e
extra : absorb_source : cf5795eb0bff47d08b1ab45f002afb3f05109c93
extra : histedit_source : e92619d2a818095241c52d8f1961ccad38300d32
2018-06-29 18:07:46 -07:00
Ciure Andrei
f61df5dc45 Backed out 4 changesets (bug 1461450, bug 1471726) for linting failure xpidl.py CLOSED TREE
Backed out changeset 6e8148c1ca7f (bug 1461450)
Backed out changeset 2a02d86bc113 (bug 1461450)
Backed out changeset 1907567a85c5 (bug 1471726)
Backed out changeset c4df8eab6d1c (bug 1471726)
2018-07-07 03:12:10 +03:00
Nika Layzell
95e4893811 Bug 1471726 - Part 2: Add basic tests for jsval array codegen, r=mccr8 2018-07-06 19:53:04 -04:00
Jan de Mooij
e918a3c855 Bug 1472973 part 8 - Use JS::GetNonCCWObjectGlobal in XrayAwareCalleeGlobal. r=bz 2018-07-06 18:16:24 +02:00
Jan de Mooij
396c86f339 Bug 1472973 part 7 - Use JS::GetNonCCWObjectGlobal in mozJSComponentLoader::FindTargetObject. r=bz
js::GetJSMEnvironmentOfScriptedCaller returns either nullptr or a NonSyntacticVariablesObject.
2018-07-06 18:16:24 +02:00
Jan de Mooij
b6f0af2059 Bug 1472973 part 6 - Use JS::GetNonCCWObjectGlobal in subscript loader. r=bz 2018-07-06 18:16:24 +02:00
Jan de Mooij
09149a5c4a Bug 1472973 part 3 - Remove some GetGlobalForObjectCrossCompartment calls on globals/WindowProxy. r=bz 2018-07-06 18:16:23 +02:00
Jan de Mooij
a51f9bdda9 Bug 1472973 part 2 - Use JS::GetNonCCWObjectGlobal in some functions where we unwrapped the object. r=bz 2018-07-06 18:16:23 +02:00
Jan de Mooij
3201853e80 Bug 1468752 part 4 - Remove JS_GetGlobalForObject. r=bz 2018-07-06 12:54:00 +02:00
Christian Holler
2a3b6f8ca3 Bug 1471532 - Support Windows in ASan Nightly Reporter builds. r=froydnj
MozReview-Commit-ID: AK2dBOgoazY

--HG--
extra : rebase_source : 1065a2f3b10913ac574cf1187d717f21fc2994e6
extra : histedit_source : 3042e51e496e4e8593b367d89332a9199bf3999c
2018-06-27 11:19:00 +02:00
Olli Pettay
b053857985 Bug 1472431, nodes in Shadow DOM aren't orphan, if they are in composed document, r=mccr8 2018-07-01 22:28:17 +03:00
Kris Maglione
2bbae5374b Bug 1470365: Part 1 - Add a compact, read-only, shared-memory string map class. r=erahm
This class implements a shared memory key-value store that fits into a single
memory mapped segment. All of the runtime data for its instances are stored in
the shared memory region, which means that memory overhead for each instance
in each process is only a few bytes.

Importantly, the key and value strings returned by this class are also
pointers into the shared memory region, which means that once an instance is
created, its memory cannot be unmapped until process shutdown.

For the uses I intend to put it to, this is a reasonable constraint. If we
need to use it for shorter-lived maps in the future, we can add an option to
return non-literal dependent strings that will be copied if they need to be
kept alive long term.

MozReview-Commit-ID: 5BwAaDsb7HS

--HG--
extra : rebase_source : b472fe628018f88a2c4d6b3de4b7143aeca55e14
extra : absorb_source : 5cdeb568cfd2b4a5a767191402e699e61e653b3b
2018-06-29 22:50:41 -07:00
Kris Maglione
fd093e7cca Bug 1463587: Part 1 - Add helper class for creating snapshots of shared memory regions. r=jld,erahm
This class allows us to map a read-write shared memory region, and then safely
remap it read-only, so that it can be shared with sandboxed content processes.

MozReview-Commit-ID: 2PJMQgOwA4V

--HG--
extra : rebase_source : c556cabfa7d379a91dc9ef7171ac0a7d7d8fb32e
extra : absorb_source : e78e304ed95891c694050f79a0bb5d40d11ee884
2018-06-22 20:30:23 -07:00
Andrew Swan
07dcc1c764 Bug 1451519 Convert specialpowers to a webextension r=kmag
This is a quick-and-dirty port.  It might be nice to replace
SpecialPowersObserver with the webextensions content script injection
system at some point, but that isn't practical right now (since WE experiments
cannot implement new APIs visible to content scripts).

MozReview-Commit-ID: GinCu3VcbWK

--HG--
rename : testing/specialpowers/bootstrap.js => testing/specialpowers/api.js
extra : rebase_source : 0faf7d21c8868c957ddc7fede0d56809f27dc161
extra : intermediate-source : ffb9ce93b92dd6396bfe038d3f6a8bcf929ec277
extra : source : cca596eadd0437dc75b75c119b6c7a405805f703
2018-06-27 13:10:51 -07:00
Coroiu Cristina
896ef35dfd Backed out changeset 722113b8204d (bug 1451519) for browser-chrome failures at browser/base/content/test/performance/browser_startup_content.js on a CLOSED TREE
--HG--
rename : testing/specialpowers/api.js => testing/specialpowers/bootstrap.js
2018-06-29 22:13:46 +03:00
Andrew Swan
849bbbb42d Bug 1451519 Convert specialpowers to a webextension r=kmag
This is a quick-and-dirty port.  It might be nice to replace
SpecialPowersObserver with the webextensions content script injection
system at some point, but that isn't practical right now (since WE experiments
cannot implement new APIs visible to content scripts).

MozReview-Commit-ID: GinCu3VcbWK

--HG--
rename : testing/specialpowers/bootstrap.js => testing/specialpowers/api.js
extra : rebase_source : 8be131e80d95a6bf6e86c994fdfa40c14ba610eb
extra : source : cca596eadd0437dc75b75c119b6c7a405805f703
2018-06-27 13:10:51 -07:00
André Bargull
781fc92292 Bug 1471900: Change return type of JS_EncodeStringToBuffer to bool. r=jandem 2018-06-28 07:35:20 -07:00
Cosmin Sabou
a612a6fdf5 Merge mozilla-central to mozilla-inbound. a=merge 2018-06-28 13:13:46 +03:00
Cosmin Sabou
f4b3baf021 Merge mozilla-inbound to mozilla-central. a=merge 2018-06-28 13:04:23 +03:00
imjching
4867775c4c Bug 1469072 - Add infrastructure to move Activity Stream into its own content process. r=kmag,mconley
Summary:
This patch adds the infrastructure to move Activity Stream (about:newtab, about:home,
and about:welcome) into its own special content process - the privileged content
process. This feature of running Activity Stream in the privileged content process
is disabled by default. (See "browser.tabs.remote.separatePrivilegedContentProcess"
preference.) We can deal with other about: pages in a follow-up.

Reviewers: mconley

Tags: #secure-revision

Bug #: 1469072

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

MozReview-Commit-ID: 5gIrP4LxcIt

--HG--
extra : rebase_source : d43c411ae60aad3d5a3a496e6729de0b547b4acd
2018-06-20 14:04:51 -04:00
Kris Maglione
6dd32d12e3 Bug 1442737: Use shared JSM global for compilation and privileged junk scopes. r=bholley
MozReview-Commit-ID: 3rLgxQVtc0X

--HG--
extra : rebase_source : 9486cd685b4db0f5f282a8cd362a05056064f32e
extra : intermediate-source : a1db50f691f000a0261a57d39da75675592ada9c
extra : source : 8477472996e06d06a21d8e602e4a92d0ec130ea3
2018-06-24 19:16:33 -07:00
Kris Maglione
14d61004ed Bug 1470793: Stop eagerly XDR encoding scripts in the preloader cache. r=erahm
MozReview-Commit-ID: 2e85c34zt8v

--HG--
extra : rebase_source : 82b750185b598418d2ad0842090fc53bfbeedde3
2018-06-24 18:37:50 -07:00