Commit Graph

146 Commits

Author SHA1 Message Date
Ciure Andrei
40a9e70f9f Merge mozilla-central to mozilla-inbound. a=merge CLOSED TREE 2018-04-11 12:00:35 +03:00
Kris Maglione
d380a39518 Bug 1452307: Remove support for old-style experiment API extensions. r=aswan
MozReview-Commit-ID: 5y48pMRQ5XW
2018-04-06 18:14:59 -07:00
Rob Wu
f08c712969 Bug 1448674 - avoid closing extension ports while detaching tabs r=aswan
Extension ports are automatically closed when the message manager of
the source is destroyed. When a tab is detached from a window, its
frameloader is moved to the new window and the original message
manager is destroyed.

Bug 1445537 started listening for SwapDocShells events, but that only
works for the first swap (e.g. detaching a tab once). To avoid early
disconnection of the port, we should continue to subscribe to
SwapDocShells events.

MozReview-Commit-ID: G2ZYAhNyHIL
2018-04-06 13:34:30 +01:00
Kris Maglione
a505a99767 Bug 1451748: Always remove unloaded views from views list. r=mixedpuppy
Contexts for active extension views are kept in a Set on the owning extension.
That list is meant to be kept current, with views added and removed as they're
created and unloaded. A refactoring at some point in the past, though, changed
that so that we only cleaned up parent views at extension shutdown, not at
view shutdown.

MozReview-Commit-ID: FW8KHPOD9qc
2018-04-05 19:42:20 -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
Boris Zbarsky
1eb7f3f9c3 Bug 1444143 part 10. Remove unnecessary QIs to Ci.nsIFrameLoader in JS. r=mystor
nsFrameLoader is on WebIDL bindings, so those QIs are no-ops anyway, unless the given object is no a frameloader to start with.

MozReview-Commit-ID: IPiW70H5NPc
2018-03-21 22:43:17 -04:00
Kris Maglione
c56a653ac3 Bug 1446250: Part 2 - Optimize/reduce calls into the Photon PageAction API. r=mixedpuppy
Calling into the Photon PageAction API to update a property is orders of
magnitude more expensive than the simple DOM-based updates we used previously.
To make matters worse, a lot of our caching was removed during the migration,
and the Photon API introduces a lot of duplicated work when selecting icons.

This patch caches the last known state for each property to avoid calling into
the Photon APIs to update each property more than necessary, and removes the
extraneous preferred icon size calculations that the Photon code already
duplicates.

MozReview-Commit-ID: LjPPxolmcd6
2018-03-15 20:20:33 -07:00
Kris Maglione
245ac6e82e Bug 1446821: Add shutdown blocker for async extension uninstall tasks. r=mixedpuppy
MozReview-Commit-ID: AMHkqviDMoV
2018-03-18 13:59:56 -07:00
Kris Maglione
9458c68b61 Bug 1445537: Track frameloader swaps when monitoring for channel disconnections. r=aswan
When we swap <browser> frameloaders, the message managers on the parent side
also change. And since a frameloader swap is usually followed by the original
<browser> and its message manager being destroyed, this leads us to think the
message manager has disconnected earlier than it actually does.

MozReview-Commit-ID: LC9aaoynWzH
2018-03-14 15:44:08 -07:00
Kris Maglione
a77a8caadd Bug 1444758: Part 14 - Migrate test_ext_unload_frame to xpcshell. r=aswan
MozReview-Commit-ID: 4lwqDQ8rI1K
2018-03-11 16:21:23 -07:00
Shane Caraveo
93db2c5790 Bug 1438985 fix showing hidden tabs on extension shutdown, r=aswan
We need a static disable event so we can handle shutdown
of extensions using hidden tabs.  This allows us to handle
shutdown when the extension has not yet used the API (thus
the ext-tabs api has not loaded).

MozReview-Commit-ID: BxV5PmbHJ8o
2018-03-01 12:04:52 -06:00
Florian Quèze
f1a55f73f8 Bug 1440284 - change this.EXPORTED_SYMBOLS back to var EXPORTED_SYMBOLS in JS modules, r=mccr8. 2018-02-23 20:50:01 +01: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
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
Oriol Brufau
4791668dc2 Bug 1424538 - Allow pageAction and sidebarAction set* methods to accept a null value (desktop). r=mixedpuppy
MozReview-Commit-ID: FqcRrFDYqWp
2017-12-18 20:41:10 +01:00
Kris Maglione
a96e1007ac Bug 1323845: Part 2c - Lazy init API global only when APIs are first loaded. r=aswan
MozReview-Commit-ID: B1bbiM0j5gT
2018-01-09 16:07:45 -08:00
Kris Maglione
2898ad39b0 Bug 1323845: Part 2b - Support separate schema roots for each API manager. r=aswan
MozReview-Commit-ID: 61LhYiIKVTH
2017-12-16 14:51:10 -06:00
Kris Maglione
2d3a2b7f99 Bug 1323845: Part 2a - Support separate API managers for each extension. r=aswan
MozReview-Commit-ID: 5gGsMm1ahd
2017-12-16 15:33:23 -06:00
Andrew Swan
e53f9296c7 Bug 1426259: Revamp processing of manifest.json for themes r=kmag
MozReview-Commit-ID: 6dWy8wwrobY
2017-12-20 16:06:50 -08:00
Masatoshi Kimura
1dfecd5932 Bug 1418914 - Move E10SUtils.jsm into toolkit/. r=mossop
MozReview-Commit-ID: EgDzEEKAeh1
2017-12-12 21:35:16 +09:00
Andreea Pavel
f83f963a34 Merge inbound to mozilla-central r=merge a=merge 2017-12-09 22:21:17 +02:00
Kris Maglione
c8ea1d4273 Bug 1421459: Update to ESLint 4 "indent" rule. r=aswan
MozReview-Commit-ID: LxLDWlsIlSk
2017-11-28 14:13:59 -08:00
Oriol Brufau
9f671e6f20 Bug 1419940 - Allow browserAction set* methods to accept a null value. r=aswan
MozReview-Commit-ID: H2UfUITBEMm
2017-11-29 05:50:00 +01: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
Bob Silverberg
fb5f544d9c Bug 1404584 Part 2: Convert ext-chrome-settings-overrides to use update and uninstall events, r=aswan,mkaply
MozReview-Commit-ID: KtagRbDz19S
2017-11-01 09:50:03 -04:00
Kris Maglione
64a40102bb Bug 1416074: Follow-up: Removed unused service getter. r=trivial
MozReview-Commit-ID: CtUId9K5KPM
2017-11-12 16:39:09 -08:00
Andreea Pavel
3e879d4343 Merge inbound to mozilla-central r=merge a=merge 2017-11-11 11:59:20 +02:00
Kris Maglione
711a1e34a6 Bug 1416074: Remove obsolete extensionNameFromURI helper. r=mixedpuppy
MozReview-Commit-ID: IzaqUZV03rG
2017-11-09 17:18:59 -08:00
Andrew Swan
12d09190d2 Bug 1405491 Switch WebExtensions StartupCache to DeferredTask r=kmag
MozReview-Commit-ID: GfdM0hkAHqP
2017-10-16 21:01:43 -07:00
Kris Maglione
5fb4a6a9a0 Bug 1404652: Part 2 - Coalesce multiple event dispatches into a single message during an idle slice. r=zombie
Sending MessageManager messages is expensive, but a lot of the overhead is
per-message more than it's tied to the complexity of the message. In
particular:

- Each sendAsyncMessage call incurs separate XPConnect method call overhead.

- Each message requires acquiring a lock, and separate message setup overhead
  for IPC.

- The message data itself must be structured cloned, which requires
  (expensive) allocation of buffers to hold the serialized data. Each buffer
  segment is 4KB, which is generally enough to hold multiple serialized
  messages, so coalescing messages means fewer buffer allocations.

Moving some of this work into idle slices also means less likelihood of
interfering with UI responsiveness.

MozReview-Commit-ID: 5SAMZNLVaY3
2017-09-28 20:14:17 -07:00
Ian Moody
be771eda15 Bug 1404568 - Improve webext browser_action icon fallbacks. r=mixedpuppy
Currently if there is no default icon at the specified size, the default icon
falls back to the light text icon at that size. This is wrong in two ways:
First, the default theme uses dark text, so it should fallback to the dark icon
Secondly, authors expect the unsized default_icon to be used if specified

This patch fixes both of these issues, so that the default icon first falls back
to the unsized default_icon, and then only if that is not specified falls back
to the dark icon

MozReview-Commit-ID: C3RRTKhYq6r
2017-10-08 13:23:33 +01:00
Kris Maglione
5a9116a4e2 Bug 1402944: Part 8 - Avoid X-ray overhead when cloning event handler responses. r=mixedpuppy
MozReview-Commit-ID: 4CHP80WymuA
2017-09-23 13:30:52 -07:00
Luca Greco
6d6f77e024 Bug 1397196 - Fix pageAction icon loading when an extension has a cached browserAction theme-based icon. r=mixedpuppy
MozReview-Commit-ID: Lmi5pLerzul
2017-09-06 12:40:45 +02:00
Kris Maglione
1b68bb4924 Bug 1398630: Part 3 - Use document.docShell rather than longer/slower XPC paths. r=zombie
MozReview-Commit-ID: 5oD0Uvv1pvx
2017-09-11 14:53:20 -07:00
Kris Maglione
877f3c7535 Bug 1398630: Part 1 - Remove/cleanup some old ExtensionUtils helpers. r=zombie
MozReview-Commit-ID: FeLUjH7pkiB
2017-09-10 15:39:28 -07:00
Kris Maglione
3c6bbd9ea4 Bug 1396856: Part 1 - Remove spread call fallback overhead in event dispatch. r=zombie
MozReview-Commit-ID: 3c5p9OvRqHI
2017-09-05 11:20:43 -07:00
Kris Maglione
27e68ac62f Bug 1393621: Part 1 - Don't load ext-contextualIdentities at startup without permissions. r=zombie
MozReview-Commit-ID: AiIYAXSRrii
2017-08-31 15:09:41 -07:00
Shane Caraveo
6bc2476c56 Bug 1389718 fix receiving a message in proxy sandbox when running OOP, r=kmag
MozReview-Commit-ID: xgHIph36SG
2017-08-24 12:49:56 -07:00
Kris Maglione
e60f7a1d33 Bug 1389840: Part 2 - Store last optional permissions state in the startup cache. r=aswan
MozReview-Commit-ID: 95krDpu1JZr
2017-08-12 14:42:44 -07:00
Kris Maglione
4b8f8c9265 Bug 1391472: Part 2 - Cache normalized icon data for non-string values. r=mixedpuppy
It turns out that stringifying a paths object is much cheaper than normalizing
it, and has the added benefit of allowing us to use cached CSS text for the
result.

MozReview-Commit-ID: 5gIqcDmPiKr
2017-08-18 11:54:18 -07:00
Kris Maglione
0577011c6c Bug 1391472: Part 1 - Remove integer property check from IconDetails.normalize. r=mixedpuppy
We already do this check at the schema level, so the added check in
IconDetails is unnecessary.

MozReview-Commit-ID: JTEE0xWH0a4
2017-08-18 12:25:40 -07:00
Kris Maglione
d3d0a0694d Bug 1391158: Optimize checkLoadURL for the common case of extension URLs. r=mixedpuppy
MozReview-Commit-ID: KGFFcHxQSvZ
2017-08-16 23:03:15 -07:00
Kris Maglione
cca7be0e2c Bug 1391153: Get rid of Sandbox clone for cross-process API calls. r=mixedpuppy
MozReview-Commit-ID: A9g6s5jqd78
2017-08-16 22:16:31 -07:00
Kris Maglione
b4fd636ed8 Bug 1391099: Avoid using checkLoadURIStrWithPrincipal. r=mixedpuppy
checkLoadURIStrWithPrincipal runs URLs through the URI fixup services and
checks against each of the results. This is both expensive and unnecessary for
our purposes.

MozReview-Commit-ID: 4L2Z4KuMZhQ
2017-08-16 16:29:06 -07:00
Kris Maglione
fba719c63f Bug 1390010: Follow-up: Fix debug test bustage.
MozReview-Commit-ID: HLdhuWN36Hu
2017-08-14 23:50:47 -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