Commit Graph

26724 Commits

Author SHA1 Message Date
Jan Henning
f47eb731da Bug 1414084 - Part 13 - Cache PageActions. r=Grisha
Since converting a PageAction message into an actual PageAction object also en-
tails parsing the image data URL into a drawable, we leave that task to the
PageActionLayout.

This means that the PageAction cache needs to operate slightly differently than
the MenuItem cache. First, we store all PageAction BundleEvent messages that
arrive while no PageActionLayout is ready and then forward them en masse when
one becomes available. Secondly, if the PageActionLayout is going away again,
we then also take a list of already parsed PageAction objects for safekeeping.

MozReview-Commit-ID: AcPPONXqe46

--HG--
extra : rebase_source : 696df760f28f9d126858920b544585e4c86219ff
2018-02-26 21:50:50 +01:00
Jan Henning
a6932b97b2 Bug 1414084 - Part 12 - Add some tests for the processing of Menu messages. r=Grisha
MozReview-Commit-ID: D8Aujo1PgIk

--HG--
extra : rebase_source : 1dd4fa0909e7b1a036a739a886043fe627740c56
2018-03-19 20:06:32 +01:00
Jan Henning
a3950adb71 Bug 1414084 - Part 11 - Use a Map for the MenuItemInfo list. r=Grisha
Since all related EventDispatcher messages use UUIDs, it makes sense to store
our MenuItemInfos in a Map, so we can access them directly by UUID instead of
having to iterate over them until we've found the desired one.

Since we want to preserve the order in which MenuItemInfos were added, we use a
LinkedHashMap.

MozReview-Commit-ID: BEtJ59tX59m

--HG--
extra : rebase_source : 8012b11c1e36b774972a0cc4a6f748ccaace7533
2018-03-18 18:07:16 +01:00
Jan Henning
5671c8488b Bug 1414084 - Part 10 - Init MenuItemInfo list right from the start. r=Grisha
The small savings in initialising this on demand the first time a menu item is
added, are not worth the additional complexity in null checks and the like.

MozReview-Commit-ID: Lcz09Ds8NxJ

--HG--
extra : rebase_source : 379789298e0d60d353426c665a8f89c551ceaa66
2018-03-18 17:47:33 +01:00
Jan Henning
24822c48c7 Bug 1414084 - Part 9 - Move add-on menu item cache out of BrowserApp. r=Grisha
Bug 832990 solved the issue of us losing the menu item cache if BrowserApp was
destroyed, however the issue remains that we'll miss any Menu:... messages that
are sent while BrowserApp doesn't exist, e.g. if Gecko is initially loaded
through a GeckoView-based activity.

Therefore we now move the menu item cache and the listener for those messages
into a separate class, whose lifetime better matches that of Gecko.

Apart from any necessary changes, we move the existing code as is. The only
additional change is that we make addAddonMenuItemToMenu() static, because we
can.

MozReview-Commit-ID: BJleonLnjmo

--HG--
extra : rebase_source : e36d954488cc44d250948edcbb8a1964e24ddab7
2018-02-25 22:22:37 +01:00
Jan Henning
98cf3ace3e Bug 1414084 - Part 8 - Unify menu item EventDispatcher messages. r=Grisha
As a final step, these can be merged as well. The same reasoning as in the
previous patch applies with regards to additional functionality that isn't
(yet) used by webextensions.

MozReview-Commit-ID: Ezx2mQY0s85

--HG--
extra : rebase_source : 955462126312241ca860e8184507bd7ed4955450
2018-03-18 16:42:57 +01:00
Jan Henning
dffaacd92c Bug 1414084 - Part 7 - Use one set of functions for managing MenuItems in the UI. r=Grisha
The original add-on functions have some additional capabilities regarding e.g.
checkboxes, disabling the menu, etc. that right now aren't required for
Webextensions (yet?), but in that case they will simply not be used - in any
case BrowserActions.jsm controls what functionality is actually exposed to
add-ons.

MozReview-Commit-ID: DPT8gV2gb6q

--HG--
extra : rebase_source : 09a0a52c374c1c423002e9dcb5edc0c7e2730bbd
2018-03-18 14:17:03 +01:00
Jan Henning
6a1b2755c2 Bug 1414084 - Part 6 - Use only one list to store menu items added from Gecko. r=Grisha
Now that the UI code for handling both the old NativeWindow API and Web-
extensions is more or less the same and both are using the same MenuItemInfo
class, there's no longer any real need to keep items added through the two APIs
in separate lists - in fact doing so makes it harder to preserve the ordering
of menu items if the activity and its menu are destroyed and need to be re-
created later on from the stored lists of MenuItemInfos.

MozReview-Commit-ID: KlJdvO9WhhY

--HG--
extra : rebase_source : 2d28262f72acaa0e0e6966f8309ef9569d3f6314
2018-03-23 19:58:18 +01:00
Jan Henning
ca67107246 Bug 1414084 - Part 5 - Unify menu click event handling. r=Grisha
Now that both Webextensions and the NativeWindow API manage their onClick call-
back handling by UUID, we can start using the same EventDispatcher message for
both.

MozReview-Commit-ID: J3RRXrwPdTI

--HG--
extra : rebase_source : 7f136d70944641391e57a76efdec6546fe74cfd0
2018-03-18 14:24:15 +01:00
Jan Henning
c05debbbe2 Bug 1414084 - Part 4 - Move menu item ID generation into the UI. r=Grisha
Since the NativeWindow API now only uses UUIDs as well when dealing with its
consumers, we can leave generation of the menu to the Android UI code of
Firefox.

MozReview-Commit-ID: 1qDLDnePfFE

--HG--
extra : rebase_source : d1320f92ebd4be0237d3da554a3f8182a0e72d4e
2018-03-18 15:43:27 +01:00
Jan Henning
c0e12b4358 Bug 1414084 - Part 3 - Store NativeWindow menu callbacks by UUID. r=Grisha
MozReview-Commit-ID: 7nEhAUxOIsW

--HG--
extra : rebase_source : ed74e1df2ac1d86969c6fafcd22ac10b70b9836c
2018-03-18 13:33:42 +01:00
Jan Henning
951c14aa26 Bug 1414084 - Part 2 - Use UUIDs for the NativeWindow menu API, too. r=Grisha
At the moment, the code for handling of JS-created main menu items is more or
less duplicated between the old NativeWindow API and Webextensions, with the
only real difference being that the former communicates directly via menu item
IDs, while the latter uses UUIDs for messaging between Gecko and the UI.

By switching the NativeWindow API to using UUIDs as well, we will be able to
start unifying this code again.
As for backward compatibility
- the return value of NativeWindow.menu.add is valid for the current session
  only, so no migration is necessary
- the return value of NativeWindow.menu add was already effectively only an
  opaque value which only had real meaning for subsequent calls to menu.add,
  menu.update and menu.remove, so it shouldn't really matter whether we return
  a plain numeric ID or an UUID in string form
- old-style add-ons are now unsupported for better or for worse and our one in-
  tree caller won't have any problems with this change

MozReview-Commit-ID: HdRNhrx1pu7

--HG--
extra : rebase_source : 33ce855ac2f2f65fe20cb5047de3b8cbbcd094d9
2018-03-18 13:26:16 +01:00
Jan Henning
0e2c70d5ad Bug 1414084 - Part 1 - No longer track MenuItemInfo "added" data. r=Grisha
We no longer use that value anywhere, so we can just stop keeping track of it.

MozReview-Commit-ID: D1IgX1t8SKI

--HG--
extra : rebase_source : 51288c866bdd078aed629590ad39b2f8d524d044
2018-03-18 13:49:31 +01:00
Jan Henning
2939a122ab Bug 1414084 - Part 0 - Cleanups. r=Grisha
MozReview-Commit-ID: B3ZGN2X8JXH

--HG--
extra : rebase_source : 7d08937ab056a3a4733bd364e3518c1528146d37
2018-02-25 20:53:01 +01:00
Johan Lorenzo
86d185ecdd Bug 1470942 - part 1: Craft zip archive of maven artifacts r=jchen
Same as https://phabricator.services.mozilla.com/D2031 but keeps the old maven artifacts exposed.

Differential Revision: https://phabricator.services.mozilla.com/D2420

--HG--
extra : moz-landing-system : lando
2018-08-16 15:45:13 +00:00
dvarga
87db76ae1a Merge mozilla-central to mozilla-inbound on a CLOSED TREE
--HG--
extra : rebase_source : c9e6b9edae9ecf064d1318fa15d5d57ea42c102a
2018-08-16 01:22:36 +03:00
Jan Henning
e93ad5ad8e Bug 1476106 - Part 5 - Subscribe PromptService to OrientationChangeListener, too. r=snorp
Now that GeckoScreenOrientation generally offers notifications of screen
orientation changes, the PromptService no longer needs to do its own orientation
tracking and require to be fed orientation changes from each activity using it.

MozReview-Commit-ID: K7KbDsQip7b

--HG--
extra : rebase_source : 8b447d9db079794c9ad231a31a52f2787ab742ce
2018-08-02 21:17:07 +02:00
Jan Henning
619de3dc05 Bug 1476106 - Part 4 - Refresh ScreenManager data when detecting orientation changes. r=snorp
As of bug 1475875, cached screen data is now held by Gecko, so
- we no longer need to cache the screen size (retrieval of which can be
  expensive when called en masse, as required e.g. by font inflation) within
  GeckoAppShell, and
- we need to trigger a refresh of that data instead when the activity
  orientation changes.

MozReview-Commit-ID: JsY6sBCcOih

--HG--
extra : rebase_source : f286f3b01732bd724da3988c4713adb7329a5fae
2018-08-02 22:03:59 +02:00
Jan Henning
332e51ec37 Bug 1476106 - Part 3 - Move GeckoScreenOrientation updates into GeckoView. r=snorp
By moving the calls to GeckoScreenOrientation.update() into GeckoView, any app
using a GeckoView will automatically update the screen orientation in Gecko,
too, without any further action being required by the embedding app.

The synchronisation around GeckoScreenOrientation.update()/(un)lock() is
required for the following scenario:
If (un)locking of the screen orientation as requested by Gecko caused the
actual screen orientation of the app to change, there are two ways in which this
will cause our internal screen orientation to be updated:
1. Either the call to delegate.setRequestedOrientationForCurrentActivity
   (happening on the Gecko thread if the original request to (un)lock came from
   Gecko) returns first and update() is subsequently first called from the Gecko
   thread, too, meaning the onOrientationChange notification to Gecko can occur
   synchronously as well. In that case, as soon as (un)lock returns to Gecko,
   querying our internal screen orientation will return the correct value.
2. Or else the GeckoView.onConfigurationChanged() call resulting from the screen
   rotation manages to call GeckoScreenOrientation.update() first and does so
   from the Android UI thread. This means that the onOrientationChange
   notification will be redispatched asynchronously to the Gecko thread, while
   the Gecko thread's call to GeckoScreenOrientation.update() will return early
   without doing any work, as the screen orientation had already been previously
   updated by the UI thread.
   As a result,there will be a period of time between the Gecko thread returning
   from GeckoScreenOrientation.(un)lock() and the onOrientationChange
   notification finally executing where querying the internal screen
   orientation will not yet return the new orientation. This can cause problems
   for Gecko (test) code that expects to (un)lock the orientation and then be
   able to immediately query the new, changed orientation after the call to
   (un)lock returns.

Without additional measures in place, there are no guarantees at what point
the GeckoView will receive the onConfigurationChanged() call in relation to the
request to change the activity's orientation making its way back to (un)lock().
Therefore, we add synchronisation such that no other thread will be able to up-
date the screen orientation in GeckoScreenOrientation while another thread is
still busy (un)locking the screen orientation.

MozReview-Commit-ID: 5s5NEJcuS0p

--HG--
extra : rebase_source : cbfbc6da99aa23af4eee8c4bf6018359f9e71304
2018-08-12 13:31:59 +02:00
Jan Henning
85eac0f5c4 Bug 1476106 - Part 2 - Fix setting of mRuntime when restoring GeckoView from savedInstanceState. r=snorp
The call to mSession.transferFrom(ss.session) in the line above also transfers
the window from ss.session into mSession, which means we subsequently won't be
able to retrieve a runtime from ss.session any more, thereby defeating the goal
of calling mRuntime = ss.session.getRuntime().

This case is encountered e.g. when the containing activity is destroyed and sub-
sequently recreated after a configuration change that isn't handled by the app,
e.g. screen rotation in the GeckoView example app.

MozReview-Commit-ID: 5YGskdLZWqw

--HG--
extra : rebase_source : 3293fcaaf645706133531cb0180b6514a289b612
2018-08-04 15:21:40 +02:00
Jan Henning
50803fba6b Bug 1476106 - Part 1 - Make it possible to notify Java listeners from GeckoScreenOrientation, too. r=snorp
Once responsibility for notifying GeckoScreenOrientation of potentially changed
screen orientations moves from GeckoApp into GeckoView, the former will no
longer be able to benefit from the return value of calling GeckoScreen-
Orientation.update(), indicating whether the orientation actually changed or in
fact remained the same.

GeckoApp however requires that information in order to reset/refresh parts of
the UI when the orientation changes, and since GeckoScreenOrientation is already
doing all the work of tracking screen orientation changes, we don't want to have
to partially duplicate those efforts again in GeckoApp.

Instead, we introduce a mechanism for GeckoScreenOrientation to notify
interested parties on the Android app side as well.

The GeckoScreenOrientation.update() call in GeckoApp.onResume() is removed
completely (as opposed to merely removing the refreshChrome() bit) at this stage
already because it is unnecessary. If any screen rotation happened while the
activity was in background, it will receive an onConfigurationChanged() call
anyway before being resumed again.

MozReview-Commit-ID: Ila1evcj8Ud

--HG--
extra : rebase_source : f342800628f930d717fe346779894793a1bac0e9
2018-08-02 21:10:33 +02:00
Jan Henning
6cb9ac4f6b Bug 1476106 - Part 0 - Cleanup imports. r=JanH
MozReview-Commit-ID: UHUdrWSIks

--HG--
extra : rebase_source : e0e64d55db9898d3c19ed4342e200d51326b3a30
2018-08-02 20:51:17 +02:00
Geoff Brown
2b831a4422 Bug 1483563 - Remove 'mach autophone'; r=bc
Autophone has been retired.
2018-08-15 12:54:08 -06:00
Narcis Beleuzu
23387914d5 Merge inbound to mozilla-central. a=merge 2018-08-15 12:48:57 +03:00
Cosmin Sabou
ba5b2095eb Merge mozilla-central to autoland. a=merge 2018-08-15 04:56:53 +03:00
Cosmin Sabou
1c8ad7b4ba Merge mozilla-inbound to mozilla-central. a=merge 2018-08-15 03:51:45 +03:00
arthur.iakab
f9a9a62aa4 Merge autoland to mozilla-central a=merge 2018-08-15 00:59:17 +03:00
Ryan VanderMeulen
765c63d4a4 Bug 1483190 - Only enable LTO if the NDK is available. r=froydnj, a=RyanVM
--HG--
extra : amend_source : 852075195504f2aa4071535c799ce2cb1b96c599
2018-08-14 14:12:56 -04:00
Mike Hommey
df7897447c Bug 1480006 - Enable LTO on Android CI builds a=bustage-fix
--HG--
extra : amend_source : 8edcde344ef682f079b3f4891ecb4c35c69be68c
extra : histedit_source : 1565dd6b287d12f6d4f8d55f872346aaddecf70a
2018-08-14 14:07:15 +03:00
Matt Brubeck
acd631b030 Bug 1481471 - Implement browser.tab.getActive() in GeckoView. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D3355

--HG--
extra : rebase_source : 493842fd508f221c839afe676a60e6a419fc2506
2018-08-14 11:05:12 -07:00
Matt Brubeck
26c55096bd Bug 1481471 - Allow browser.tabs extension APIs to find GeckoView windows. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D3354

--HG--
extra : rebase_source : 862cbd51434542f63f3ec2b567cd1f5865c66c54
2018-08-14 10:53:49 -07:00
Matt Brubeck
64b5dfd4c7 Bug 1481471 - Remove some cruft left behind by Bug 1481471. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D3353

--HG--
extra : rebase_source : d21eaab943e795e95c75032ff137644952f680e2
2018-08-13 10:48:56 -07:00
Jan Henning
91898192c1 Bug 1482478 - Treat handler attribute in notification message as optional. r=jchen
Differential Revision: https://phabricator.services.mozilla.com/D3359

--HG--
extra : moz-landing-system : lando
2018-08-14 21:25:03 +00:00
arthur.iakab
34ad5ebaac Merge mozilla central to inbound 2018-08-15 01:05:50 +03:00
Mike Hommey
288e82c02c Bug 1480006 - Enable LTO on Android CI builds. r=froydnj 2018-08-14 08:26:47 +09:00
Andreea Pavel
870fc40e66 Merge mozilla-central to autoland. a=merge on a CLOSED TREE 2018-08-14 19:17:13 +03:00
Dennis Schubert
c4663c5965 Bug 1483233 - Add mobile User Agent overrides for eBay domains. r=miketaylr
Differential Revision: https://phabricator.services.mozilla.com/D3343

--HG--
extra : moz-landing-system : lando
2018-08-14 15:53:36 +00:00
Kris Maglione
f99ee35b82 Bug 1480244: Part 5 - Run most framescripts in shared scope. r=mconley
Creating non-shared scopes for frame scripts is fairly expensive. After these
changes it's even more expensive. However, many frame scripts have no use for
the shared scopes at all. Run-once scripts which execute in closures, for
instance, make no use of them. And after bug 1472491, neither do most of our
default frame scripts.

MozReview-Commit-ID: 9PK7bYdQ0yh

--HG--
extra : rebase_source : db2516d2f00a75e233e1957649f2b62a9299b7cd
2018-08-10 13:58:18 -07:00
Andreea Pavel
fba9b7255c Merge mozilla-central to mozilla-inbound. a=merge on a CLOSED TREE 2018-08-14 19:19:03 +03:00
Kris Maglione
9d0fd10b85 Bug 1472491: Part 5n - Add AudioPlaybackChild actor. r=felipe
MozReview-Commit-ID: DtGNW4riHQX

--HG--
rename : toolkit/content/browser-content.js => toolkit/actors/AudioPlaybackChild.jsm
extra : rebase_source : d37eef766306f0967ac4c13b4705e32197f7d0f6
2018-07-29 21:27:32 -07:00
Kris Maglione
739cafdadd Bug 1472491: Part 4a - Add helper classes for lazily loading JS IPC actors. r=felipe
This adds the basic framework for defining IPC actors which are lazily
instantiated for the appropriate frame loaders based on DOM events, message
manager messages, and observers. Actual actors are defined in follow-up
commits.

MozReview-Commit-ID: Jb6CWWW7v3v

--HG--
extra : rebase_source : 6c465c492ef423616346d70047c4fd4b074af303
2018-08-11 15:27:12 -07:00
Andrei Lazar
ebcbb5d03f Bug 1477700 Android media notification appears swiped down after video starts r=JanH
Created a dedicated channel for media notifications.

MozReview-Commit-ID: JKFVPNRu2WO

--HG--
extra : rebase_source : f9df42ecae1467c337c0d4bdbd5c5582e47c582c
2018-08-14 13:47:02 +03:00
Eugen Sawin
2b5ddea72f Bug 1479026 - Adjust GeckoView telemetry API tests to match corrected schema. r=janerik 2018-08-13 15:22:52 +02:00
Petru Lingurar
4b11eb4490 Bug 1480421 - Crash reporter not working prior to Android O r=jchen
Summary:
When running on pre Oreo devices CrashReportingService (a JobIntentService)
is started as a regular Service.
Return super.onStartCommand(..) to make sure onHandleWork() would be caled.

Reviewers: sdaswani, VladBaicu, jchen

Reviewed By: jchen

Bug #: 1480421

Differential Revision: https://phabricator.services.mozilla.com/D3102

--HG--
extra : rebase_source : 78d83fca65b000a10e2f8b522c8ee57cd364a829
extra : histedit_source : 71a48d23421fec60ded4c0c45c8cafb8927196ab
2018-08-11 11:52:17 +03:00
Petru Lingurar
4d043f9fc6 Bug 1480806 - Remove javascript intent filter if unused r=jchen
Reviewers: jchen

Reviewed By: jchen

Bug #: 1480806

Differential Revision: https://phabricator.services.mozilla.com/D3105

--HG--
extra : rebase_source : ac696c1611589566ef98c6433bf8a2b272b881d4
extra : histedit_source : 54a20b0fceeb0b22c94202c7cd7986b97f027158
2018-08-11 11:49:13 +03:00
Mike Hommey
f4f54e5aeb Bug 1482330 - Upgrade to Android NDK r17b and API level 16 (JB). r=snorp
We're currently using NDK r15c, which is rather old, and happens to come
with a buggy gold linker. Let's use a more recent NDK, with a fixed
linker.

Unfortunately, we're currently at NDK API level 9, which the newer NDK
doesn't provide for x86 anymore. But that corresponds to Gingerbread
(2.3), which we've long stopped supporting. On the SDK side, we already
dropped support of versions before Jelly Bean, so we can do the same on
the NDK side. That corresponds to API level 16. So let's just use that
as a baseline.

Another change in the newer NDK is that the target-name changed from
i386-linux-android to i686-linux-android, so adjust for that in the
android x86 mozconfigs.
2018-08-11 09:47:41 +09:00
Bogdan Tara
347da2ba78 Backed out changeset 003838e8d110 (bug 1482330) for Adnroid build bustages on mozalloc_abort.cpp CLOSED TREE 2018-08-11 03:22:58 +03:00
Bogdan Tara
2f2b719960 Merge mozilla-central to mozilla-inbound. a=merge CLOSED TREE 2018-08-11 01:01:18 +03:00
Mike Hommey
ee95699e6b Bug 1482330 - Upgrade to Android NDK r17b and API level 16 (JB). r=snorp
We're currently using NDK r15c, which is rather old, and happens to come
with a buggy gold linker. Let's use a more recent NDK, with a fixed
linker.

Unfortunately, we're currently at NDK API level 9, which the newer NDK
doesn't provide for x86 anymore. But that corresponds to Gingerbread
(2.3), which we've long stopped supporting. On the SDK side, we already
dropped support of versions before Jelly Bean, so we can do the same on
the NDK side. That corresponds to API level 16. So let's just use that
as a baseline.

Another change in the newer NDK is that the target-name changed from
i386-linux-android to i686-linux-android, so adjust for that in the
android x86 mozconfigs.
2018-08-11 06:50:21 +09:00
Yura Zenevich
e0c82272d3 Bug 1481924 - added GevkoView accessibility tests for scrolling. r=eeejay, jchen
MozReview-Commit-ID: ATGNFruDGAI
2018-08-10 13:13:35 -04:00