Commit Graph

55 Commits

Author SHA1 Message Date
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
Kris Maglione
da0b87867a Bug 1380267: Fix shutdown blocker corner cases. r=aswan
MozReview-Commit-ID: 8Dgvnm96hgT
2017-07-12 16:58:15 -07:00
Kris Maglione
01d769d2fb Bug 1368289: Simplify frameloader global metadata tagging. r=mixedpuppy
MozReview-Commit-ID: 1hgTtWysmya
2017-05-27 17:30:53 -07:00
Kris Maglione
89d83c0e1c Bug 1368152: Part 2 - Move extension policy registration out of ExtensionManagement.jsm. r=aswan,mixedpuppy
MozReview-Commit-ID: Ls1ZvJLcjlR
2017-05-26 12:04:18 -07:00
Kris Maglione
a518bc4925 Bug 1368102: Part 8 - Move extension page matching into C++. r=billm,mixedpuppy
Bill, can you please review the WebIDL change, and Shane the rest?

MozReview-Commit-ID: 6N3sGrAsHzs
2017-05-26 12:07:06 -07:00
Kris Maglione
f9ee4dc5f2 Bug 1368102: Part 7 - Remove ScriptMatcher and use WebExtensionConentScript directly. r=mixedpuppy
MozReview-Commit-ID: 5upkXMiivBn
2017-06-04 13:29:03 -07:00
Kris Maglione
3609169459 Bug 1368102: Part 6 - Remove StubExtension and use WebExtensionPolicy directly. r=mixedpuppy
MozReview-Commit-ID: 9rvdPamZrF
2017-05-25 21:57:48 -07:00
Kris Maglione
c04c15bd76 Bug 1368102: Part 5 - Move static content script matching into C++. r=mixedpuppy,zombie
MozReview-Commit-ID: Co04MoscqMx
2017-06-04 15:38:11 -07:00
Kris Maglione
861919618a Bug 1368102: Part 4 - Use WebExtensionContentScript to match content scripts. r=mixedpuppy,zombie
MozReview-Commit-ID: 1Ga0259WjC
2017-06-03 17:11:08 -07:00
Kris Maglione
f29027b906 Bug 1368102: Part 3 - Use MatchPattern and MatchGlob bindings for content script matching. r=mixedpuppy
MozReview-Commit-ID: AvNCU77I2Je
2017-05-25 15:42:18 -07:00
Kris Maglione
e5aca6859e Bug 1322235: Part 6 - Replace AddonPolicyService with a stub implementation in ExtensionPolicyService. r=mixedpuppy,zombie
This replaces the JS policy service stubs with a pure C++ version which
directly makes policy decisions based on active WebExtensionPolicy objects.

This is the first step in a larger refactoring, which will remove the
ExtensionManagement module entirely, and replace the current add-on policy
service with direct, non-virtual access to native WebExtensionPolicy objects.

It will also be followed by related changes to migrate the content script and
extension page matching to native code, based on the existing MatchPattern and
WebExtensionPolicy bindings.

MozReview-Commit-ID: 2MpbmXZGiPZ
2017-06-03 17:12:14 -07:00
Kris Maglione
5ce24cde06 Bug 1356826: Wait for startup to finish before shutting down. r=me
MozReview-Commit-ID: LksftmZHI8H
2017-05-10 20:26:01 -07:00
Iris Hsiao
0d81aa4e25 Backed out 15 changesets (bug 1358846, bug 1356826) for talos error. a=backout
Backed out changeset 96ea13bb00c5 (bug 1358846)
Backed out changeset b533d7f9b9c2 (bug 1358846)
Backed out changeset 7dcb80a051a3 (bug 1358846)
Backed out changeset 26825f1e33dd (bug 1358846)
Backed out changeset 98b57ff82a54 (bug 1358846)
Backed out changeset b9088593e34f (bug 1358846)
Backed out changeset cb2518673c56 (bug 1358846)
Backed out changeset 889c487a5d41 (bug 1358846)
Backed out changeset 459b36092b7a (bug 1356826)
Backed out changeset c861e23ec8ef (bug 1356826)
Backed out changeset d47998fa24cd (bug 1356826)
Backed out changeset b02e89c67132 (bug 1356826)
Backed out changeset c46fed6e4f6a (bug 1356826)
Backed out changeset 237268e3d9d2 (bug 1356826)
Backed out changeset 527435fc20db (bug 1356826)
2017-05-12 17:45:21 +08:00