Commit Graph

22016 Commits

Author SHA1 Message Date
Jim Chen
89482daba4 Bug 1459301 - 2. Allow nested loopUntilIdle calls; r=snorp
There may be cases where loopUntilIdle calls are nested. Allow these
calls by canceling the previous timeout when we set a new timeout. This
patch also adds some general optimizations to loopUntilIdle, so we don't
create a bunch of objects with every call.

MozReview-Commit-ID: 9glZu8ZTVZ5

--HG--
extra : rebase_source : 6d01c0f5cc14b54b369e3d600f136e56ba96bfc9
2018-05-11 14:59:49 -04:00
Jim Chen
dc92020ef6 Bug 1459301 - 1. Wait on sessions opened through onNewSession response; r=snorp
The session returned through the onNewSession response is opened
internally by GV. GeckoSessionTestRule should trap that and wait on the
newly opened session, just like we do for any other session, so that
this internal open operation is transparent to the test.

MozReview-Commit-ID: HOvEsSVZufS

--HG--
extra : rebase_source : 46ca4d3d0d8eb08d8092b91840c4aee94ee6e486
2018-05-11 14:59:49 -04:00
Jim Chen
3a0567907f Bug 1460046 - Make child modules behave the same way as parent modules; r=esawin
Update content modules to use the "GeckoView:UpdateModuleState" message
instead of "GeckoView:Register"/"GeckoView:Unregister", similar to what
we already do for parent modules. Also only call onSettingsUpdate in
content module when the module is enabled, similar to what we already do
for parent modules.

MozReview-Commit-ID: C30W9iEd7Rz

--HG--
extra : rebase_source : 0ff689e9e03655df0d7206ad0bb49b751bd0119d
2018-05-11 10:53:54 -04:00
Jim Chen
c3e84d6241 Bug 1460045 - Pass module enabled states through init-data; r=esawin
During session initialization, pass in the enabled state of all modules
through the init-data, and use that to enable modules if necessary. This
avoids a race condition where we enable modules too late on startup due
to event queuing.

MozReview-Commit-ID: I0rvq6UoOVh

--HG--
extra : rebase_source : df5d469d0b4a0a402e4b75cd74e52559f395e6bc
2018-05-11 10:53:54 -04:00
Jim Chen
6933285ceb Bug 1459501 - Fix race in EventDispatcher queuing; r=esawin
There's a race in EventDispatcher, where the ready state can change
during a dispatch. In that case, we can end up neither dispatching an
event nor queuing it, which effectively drops the event.

MozReview-Commit-ID: GvjSUzjBrsT

--HG--
extra : rebase_source : bed4e368b5ab1cc7653daea57f20ab25dfa1f125
2018-05-08 17:38:11 -04:00
Jim Chen
336d07e4fc Bug 1459300 - Support async replies in RDP client; r=snorp
From the main thread, we need to get the result of evaluateJS()
asynchronously, because the JS code may depend on delegate callbacks on
the main thread, which cannot happen if evaluateJS() is synchronous. The
simplest example is an alert() JS call that depends on the prompt
delegate callback.

This patch makes RDPConnection read input packets on a background
thread, and the main thread can either poll for input synchronously, or
rely on asynchronously posted messages. Actor is extended to allow for
multiple pending inputs, and it now exposes a nicer ReplyParser
interface for turning reply packets into result objects.

MozReview-Commit-ID: I0eKeOzf2Jy

--HG--
extra : rebase_source : d12ad5f4c876f51e944ff202289cdc7e29b5bf99
2018-05-11 10:25:04 -04:00
Jim Chen
989361cc60 Bug 1459299 - 2. Add pref setting methods for tests; r=snorp
Add GeckoSessionTestRule.setPrefsUntilTestEnd and
GeckoSessionTestRule.setPrefsDuringNextWait so tests can easily set
prefs to get specific behavior.

MozReview-Commit-ID: FquaonwfF5v

--HG--
extra : rebase_source : 8a9a543a89f0976ef8476630cd9192518c4a9cfc
2018-05-11 10:25:04 -04:00
Jim Chen
f0ce2a7b38 Bug 1459299 - 1. Add evaluateChromeJS for chrome privilege code; r=snorp
Add GeckoSessionTestRule.evaluateChromeJS for JS code that requires
chrome privileges, such as setting prefs.

MozReview-Commit-ID: G7NUKukWTT8

--HG--
extra : rebase_source : c0d4684ba5a9d4735e30b49f584e8e0222210c87
2018-05-11 10:25:03 -04:00
James Willcox
83a9f5c1e1 Bug 1433968 - Use GeckoRuntime to launch Gecko in Fennec r=jchen
MozReview-Commit-ID: AUrvsFWDuhY
2018-05-10 16:42:23 -05:00
James Willcox
898decb011 Bug 1433968 - Support pause-for-debugger in GeckoRuntime r=jchen
MozReview-Commit-ID: FY7HI0c38DU
2018-05-10 16:42:22 -05:00
James Willcox
bc73d8b2e0 Bug 1433968 - Add CrashReporterService for GeckView r=jchen
The Fennec CrashReporter class is also renamed to
CrashReporterActivity. When running in Fennec, the Activity will be used
which retains what we do today, prompting for comments, email, etc. When
used in standalone GeckoView, we report the crash without user
interaction if the appropriate GeckoRuntimeSetting was set. The app will
want to ask for user permission at least once in order to set this.

We do not collect the URL, email, or logcat with GeckoView crashes.
Logcat and URL would be nice to have, but it's not clear what the API
for those would look like, and they can be addressed in followup
patches.

MozReview-Commit-ID: C5ROsUKreRe
2018-05-10 16:42:20 -05:00
James Willcox
1ddcfb2222 Bug 1433968 - Add crash reporting control to GeckoRuntimeSettings r=esawin,jchen
MozReview-Commit-ID: TQ7hvekIVJ
2018-05-10 16:42:19 -05:00
James Willcox
567fcf5356 Bug 1433968 - Change how environment variables are passed to GeckoLoader r=jchen
Right now we pass a bundle to GeckoLoader.setupGeckoEnvironment() with
magic keys representing the environment variables. Instead of this,
simply pass a list of Strings.

MozReview-Commit-ID: D6mSTnYpnGu
2018-05-10 16:42:17 -05:00
Tiberius Oros
5245fb43e0 Backed out 6 changesets (bug 1433968) for Android failures on GeckoRuntimeSettings on a CLOSED TREE
Backed out changeset bba1deb626b5 (bug 1433968)
Backed out changeset 7a8616427aea (bug 1433968)
Backed out changeset c94c48d76350 (bug 1433968)
Backed out changeset 64cccb490a2a (bug 1433968)
Backed out changeset 62f865eed952 (bug 1433968)
Backed out changeset 5ed1e3af37ba (bug 1433968)
2018-05-10 18:11:55 +03:00
James Willcox
7f4cec9233 Bug 1433968 - Fix a typo in GeckoRuntimeSettings r=me
MozReview-Commit-ID: H23FzGzoOvv
2018-05-10 09:10:27 -05:00
James Willcox
9520a60bbd Bug 1433968 - Use GeckoRuntime to launch Gecko in Fennec r=jchen
MozReview-Commit-ID: AUrvsFWDuhY
2018-05-10 08:34:07 -05:00
James Willcox
6e0e5ccc4c Bug 1433968 - Support pause-for-debugger in GeckoRuntime r=jchen
MozReview-Commit-ID: FY7HI0c38DU
2018-05-10 08:34:07 -05:00
James Willcox
05a3f8ac8e Bug 1433968 - Add CrashReporterService for GeckView r=jchen
The Fennec CrashReporter class is also renamed to
CrashReporterActivity. When running in Fennec, the Activity will be used
which retains what we do today, prompting for comments, email, etc. When
used in standalone GeckoView, we report the crash without user
interaction if the appropriate GeckoRuntimeSetting was set. The app will
want to ask for user permission at least once in order to set this.

We do not collect the URL, email, or logcat with GeckoView crashes.
Logcat and URL would be nice to have, but it's not clear what the API
for those would look like, and they can be addressed in followup
patches.

MozReview-Commit-ID: C5ROsUKreRe
2018-05-10 08:34:06 -05:00
James Willcox
b409eb3af6 Bug 1433968 - Add crash reporting control to GeckoRuntimeSettings r=esawin,jchen
MozReview-Commit-ID: TQ7hvekIVJ
2018-05-10 08:34:06 -05:00
James Willcox
54e06ef6b1 Bug 1433968 - Change how environment variables are passed to GeckoLoader r=jchen
Right now we pass a bundle to GeckoLoader.setupGeckoEnvironment() with
magic keys representing the environment variables. Instead of this,
simply pass a list of Strings.

MozReview-Commit-ID: D6mSTnYpnGu
2018-05-10 08:34:06 -05:00
Csoregi Natalia
f034c0ab5d Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-05-10 12:52:31 +03:00
Jan Henning
fc691cd9d7 Bug 1335148 - Part 4: Remove unused max_decoded_image_kb pref. r=snorp
Since bug 1104622, that pref has in fact been unused, so us setting that value
to 0 on memory pressure didn't really achieve anything.

Instead, the SurfaceCache already does its own memory management and discards
image surfaces when receiving a memory-pressure notification.

MozReview-Commit-ID: 4aqvclgvLhX

--HG--
extra : rebase_source : c8e8970ec748ea754545e0f563d86615e220f647
2018-03-30 18:54:48 +02:00
Jan Henning
60fdddd5ed Bug 1335148 - Part 3: Notify Gecko and turn bfcache back on when Fennec memory pressure decays to 0. r=snorp
MozReview-Commit-ID: 6Oyu7Lx1gFQ

--HG--
extra : rebase_source : f2cf0d587f0eaa60033539a9506fde6b0494b3a8
2018-05-06 13:40:05 +02:00
Jan Henning
29713de206 Bug 1335148 - Part 1: Dynamically determine content viewer count on Android, too. r=bz,snorp
The current limit of at most one bfcache entry on Android dates back to when
Fennec was built for the Nokia N810, which had a whopping 128 MB of memory.
Since a few years have passed since then and mobile device technology has
evolved considerably, it should be safe now to allow a little more than that.

Since web sites sizes might have grown somewhat as well compared to the figure
of 4MB mentioned in CalcMaxTotalViweres(), though and to be absolutely on the
safe side, we still tweak the formula when building for Android, though.

If in the worst case even those assumptions turn out too generous, we will still
be protected by the fact that
- we temporarily disable the bfcache when the OS signals memory pressure, and
- our contentViewerTimeout is set to a lower value than on Desktop, so bfcache
  entries will expire sooner

MozReview-Commit-ID: 1A6d0Q6Mdx0

--HG--
extra : rebase_source : 9cc1f7abb1aef82ffc4d7987773ae7cf35440884
2018-03-29 21:51:13 +02:00
Cosmin Sabou
0fb7e820a7 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-05-10 01:15:11 +03:00
Roman
8838c85508 Bug 1345199 - Don't show "about:reader?" in the long-press context menu. r=nalexander
--HG--
extra : amend_source : 9b65de7d71eda1c0ab5b3eb6c0d96846f6025678
2018-04-26 21:30:36 -04:00
James Willcox
a3db3dbc3f Bug 1459051 - Fix GeckoView download support when missing content disposition r=esawin
MozReview-Commit-ID: 9SuqRIkKTPR
2018-05-09 11:03:38 -05:00
Kris Maglione
4900714df7 Bug 1457321: Part 1 - Add bundled dictionaries to built_in_addons.json. r=ted,rhelmer
MozReview-Commit-ID: GxCSXXaz8kz

--HG--
extra : rebase_source : a334cfbeee786aeaca373b5a7fc8107fa44c2243
2018-04-27 15:42:55 -07:00
Jim Chen
8f6ba7ef0c Bug 1459297 - Use SDK JNI calls for boxing/unboxing GeckoBundle values; r=snorp
Instead of the helper methods in GeckoBundle, add SDK JNI calls for the
boxing/unboxing operations, and use those calls directly. Moreover, for
unboxing Boolean/Double/Integer, use their internal "value" field value
directly if possible, to avoid making a JNI method call.

MozReview-Commit-ID: Azvov1gCeje

--HG--
extra : rebase_source : 34cd4a821d2b47e48957f241bbf165439635be59
2018-05-07 10:05:56 -04:00
Jim Chen
a2a7ef293f Bug 1459298 - Stop spinning event loop when window closes; r=esawin
If our window closes while we're spinning the event loop, stop spinning
as soon as possible so we can continue with cleaning up the window.

MozReview-Commit-ID: ByS0c6R0cM8

--HG--
extra : rebase_source : 6d32f1e8c6d6119eaaacb6a3ef5d9319c884e642
2018-05-07 10:05:56 -04:00
Ciure Andrei
61548f81d6 Merge inbound to mozilla-central. a=merge
--HG--
rename : testing/web-platform/meta/webdriver/tests/navigation/get_title.py.ini => testing/web-platform/meta/webdriver/tests/get_title/user_prompts.py.ini
2018-05-09 01:58:44 +03:00
Jan Henning
6a24be748d Bug 1460028 - Experimental - Use string literal instead of static variable in SessionTest. r=gbrown
Experimentally try using a String literal in case the NullPointerException at
that line is caused by some weird class initialisation issue.

MozReview-Commit-ID: 1BexpntTBEJ

--HG--
extra : rebase_source : ea71f390ce0d683cd635aae52825871562b78feb
2018-05-08 21:55:20 +02:00
Boris Zbarsky
1fb03996f4 Bug 1387143 part 29. Remove nsISelection. r=mats 2018-05-08 13:52:42 -04:00
Boris Zbarsky
c4c94974c4 Bug 1387143 part 5. Remove JS use of nsISelectionPrivate. r=mats 2018-05-08 13:52:36 -04:00
arthur.iakab
f2042a4c1f Merge inbound to mozilla-central a=merge 2018-05-08 15:42:06 +03:00
Kris Maglione
01c298aca6 Bug 1460092: Add ESLint rule to enforce use of ChromeUtils.generateQI. r=Gijs
Also fixes existing code which fails the rule.

MozReview-Commit-ID: CkLFgsspGMU

--HG--
extra : rebase_source : 86a43837659aa2ad83a87eab53b7aa8d39ccf55b
2018-05-08 18:36:22 -07:00
Andrew Gaul
80f292e771 Bug 1436271 - Replace calls to String.getBytes(String) with String.getBytes(Charset). r=nalexander
Also replace calls to String(byte[], String) with String(byte[], Charset).  This
removes some cannot-happen exception handling.
2018-02-06 22:12:33 -08:00
Eugen Sawin
5dfa7d1f80 Bug 1459759 - [1.0] Send settings to content modules on registration. r=jchen 2018-05-08 01:11:35 +02:00
Eitan Isaacson
f026a7fff5 Bug 1455788 - Consolidate a11y MotionEvent handling to the GeckoView. r=jchen 2018-05-07 10:22:00 -04:00
Narcis Beleuzu
323d4a4185 Backed out 3 changesets (Bug 1433968) for causing Bug 1459349. a=backout
Backed out changeset 82b765c5a02f (bug 1433968)
Backed out changeset 73ec9bb3e17e (bug 1433968)
Backed out changeset 0812ac0376da (bug 1433968)

--HG--
extra : amend_source : 2748b297418eea9b7d3c2be11a8e7e300f8d709c
extra : histedit_source : 6428453bbe80ad044661d01e5127d924fffed1a3%2Cd2e712ac6c597784343ff08f75199851c07be4e7
2018-05-07 17:06:30 +03:00
Jim Chen
9ad3c40228 Bug 1458327 - 5. Fix some comments; r=jchen
MozReview-Commit-ID: LAgmyGXPPOL

--HG--
extra : rebase_source : 63cc8a946d6c00b6fac40fa40601157e9b1ac3a7
2018-05-04 21:08:10 -04:00
Jim Chen
482144da57 Bug 1458327 - 4. Always register some events / frame scripts; r=esawin
The problem is we rely on some events / frame scripts for session calls
that should still work even if we don't have a delegate assigned, so we
should always register these events / frame scripts.

MozReview-Commit-ID: 6TvvMhc7qOf

--HG--
extra : rebase_source : 30d939a4e39488ca039709ec5b59532506bd18ed
2018-05-04 21:08:10 -04:00
Jim Chen
3ad25abd93 Bug 1458327 - 3. Make GeckoSessionHandler and GeckoSessionSettings work with init-data; r=esawin
Make GeckoSessionHandler and GeckoSessionSettings use the updated
"GeckoView:EnableModule" and "GeckoView:UpdateSettings" events.

Also, send events for updating settings only while the session is open.
Don't send events while the session is closed, because when opening the
session, we will send settings in one batch in the init-data.

MozReview-Commit-ID: Kytx8Ak4A5p

--HG--
extra : rebase_source : add58cb9cefcfaab7d109c492bb4406ee38f9e28
2018-05-04 21:08:10 -04:00
Jim Chen
46997650b0 Bug 1458327 - 2. Let ModuleManager manage more aspects of modules; r=esawin
Let ModuleManager keep the current settings and enabled states for
modules. It initializes settings and module states from the window
init-data, and then listens to changes in them.

Having ModuleManager manage these states helps keeping things
consistent, and makes it possible for future optimizations like
delay-loading modules.

MozReview-Commit-ID: AM6lAxnUGhd

--HG--
extra : rebase_source : 2751990bec6054cc36104957690d8fce6d3da399
2018-05-04 21:08:10 -04:00
Jim Chen
ad471d48f6 Bug 1458327 - 1. Pass init-data instead of settings to Window; r=esawin
Instead of passing a live settings object to the native Window, pass a
static initialization data bundle to the Window. The bundle contains
settings at the time of creation. All changes to settings after creation
are updated through events, rather than the live object.

Using a live object between Gecko and UI threads has some drawbacks,
including the need to lock the object, and the fact it won't work with
remote runtimes across processes.

MozReview-Commit-ID: 1DngLfJ0Fnc

--HG--
extra : rebase_source : 05c0ba76ce7f45a02557cc1a30e399682dccd5a7
2018-05-04 21:08:10 -04:00
Brindusan Cristian
09c2471bd3 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-05-05 00:42:16 +03:00
Brindusan Cristian
89a097be09 Merge inbound to mozilla-central. a=merge 2018-05-05 00:35:50 +03:00
Jan Henning
804d6a59fd Bug 1459284 - Ensure GeckoView context menus work with ShadowDOM. r=snorp
MozReview-Commit-ID: 5XrGRgSvh0g

--HG--
extra : rebase_source : 7c8d25499bdb08699cf9818c8ac5eea2d9708acd
2018-05-04 20:54:47 +02:00
Gabriele Svelto
b711bd404a Bug 1458643 - Use 'Android' as the OS name for Fennec crash pings; r=jchen
MozReview-Commit-ID: 4yPsDbmt1sZ

--HG--
extra : rebase_source : 2f9225b294ae23583ba077b6dbad7d72709636da
2018-05-02 21:54:23 +02:00
Vlad Baicu
65714642de Bug 1425669 - Move StumblerService location permission check after the intent&scan enabled checks. r=mcomella
On Android 7.0.0, the OS would start the StumblerService and without having given fennec the location permission the intent and scan enabled checks would've been skipped - which ensure that the Stumbler Service does not run in unadequate scenarios.

MozReview-Commit-ID: AGU67ytE4ff

--HG--
extra : rebase_source : 7d1285e75ffa233e4888e65505081bca2200b34e
2018-05-04 16:10:17 +03:00