Commit Graph

67 Commits

Author SHA1 Message Date
Kris Maglione
79ddb0a1df Bug 1484373: Part 12 - Use policy object rather than keeping serialized extension data alive. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D3702
2018-08-18 00:10:53 -07:00
Kris Maglione
6127e71a29 Bug 1484373: Part 11 - Fold mostly-empty DocumentManager singleton into ExtensionManager. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D3701
2018-08-17 22:35:21 -07:00
Kris Maglione
f77119a0c9 Bug 1484373: Part 10 - Move some receiveMessage code to ExtensionContent.jsm. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D3700
2018-08-17 22:20:45 -07:00
Kris Maglione
8e4c378705 Bug 1484373: Part 9 - Move more extension page matching logic into policy service. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D3699
2018-08-17 22:30:17 -07:00
Kris Maglione
7c0574d8c5 Bug 1484373: Part 8 - Use generateSingletonFactory for process script singleton. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D3698
2018-08-17 21:23:36 -07:00
Kris Maglione
78b2deeb12 Bug 1484373: Part 7 - Minimize duplicated code in process script message handler. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D3697
2018-08-17 21:19:08 -07:00
Kris Maglione
3f9620ae74 Bug 1484373: Part 6 - Minimize the amount of JS processing required to init extension policies. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D3696
2018-08-17 21:14:10 -07:00
Kris Maglione
dfecb8145f Bug 1484373: Part 5 - Minimize the amount of content script options processing we do in child processes r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D3695
2018-08-17 20:02:52 -07:00
Kris Maglione
ac78f9effb Bug 1484373: Part 4 - Move more content script injection logic into policy service. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D3694
2018-08-17 22:09:23 -07:00
Boris Zbarsky
a93cf3d175 Bug 1479569 part 2. Use the new messageManager getter on docshell. r=kmag
I generally tried to preserve the behavior of consumers where they treated an
exception from getInterface(Ci.nsIContentFrameMessageManager) as a signal to use
some sort of fallback.

I did change the behavior of consumers that walked up to the root same-type
docshell before getting the message manager to just get it directly from the
docshell they have.  Please review those parts carefully, and let me know if you
want me to ask some subject area experts to review those.
2018-08-02 23:49:09 -04:00
Csoregi Natalia
5bd0ca7b64 Backed out 3 changesets (bug 1479569) for devtools/client/responsive.html failures. CLOSED TREE
Backed out changeset e123d0aa911c (bug 1479569)
Backed out changeset b828a58404e5 (bug 1479569)
Backed out changeset 97041ef8f311 (bug 1479569)
2018-08-03 10:39:12 +03:00
Boris Zbarsky
3344641137 Bug 1479569 part 2. Use the new messageManager getter on docshell. r=kmag
I generally tried to preserve the behavior of consumers where they treated an
exception from getInterface(Ci.nsIContentFrameMessageManager) as a signal to use
some sort of fallback.

I did change the behavior of consumers that walked up to the root same-type
docshell before getting the message manager to just get it directly from the
docshell they have.  Please review those parts carefully, and let me know if you
want me to ask some subject area experts to review those.
2018-08-02 23:49:09 -04:00
Kris Maglione
e97c582e3f Bug 1463291: Move docShell getter from Document to Window. r=bz
DocShells are associated with outer DOM Windows, rather than Documents, so
having the getter on the document is a bit odd to begin with. But it's also
considerably less convenient, since most of the times when we want a docShell
from JS, we're dealing most directly with a window, and have to detour through
the document to get it.

MozReview-Commit-ID: LUj1H9nG3QL
2018-05-21 16:58:23 -07:00
Kris Maglione
9ba14892f2 Bug 1463016: Part 5 - Add domWindow property to DocShellTreeItem and update callers to use it. r=nika
MozReview-Commit-ID: FRRAdxLHRtG
2018-05-20 18:10:16 -07:00
Narcis Beleuzu
749f83cc65 Backed out 2 changesets (bug 1463016, bug 1463291) for geckoview failures
Backed out changeset fcfb99baa0f0 (bug 1463291)
Backed out changeset 0d69b4fb1ed4 (bug 1463016)
2018-07-29 03:55:23 +03:00
Kris Maglione
6dcf46ad68 Bug 1463291: Move docShell getter from Document to Window. r=bz
DocShells are associated with outer DOM Windows, rather than Documents, so
having the getter on the document is a bit odd to begin with. But it's also
considerably less convenient, since most of the times when we want a docShell
from JS, we're dealing most directly with a window, and have to detour through
the document to get it.

MozReview-Commit-ID: LUj1H9nG3QL
2018-05-21 16:58:23 -07:00
Kris Maglione
86fbdd6653 Bug 1463016: Part 5 - Add domWindow property to DocShellTreeItem and update callers to use it. r=nika
MozReview-Commit-ID: FRRAdxLHRtG
2018-05-20 18:10:16 -07:00
Rob Wu
dd63a22f3d Bug 1459750 - Rename extension to policy where applicable r=mixedpuppy
This only changes some variable names. There is still work to do,
e.g. renaming "extension" in WebExtensionContentScript to "policy".
That will be handled in bug 1441886.

MozReview-Commit-ID: AqQErPyeFe7
2018-05-07 23:45:44 +02:00
Kris Maglione
7647472b40 Bug 1470783: Migrate extensions framework to use sharedData for cross-process data. r=zombie
initialProcessData has the unfortunate side-effect of sending an entire copy
of all of its data to all content processes, and eagerly decoding it. For the
extension framework, this means that we wind up loading an entire copy of all
of our schema data, and of every extension's manifest and locale data, into
every process, even if we'll never need it.

The sharedData helper allows us to store an encoded copy of that data in a
shared memory region, and clone it into the current process only when we need
it, which can be a significant savings. For screenshots alone, it saves about
15K on locale and manifest data per content process, plus the size we save on
not copying schema data.

MozReview-Commit-ID: KkIOoLsBd99
2018-06-24 16:34:44 -07:00
Margareta Eliza Balazs
a757412ecc Backed out 10 changesets (bug 1470783, bug 1463587) for causing multiple leakcheck failures on a CLOSED TREE
Backed out changeset cd2080bd727a (bug 1463587)
Backed out changeset 5866137afd9a (bug 1463587)
Backed out changeset d64e1c150db2 (bug 1463587)
Backed out changeset 669f084e8914 (bug 1463587)
Backed out changeset 8074c985095c (bug 1470783)
Backed out changeset 49ed13196e9f (bug 1463587)
Backed out changeset c052042a66cf (bug 1463587)
Backed out changeset cebf1f055d1d (bug 1463587)
Backed out changeset 2ebaf5f8c605 (bug 1463587)
Backed out changeset c27295337b4c (bug 1463587)
2018-07-12 11:27:45 +03:00
Kris Maglione
a39f75a80e Bug 1470783: Migrate extensions framework to use sharedData for cross-process data. r=zombie
initialProcessData has the unfortunate side-effect of sending an entire copy
of all of its data to all content processes, and eagerly decoding it. For the
extension framework, this means that we wind up loading an entire copy of all
of our schema data, and of every extension's manifest and locale data, into
every process, even if we'll never need it.

The sharedData helper allows us to store an encoded copy of that data in a
shared memory region, and clone it into the current process only when we need
it, which can be a significant savings. For screenshots alone, it saves about
15K on locale and manifest data per content process, plus the size we save on
not copying schema data.

MozReview-Commit-ID: KkIOoLsBd99
2018-06-24 16:34:44 -07:00
Kris Maglione
bb663b9c15 Bug 1471102: Move more code out of ExtensionUtils.jsm. r=aswan
MozReview-Commit-ID: Fqlv5BRuuW8
2018-06-25 19:30:21 -07:00
Tomislav Jovanovic
8799df59dc Bug 1466349 part 1 - Enable passing addonData flags to embedded WE, r=aswan
also fix permission matcher creation in child process

MozReview-Commit-ID: Ht9rEKwaUsp
2018-06-05 20:26:24 +02:00
Kris Maglione
93c85d42c4 Bug 1456485: Part 2 - Allow extensions with the mozillaAddons permission to match restricted schemes. r=zombie
The schema handling for this is currently a bit ugly, for the sake of
simplifying uplift. In the figure, we should find a way to change the schema
pattern matching based on whether or not the extension is privileged.

MozReview-Commit-ID: CU9WR2Ika6k
2018-05-09 18:55:59 -07:00
Kris Maglione
fd7e9e6a69 Bug 1456035: Part 4 - Convert callers of XPCOMUtils.generateQI to ChromeUtils.generateQI. r=mccr8
This also removes any redundant Ci.nsISupports elements in the interface
lists.

This was done using the following script:

acecb401b7/processors/chromeutils-generateQI.jsm

MozReview-Commit-ID: AIx10P8GpZY
2018-04-22 20:55:06 -07:00
Kris Maglione
4c402a31f9 Bug 1451215: Run codespell on code. r=aswan
MozReview-Commit-ID: HIilZTKcQUY
2018-04-03 22:22:07 -07:00
Andrew McCreight
272cee1e65 Bug 1432992, part 1 - Remove definitions of Ci, Cr, Cc, and Cu. r=florian
This patch was autogenerated by my decomponents.py

It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.

It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.

It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)

MozReview-Commit-ID: DeSHcClQ7cG
2018-02-06 09:36:57 -08:00
Luca Greco
2d6facde38 Bug 1420485 - Reduce memory usage related to the tabs.insertCSS cssCode urls. r=mixedpuppy
This patch introduces a cache of blob urls which are related to the cssCode
injected by the extensions using tabs.insertCSS, which aims to reduce the
amount of memory used by the extensions to store the cssCode injected
into the tabs and their subframes in the content child process.

The generated Blob URL are associated to the extension principal,
so that it is easier to identify in the about:memory reports
which is extension that is using the cached data.

MozReview-Commit-ID: ERhR5nmVMqY
2017-11-24 19:17:33 +01:00
Kris Maglione
0bb74efdf1 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl
2018-01-29 15:20:18 -08:00
Cosmin Sabou
f09d6d985d Backed out 3 changesets (bug 1431533) for Android mochitest failures on testEventDispatcher on a CLOSED TREE
Backed out changeset a1eca62826a1 (bug 1431533)
Backed out changeset 34c999fa006b (bug 1431533)
Backed out changeset e2674287e57f (bug 1431533)
2018-01-30 07:17:48 +02:00
Kris Maglione
fd67f090b2 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl
2018-01-29 15:20:18 -08:00
Brindusan Cristian
483ba301cb Backed out 2 changesets (bug 1431533) for ESlint failures on a CLOSED TREE
Backed out changeset 6e56f4c8843e (bug 1431533)
Backed out changeset 12fc4dee861c (bug 1431533)
2018-01-30 02:32:43 +02:00
Kris Maglione
683a97d172 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl
2018-01-29 15:20:18 -08:00
Kris Maglione
661ea33e42 Bug 1323845: Part 6a - Support WebExtension-style experiment API provider extensions. r=aswan
MozReview-Commit-ID: E1IBFyzEwqU
2018-01-09 17:20:55 -08:00
Kris Maglione
3d9e837be9 Bug 1429567: Add more detailed add-on info to sandbox names. r=zombie
MozReview-Commit-ID: DMs8dd49j03
2018-01-12 13:21:03 -08:00
Andrew Swan
8cef91f7e3 Bug 1396399 - Clarify rules for applying activeTab permission to content scripts. r=kmag, r=bz
MozReview-Commit-ID: 9xPDX8Qk2iR
2017-11-04 21:06:20 -07:00
Luca Greco
8184c37696 Bug 1332273 - Support programmatically registered content scripts. r=baku,kmag
MozReview-Commit-ID: BiWlyYV7ZvB
2017-11-03 17:01:58 +01:00
Mark Banner
45b0812566 Bug 1412893 - Change instances of using getService to Services.jsm where possible in toolkit/components - Part 1. r=mossop
MozReview-Commit-ID: BBnacIvRJBR
2017-10-30 16:29:58 +00:00
Kris Maglione
7e48a066a3 Bug 1402066: Part 1 - Fix ordering of base schema data in extension child processes. r=aswan
MozReview-Commit-ID: FtLHJq5H5oD
2017-09-25 21:01:32 -07:00
Sebastian Hengst
60331dbda4 Backed out changeset d828e2c01a60 (bug 1402066) for frequently failing modified xpcshell test toolkit/components/extensions/test/xpcshell/test_ext_redirects.js on Android 4.3 debug. r=backout 2017-09-26 11:38:33 +02:00
Kris Maglione
1a85b6c47f Bug 1402066: Part 1 - Fix ordering of base schema data in extension child processes. r=aswan
MozReview-Commit-ID: FtLHJq5H5oD
2017-09-25 21:01:32 -07:00
Luca Greco
299c245e8f Bug 1401293 - Remove unneeded special handling for the devtools panel from extension-process-script.js. r=kmag
MozReview-Commit-ID: 3pjuoqjULAB
2017-09-19 20:28:56 +02:00
Tomislav Jovanovic
44db6ef57e Bug 1395287 - Order and chain content_scripts injection on startup r=kmag
MozReview-Commit-ID: 19MH2zLV99s
2017-09-10 18:56:35 +02:00
Kris Maglione
5c09fbeae1 Bug 1356334: Part 4 - Add a helper to synchronously get an extension's name from its ID. r=billm
MozReview-Commit-ID: 8nuvM4PR7XR
2017-08-11 21:22:18 -07:00
Ryan VanderMeulen
0980b8abd2 Backed out 8 changesets (bug 1356334) for frequent test_ext_contentscript_async_loading.html failures on Android debug on a CLOSED TREE.
Backed out changeset 9c677ebfdda0 (bug 1356334)
Backed out changeset 16b49fd1c38a (bug 1356334)
Backed out changeset 4f5bcd2b2dc6 (bug 1356334)
Backed out changeset d832803270ac (bug 1356334)
Backed out changeset b83aea215a82 (bug 1356334)
Backed out changeset b2a663ffd144 (bug 1356334)
Backed out changeset 805c56806930 (bug 1356334)
Backed out changeset 7c880eca810a (bug 1356334)
2017-08-18 11:32:18 -04:00
Kris Maglione
353590b9a8 Bug 1356334: Part 4 - Add a helper to synchronously get an extension's name from its ID. r=billm
MozReview-Commit-ID: 8nuvM4PR7XR
2017-08-11 21:22:18 -07:00
Kris Maglione
f8d9014f9b Bug 1390010: Part 3 - Limit the amount of schema data sent to web content processes. r=zombie
Web contetnt processes only need access to a small amount of schema data, but
we currently send them the approximately 600K of full schema data that is
mostly useless to them.

This patch limits the schema data sent to web content processes to what they
actually need, and sends the rest only to extension content processes.

MozReview-Commit-ID: 6G0LThNTOu1
2017-08-13 19:00:24 -07:00
Kris Maglione
632e052bb1 Bug 1389861: Remove needless overhead from same-process policy initialization. r=zombie
MozReview-Commit-ID: 3E7hnNnk46D
2017-08-12 17:21:27 -07:00
Kris Maglione
acbf681e27 Bug 1389855: Remove lazy imports from MessageChannel.jsm. r=zombie
MozReview-Commit-ID: A1d5WdrMB3K
2017-08-12 18:05:06 -07:00
Kris Maglione
0fb6b2e73c Bug 1388215: Part 3 - Use JIT-friendly defineLazy*Getters methods when defining many lazy imports. r=florian
MozReview-Commit-ID: APoFwUhDFdj
2017-08-09 13:03:36 -07:00