Commit Graph

113 Commits

Author SHA1 Message Date
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
Kris Maglione
fde4821f1e Bug 1389847: Don't add caller location to sandbox name if an explicit name is provided. r=krizsa
MozReview-Commit-ID: KOGrrMurs6X
2017-08-12 16:01:00 -07:00
Tomislav Jovanovic
fb39394a05 Bug 1377734 - Avoid instantiating a lazy tab from sendMessage, r=mixedpuppy
MozReview-Commit-ID: KfYg6hG8KmC
2017-08-11 02:16:33 +02:00
Wes Kocher
c9728a4c8f Backed out changeset 6f71999ab349 (bug 1377734) for failures in test_ext_tab_runtimeConnect.html a=backout
MozReview-Commit-ID: LU18pnnbm5z
2017-08-11 11:58:28 -07:00
Tomislav Jovanovic
d83b9891de Bug 1377734 - Avoid instantiating a lazy tab from sendMessage, r=mixedpuppy
MozReview-Commit-ID: KfYg6hG8KmC
2017-08-11 02:16:33 +02:00
Kris Maglione
04604d9ff9 Bug 1388208: Stop using FileUtils.getFile. r=zombie
This performs main thread IO to make sure that directories exist, which is not
something we should be doing on the startup path.

MozReview-Commit-ID: 2NrgRgY5ua6
2017-08-07 17:42:13 -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
ab61453747 Bug 1387907: Part 2 - Store computed module data in the startup cache. r=mixedpuppy
MozReview-Commit-ID: 4PV4z870GTb
2017-08-06 18:04:28 -07:00
Kris Maglione
b116d419d7 Bug 1387899: Part 1 - Cache browserAction icon data for startup. r=mixedpuppy
MozReview-Commit-ID: 57ANCciibCn
2017-08-06 16:12:14 -07:00
Kris Maglione
c4d42444e0 Remove unused lazy imports. r=trivial (no bug)
MozReview-Commit-ID: rqUFJw7Wsb
2017-08-02 21:09:38 -07:00
Kris Maglione
8cc3381663 Bug 1381687: Follow-up: Fix bustage where theme code is touching raw schema JSON that it shouldn't be.
MozReview-Commit-ID: 9Uwfbml0Ria
2017-07-19 22:28:09 -07:00
Kris Maglione
497bcba4b3 Bug 1382501: Don't use NetUtil to parse URIs. r=trivial
MozReview-Commit-ID: BepyXBOOuv2
2017-07-19 18:26:41 -07:00
Mark Striemer
3ba601e9c7 Bug 1330732 - Show install warnings in about:debugging r=aswan,jdescottes
MozReview-Commit-ID: 8SFcYuln8w8
2017-06-29 11:11:21 -07:00
Sebastian Hengst
4b7fa3c5ad Backed out changeset 1d1b993bfea6 (bug 1330732) for failing chrome's test_chrome_ext_contentscript_unrecognizedprop_warning.html and test_chrome_ext_eventpage_warning.html. r=backout 2017-07-17 20:46:06 +02:00
Mark Striemer
36eb2b03fc Bug 1330732 - Show install warnings in about:debugging r=aswan,jdescottes
MozReview-Commit-ID: 8SFcYuln8w8
2017-06-29 11:11:21 -07:00
Wes Kocher
7c8f1a68cf Merge inbound to central, a=merge
MozReview-Commit-ID: 8nlqm5dHCUQ
2017-07-14 17:14:43 -07:00
Kris Maglione
ef10d12084 Bug 1381023: Follow-up: Fix xpcshell failure.
MozReview-Commit-ID: BB8ItETtRMb
2017-07-14 10:50:54 -07:00
Kris Maglione
83d403d84c Bug 1380290: Use correct message manager when communicating with inline options browsers. r=aswan
MozReview-Commit-ID: HpxXG3S2zgp
2017-07-12 17:41:12 -07:00
Kris Maglione
7a0ed314bc Bug 1381023: Don't treat no response as an error in hybrid extension message handling. r=trivial
MozReview-Commit-ID: FukWQcLwFOT
2017-07-14 09:40:10 -07:00
Yoshi Huang
6d7b8c9224 Bug 1377523 - Part 1: add dummy.xul. r=smaug
ExtensionParent.jsm uses a data: URI window, and will cause this XUL
window as a cross-origin window, so we replace it with a dummy.xul
2017-07-13 12:27:30 +08:00
Kris Maglione
b44716ecfc Bug 1364768: Part 6 - Use startup cache for initial extension permission data. r=aswan
Reading the extension permissions DB at startup takes several hundred
milliseconds, largely from the overhead of initializing OS.File. We can avoid
that somewhat by using the stream APIs to read the files, and beginning the
read very early. But the eager initialization gets complicated, and we still
add extra IO to startup.

After this change, the permissions JSON file still remains the primary source
of truth, but the state as of the last session is cached in the volatile
extension startup cache to decrease the overhead of reading it at startup.

MozReview-Commit-ID: HGDt5kSsdzX
2017-05-14 16:12:33 -07:00
Kris Maglione
a0b352e6de Bug 1364768: Part 4 - Switch to a compressed, binary flat file for startup cache. r=aswan
IndexedDB helped where we needed to decrease main thread CPU, but it also took
so long to inialize during startup (over 500ms on a fast machine) that it
delayed extension startup more than was acceptable.

Using a structured clone flat file solves the same issues that IndexedDB did,
but with much less startup overhead.

MozReview-Commit-ID: 1Of7uxKCfkg
2017-07-10 22:51:28 -07:00
Kris Maglione
ee30da7682 Bug 1370752: Part 3 - Use structured clone rather than JSON to sanitize storage values. r=aswan
This gives us performance wins in sevaral areas:

- Creating a structured clone blob of storage data directly from the source
  compartment allows us to avoid X-ray and JSON serialization overhead when
  storing new values.

- Storing the intermediate StructuredCloneBlob, rather than JSON values,
  in-memory saves us additional JSON and structured clone overhead when
  passing the values to listeners and API callers, and saves us a fair amount
  of memory to boot.

- Serializing storage values before sending them over a message manager allows
  us to deserialize them directly into an extension scope on the other side,
  saving us a lot of additional structured clone overhead and intermediate
  garbage generation.

- Using JSONFile.jsm for storage lets us consolidate multiple storage file
  write operations, rather than performing a separate JSON serialization for
  each individual storage write.

- Additionally, this paves the way for us to transition to IndexedDB as a
  storage backend, with full support for arbitrary structured-clone-compatible
  data structures.

MozReview-Commit-ID: JiRE7EFMYxn
2017-07-10 18:24:11 -07:00
Wes Kocher
a0b015fa22 Backed out 2 changesets (bug 1370752) for failures in test_ext_storage.js a=backout
Backed out changeset 42d3c1599af5 (bug 1370752)
Backed out changeset 9c4bf59ab966 (bug 1370752)

MozReview-Commit-ID: 4M6DsJvJ6RI
2017-07-10 14:34:56 -07:00
Kris Maglione
5c0bb13dcc Bug 1370752: Part 3 - Use structured clone rather than JSON to sanitize storage values. r=aswan
This gives us performance wins in sevaral areas:

- Creating a structured clone blob of storage data directly from the source
  compartment allows us to avoid X-ray and JSON serialization overhead when
  storing new values.

- Storing the intermediate StructuredCloneBlob, rather than JSON values,
  in-memory saves us additional JSON and structured clone overhead when
  passing the values to listeners and API callers, and saves us a fair amount
  of memory to boot.

- Serializing storage values before sending them over a message manager allows
  us to deserialize them directly into an extension scope on the other side,
  saving us a lot of additional structured clone overhead and intermediate
  garbage generation.

- Using JSONFile.jsm for storage lets us consolidate multiple storage file
  write operations, rather than performing a separate JSON serialization for
  each individual storage write.

- Additionally, this paves the way for us to transition to IndexedDB as a
  storage backend, with full support for arbitrary structured-clone-compatible
  data structures.

MozReview-Commit-ID: JiRE7EFMYxn
2017-06-29 14:11:05 -07:00
Kris Maglione
74e871a71b Bug 1357486: Part 0g - Run remote debugger host browser in same TabGroup as extension pages. r=me
MozReview-Commit-ID: BPqf0X1hwV6
2017-07-08 15:56:10 -07:00
Kris Maglione
2bd10b5257 Bug 1357486: Part 0e - Support legacy extensions in OOP mode. r=aswan
MozReview-Commit-ID: 4JHxX78HNRV
2017-07-07 15:12:45 -07:00
Sebastian Hengst
2df512392d Backed out changeset 44ab0cca4956 (bug 1357486) 2017-07-08 11:23:32 +02:00
Kris Maglione
46ac905ec6 Bug 1357486: Part 0e - Support legacy extensions in OOP mode. r=aswan
MozReview-Commit-ID: 4JHxX78HNRV
2017-07-07 15:12:45 -07:00
Andrew Swan
18ffd89c2b Bug 1378990 Preserve pending browser across async API loads r=kmag
The code that saves the pending browser across an asynchronous
API load was accidentally broken as a result of some overzelous
cleanup.  Fix it here.

MozReview-Commit-ID: 3ED95YJAHL2
2017-07-03 16:32:26 -07:00
Andrew Swan
3358f38632 Bug 1369577 Part 2 Propagate isHandlingUserInput for browserAction, pageAction, and menus r=kmag
The implementations of browserAction, pageAction, and menu onClick
handlers now stash the current <browser> until we get a reply from
the extension process indicating that the handler has finished running.
We also have to take care to keep that <browser> around even if the
permissions api has to be loaded asynchronously.

MozReview-Commit-ID: BYJaiwdj40u
2017-06-15 12:48:40 -07:00
Sebastian Hengst
c48d1b793d Backed out changeset dfb376de5c23 (bug 1369577) 2017-06-30 00:59:59 +02:00
Andrew Swan
e77019e2bd Bug 1369577 Part 2 Propagate isHandlingUserInput for browserAction, pageAction, and menus r=kmag
The implementations of browserAction, pageAction, and menu onClick
handlers now stash the current <browser> until we get a reply from
the extension process indicating that the handler has finished running.
We also have to take care to keep that <browser> around even if the
permissions api has to be loaded asynchronously.

MozReview-Commit-ID: BYJaiwdj40u
2017-06-15 12:48:40 -07:00
Matthew Wein
c7a81cb41f Bug 1329242 - Add support for browser_action.theme_icons r=mixedpuppy
MozReview-Commit-ID: HvfUQZzBQWq
2017-06-27 15:23:35 -07:00