Граф коммитов

374 Коммитов

Автор SHA1 Сообщение Дата
Alastor Wu c66d507f46 Bug 1577890 - part3 : remove media control related code in AndroidBridge. r=snorp
These attribute and method were added for media control in Fennec and it seems we forgot to clean them.

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

--HG--
extra : moz-landing-system : lando
2020-03-05 22:40:55 +00:00
Hiroyuki Ikezoe 6e7f3aff6a Bug 1607124 - Query system colors in child processes directly. r=geckoview-reviewers,snorp
Using LookAndFeelInt to query system colors is awkward, it's normally used for
eIntID_XX values.

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

--HG--
extra : moz-landing-system : lando
2020-01-07 15:41:07 +00:00
John Lin e1b8252731 Bug 1581902 - p3: expose H.264 HW availability to AndroidBridge. r=esawin
Also rename existing utility functions to reflect that they are for VP8 only.

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

--HG--
extra : moz-landing-system : lando
2019-10-08 17:15:35 +00:00
Daniel Varga 27d99ab2df Backed out 6 changesets (bug 1581902) for xpcshell failure at xpcshell/rs-blocklist/test_gfxBlacklist_Equal_DriverNew.js. On a CLOSED TREE
Backed out changeset c900fdf28f82 (bug 1581902)
Backed out changeset 92c9ea70040d (bug 1581902)
Backed out changeset 1f588b5bf019 (bug 1581902)
Backed out changeset f837f2c5224f (bug 1581902)
Backed out changeset 44e248976099 (bug 1581902)
Backed out changeset c7dfff053f71 (bug 1581902)
2019-10-07 23:07:36 +03:00
John Lin a5276b6ecb Bug 1581902 - p3: expose H.264 HW availability to AndroidBridge. r=esawin
Also rename existing utility functions to reflect that they are for VP8 only.

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

--HG--
extra : moz-landing-system : lando
2019-10-01 16:55:01 +00:00
Kris Taeleman 3bd0cbdc09 Bug 1578506 - Add better monitor information to about:support. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D47110

--HG--
extra : moz-landing-system : lando
2019-10-03 23:43:35 +00:00
Makoto Kato ae43a8cf0a Bug 676268 - Part 1. Support text/html on Android clipboard backend. r=geckoview-reviewers,snorp
Summary: Actually, we only support `text/unicode` mime type on Android clipboard backend.  But Android API 16+ supports `text/html`, so we should support this type since Chrome/Blink already supports it.

Reviewers: #geckoview-reviewers, snorp

Reviewed By: #geckoview-reviewers, snorp

Bug #: 676268

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

--HG--
extra : rebase_source : 17ef0aa06b83b812bb9bccfab93a72e0b37f9652
2019-03-20 14:47:19 +09:00
Tooru Fujisawa 7983faeb5d Bug 1511393 - Use c-basic-offset: 2 in Emacs mode line for C/C++ code. r=nbp 2018-12-01 04:52:05 +09:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
James Willcox f1b8f63457 Bug 1475875 - Use ScreenManager on Android r=esawin,jchen
This ensures we have screen information with e10s.

MozReview-Commit-ID: 1zghxZuLqr3
2018-08-07 14:14:32 -05:00
James Willcox 0a29f4fcc4 Backed out Bug 1475875 due to Chromecast breakage. r=backout
MozReview-Commit-ID: IUjur089BVS
2018-07-31 13:11:14 -05:00
James Willcox e20b654b18 Bug 1475875 - Use ScreenManager on Android r=esawin
This makes sure things work under e10s, but also results
in simplified code since we weren't actually using the
features of nsScreenManagerAndroid any more.

MozReview-Commit-ID: 1zghxZuLqr3
2018-07-30 11:21:33 -05:00
Boris Zbarsky 55cdcb3d94 Bug 1451929. Get rid of DOMCursor. r=qdot 2018-04-05 20:31:03 -04:00
Nathan Froyd 6a1d9cac49 Bug 1448016 - make some Android widget constructors explicit; r=snorp
Attempting to stand up the static analysis for Android builds revealed
that we weren't being explicit enough.
2018-03-27 10:51:32 -04:00
Jim Chen 984efaf88e Bug 1406168 - 4. Remove unused code; r=snorp
Remove AndroidJNI.cpp, which is empty. Also remove some JNI string
functions that are unused from AndroidBridge.

MozReview-Commit-ID: CsP4L0TyN48
2017-11-01 14:48:48 -04:00
Jim Chen e16afc583e Bug 1384828 - Use tid for UI thread detection; r=esawin
Use the UI thread's tid for checking if we're on the UI thread in Gecko.
This lets us get rid of `GeckoThread.registerUiThread`, in order to
avoid a race where we check for UI thread before `registerUiThread` is
called.

MozReview-Commit-ID: 11gAWgx4UZo
2017-08-03 13:06:16 -04:00
Randall Barker 590cfe546d Bug 1367850 - Move Android UI thread runnable queue from AndroidBridge to AndroidUiThread r=jchen
MozReview-Commit-ID: 4okw7R2P2LC
2017-07-03 17:18:50 -07:00
Sebastian Hengst 24262bb678 Backed out changeset a6f8452cbd4b (bug 1367850) for Android mochitest crashes with EnqueueTask, e.g. bugs 1376668, 1376669, 1376670, test_ext_background_generated_url.html. r=backout a=backout
MozReview-Commit-ID: HiaJZ8N9J8O
2017-06-29 03:19:50 +02:00
Randall Barker 49e524747b Bug 1367850 - Move Android UI thread runnable queue from AndroidBridge to AndroidUiThread r=jchen
MozReview-Commit-ID: 4okw7R2P2LC
2017-06-27 14:42:15 -07:00
Alastor Wu 7dad8534a8 Bug 1347648 - part1 : only request Android audio focus for audible media. r=snorp
For non-audible media, we shouldn't request audio focus because it might interrupt
other app who is playing music or podcast.

MozReview-Commit-ID: 25iWJktgKUw

--HG--
extra : rebase_source : ca96240967131d2d6cab00f7a39c0ef4e6f2df78
2017-03-27 10:59:04 +08:00
Andrea Marchesini 12b54aa0f5 Bug 1299500 - Get rid of DeviceStorage API - part 10 - DeviceStorage, r=ehsan, r=billm 2017-03-08 20:15:45 +01:00
Jim Chen c9a4e01072 Bug 1333590 - 6. Remove GeckoEventListener and NativeEventListener; r=snorp r=sebastian
Remove GeckoEventListener and NativeEventListener now that we uniformly
use BundleEventListener. Also remove related classes NativeJSContainer,
NativeJSObject, and GeckoRequest, as well as related tests and C++
code.

The "Messaging" object in Messaging.jsm is replaced with a dummy object
that redirect calls to the global and/or window event dispatcher.
2017-02-01 17:35:45 -05:00
Randall Barker b5df4e8ab9 Bug 1319850 - part 3, Convert AndroidBridge::PostTaskToUiThread to use nsIRunnable instead of mozilla::Runnable r=jchen 2016-12-23 09:08:31 -08:00
Wes Kocher 0992df4676 Backed out 4 changesets (bug 1319850) for android xpcshell bustage a=backout
Backed out changeset 15b92bb6d810 (bug 1319850)
Backed out changeset e31107c3f677 (bug 1319850)
Backed out changeset 2a8012945a74 (bug 1319850)
Backed out changeset 8717bea884c9 (bug 1319850)
2016-12-22 18:16:34 -08:00
Randall Barker 3778c365d9 Bug 1319850 - part 3, Convert AndroidBridge::PostTaskToUiThread to use nsIRunnable instead of mozilla::Runnable r=jchen 2016-12-22 16:15:14 -08:00
Jim Chen dd02faa8d1 Bug 1317604 - 3. Don't create EventDispatcher when JNI is not available; r=me
Follow-up to not create the global EventDispatcher in AndroidBridge when
JNI is not available.
2016-11-21 14:14:32 -05:00
Jim Chen ff3982e634 Bug 1307820 - Implement per-GeckoView messaging; r=snorp r=sebastian
Bug 1307820 - 1a. Move GeckoApp EventDispatcher to GeckoView; r=snorp

Make it a GeckoView-specific EventDispatcher instead of
GeckoApp-specific, so that GeckoView consumers can benefit from a
per-view EventDispatcher. In addition, a few events like Gecko:Ready are
moved back to the global EventDispatcher because that makes more sense.

Bug 1307820 - 1b. Don't use GeckoApp EventDispatcher during inflation; r=snorp

During layout inflation, we don't yet have GeckoView and therefore the
GeckoView EventDispatcher, so we should not register events until later,
typically during onAttachedToWindow.

Bug 1307820 - 2. Introduce GeckoBundle; r=snorp

The Android Bundle class has several disadvantages when used for holding
structured data from JS.

The most obvious one is the differentiation between int and double,
which doesn't exist in JS. So when a JS number is converted to either a
Bundle int or double, we run the risk of making a wrong conversion,
resulting in a type mismatch exception when Java uses the Bundle. This
extends to number arrays from JS.

There is one more gotcha when using arrays. When we receive an empty
array from JS, there is no way for us to determine the type of the
array, because even empty arrays in Java have types. We are forced to
pick an arbitrary type like boolean[], which can easily result in a type
mismatch exception when using the array on the Java side.

In addition, Bundle is fairly cumbersome, and we cannot access the inner
structures of Bundle from Java or JNI, making it harder to use.

With these factors in mind, this patch introduces GeckoBundle as a
better choice for Gecko/Java communication. It is almost fully
API-compatible with the Android Bundle; only the Bundle array methods
are different. It resolves the numbers problem by performing conversions
if necessary, and it is a lot more lightweight than Bundle.

Bug 1307820 - 3. Convert BundleEventListener to use GeckoBundle; r=snorp

Convert BundleEventListener from using Bundle to using GeckoBundle.
Because NativeJSContainer still only supports Bundle, we do an extra
conversion when sending Bundle messages, but eventually, as we eliminate
the use of NativeJSContainer, that will go away as well.

Bug 1307820 - 4. Introduce EventDispatcher interfaces; r=snorp

Introduce several new XPCOM interfaces for the new EventDispatcher API,
these interfaces are mostly mirrored after their Java counterparts.

* nsIAndroidEventDispatcher is the main interface for
  registering/unregistering listeners and for dispatching events from
  JS/C++.

* nsIAndroidEventListener is the interface that JS/C++ clients implement
  to receive events.

* nsIAndroidEventCallback is the interface that JS/C++ clients implement
  to receive responses from dispatched events.

* nsIAndroidView is the new interface that every window receives
  that is specific to the window/GeckoView pair. It is passed to chrome
  scripts through window arguments.

Bug 1307820 - 5. Remove EventDispatcher references from gfx code; r=snorp

EventDispatcher was used for JPZC, but NPZC doesn't use it anymore.

Bug 1307820 - 6. General JNI template improvements; r=snorp

This patch includes several improvements to the JNI templates.

* Context::RawClassRef is removed to avoid misuse, as Context::ClassRef
  should be used instead.

* Fix a compile error, in certain usages, in the DisposeNative overload
  in NativeStub.

* Add Ref::IsInstanceOf and Context::IsInstanceOf to mirror the
  JNIEnv::IsInstanceOf call.

* Add Ref::operator* and Context::operator* to provide an easy way to
  get a Context object.

* Add built-in declarations for boxed Java objects (e.g. Boolean,
  Integer, etc).

* Add ObjectArray::New for creating new object arrays of specific types.

* Add lvalue qualifiers to LocalRef::operator= and GlobalRef::operator=,
  to prevent accidentally assigning to rvalues. (e.g.
  `objectArray->GetElement(0) = newObject;`, which won't work as intended.)

Bug 1307820 - 7. Support ownership through RefPtr for native JNI objects; r=snorp

In addition to direct ownership and weak pointer ownership, add a third
ownership model where a native JNI object owns a RefPtr that holds a
strong reference to the actual C++ object. This ownership model works
well with ref-counted objects such as XPCOM objects, and is activated
through the presence of public members AddRef() and Release() in the C++
object.

Bug 1307820 - 8. Implement Gecko-side EventDispatcher; r=snorp

Add a skeletal implementation of EventDispatcher on the Gecko side.
Each widget::EventDispatcher will be associated with a Java
EventDispatcher, so events can be dispatched from Gecko to Java and vice
versa. AndroidBridge and nsWindow will implement
nsIAndroidEventDispatcher through widget::EventDispatcher.

Other patches will add more complete functionality such as
GeckoBundle/JSObject translation and support for callbacks.

Bug 1307820 - 9. Implement dispatching between Gecko/Java; r=snorp

Implement translation between JSObject and GeckoBundle, and use that for
dispatching events from Gecko to Java and vice versa.

Bug 1307820 - 10. Implement callback support; r=snorp

Implement callback support for both Gecko-to-Java events and
Java-to-Gecko events.

For Gecko-to-Java, we translate nsIAndroidEventCallback to a Java
EventCallback through NativeCallbackDelegate and pass it to the Java
listener.

For Java-to-Gecko, we translate EventCallback to a
nsIAndroidEventCallback through JavaCallbackDelegate and pass it to the
Gecko listener.  There is another JavaCallbackDelegate on the Java side
that redirects the callback to a particular thread. For example, if the
event was dispatched from the UI thread, we make sure the callback
happens on the UI thread as well.

Bug 1307820 - 11. Add BundleEventListener support for Gecko thread; r=snorp

Add support for BundleEventListener on the Gecko thread, so that we can
use it to replace any existing GeckoEventListener or NativeEventListener
implementations that require the listener be run synchronously on the
Gecko thread.

Bug 1307820 - 12. Add global EventDispatcher in AndroidBridge; r=snorp

Add an instance of EventDispatcher to AndroidBridge to act as a global
event dispatcher.

Bug 1307820 - 13. Add per-nsWindow EventDispatcher; r=snorp

Add an instance of EventDispatcher to each nsWindow through an
AndroidView object, which implements nsIAndroidView. The nsIAndroidView
is passed to the chrome script through the window argument when opening
the window.

Bug 1307820 - 14. Update auto-generated bindings; r=me

Bug 1307820 - 15. Update testEventDispatcher; r=snorp

Update testEventDispatcher to include new functionalities in
EventDisptcher.

* Add tests for dispatching events to UI/background thread through
  nsIAndroidEventDispatcher::dispatch.

* Add tests for dispatching events to UI/background thread through
  EventDispatcher.dispatch.

* Add tests for dispatching events to Gecko thread through
  EventDispatcher.dispatch.

Each kind of test exercises both the global EventDispatcher through
EventDispatcher.getInstance() and the per-GeckoView EventDispatcher
through GeckoApp.getEventDispatcher().
2016-11-14 21:29:50 +08:00
Michelangelo De Simone 07411b2cc6 Bug 1310027 - Remove DOM/mobilemessage and related code. r=Ehsan
MozReview-Commit-ID: ENmSuOCdTnA

--HG--
extra : rebase_source : a178eee07034fb2aa1415b64bec1946230fd1c5e
2016-10-17 17:26:51 -07:00
Jim Chen a60e069206 Bug 1306083 - 3. Remove obsolete code from AndroidBridge; r=snorp
Remove the global layer client object from AndroidBridge, now that it's
no longer used. Also remove other associated calls that are no longer
used.
2016-10-03 12:26:00 -04:00
Jim Chen 26526e7e66 Bug 1306083 - 2. Pass in window object for nsIAndroidBridge calls; r=snorp
Make contentDocumentChanged and isContentDocumentDisplayed calls require
the caller to pass in a window object, so that we can get the widget and
GeckoLayerClient from the window object. This way these calls no longer
depend on having a global layer client in AndroidBridge.
2016-10-03 12:26:00 -04:00
Jim Chen 39ed66e9ec Bug 1305271 - 1. Move GetClassGlobalRef out of AndroidBridge; r=snorp
Move GetClassGlobalRef in AndroidBridge to GetClassRef in jni/Utils. The
new function now returns a local reference instead of a global
reference.
2016-09-28 23:49:25 -04:00
Jim Chen 27143e4fba Bug 1303806 - 3. Update sources to reflect new bindings; r=snorp r=nalexander
Update #includes to use new headers if necessary. Also remove a couple
of functions in AndroidBridge to clean up the code.
2016-09-20 17:42:08 -04:00
Alastor Wu 9069f0f0d5 Bug 1290467 - part2 : request audio focus for any media instead of audible one. r=snorp
Previous design is only to request audio focus for audible media, but now we
also request focus for non-audible media.

It's simple that the app should own the focus when users start watching media.

MozReview-Commit-ID: 3eJP26h4kh7

--HG--
extra : rebase_source : b35c4ef7d6560635f428eba445f089abd3844bda
2016-09-09 09:49:25 +08:00
Jim Chen ab92abb418 Bug 1296744 - Make cameraCallbackBridge use new native JNI bindings; r=snorp
Make the GeckoAppShell.cameraCallbackBridge callback use the new native
JNI bindings. Also refactor the relevant code in GeckoAppShell and
CameraStreamImpl.
2016-08-26 12:26:46 -04:00
Randall Barker e2ca496e35 Bug 1297850 - part 1, Remove dead code left behind after JPZ removal. r=jchen 2016-08-25 17:26:42 -07:00
Wes Kocher 1f49af4fc0 Backed out 2 changesets (bug 1297850) for robocop bustage a=backout CLOSED TREE
Backed out changeset e83c9eb279a9 (bug 1297850)
Backed out changeset 979694026137 (bug 1297850)
2016-08-25 11:29:35 -07:00
Randall Barker 4839c748eb Bug 1297850 - part 1, Remove dead code left behind after JPZ removal. r=jchen 2016-08-25 08:14:52 -07:00
Jim Chen 3bd8918fcf Bug 1294479 - Remove ANativeWindow methods from AndroidBridge; r=snorp
The ANativeWindow methods in AndroidBridge are just wrappers around
ANativeWindow calls in the NDK. We should just use those calls instead
of going through the wrappers.
2016-08-19 17:17:24 -04:00
Jim Chen 39e01a1284 Bug 1294479 - Remove presentation methods from nsWindow/AndroidBridge; r=snorp
Remove the presentation methods from nsWindow/AndroidBridge now that
they are not used. This also eliminates gGeckoViewWindow from nsWindow.
NS_PRESENTATION_WINDOW and NS_PRESENTATION_SURFACE constants are added
for GetNativeData/SetNativeData to provide replacements that support
multiple GeckoViews/nsWindows.
2016-08-19 17:17:24 -04:00
Randall Barker 983cc6b2d1 Bug 1291373 - [geckoview] part 4, Remove GeckoEvent and AndroidGeckoEvent r=jchen 2016-08-16 14:33:43 -07:00
Randall Barker c1e108f7ad Bug 1291373 - [geckoview] part 1, Remove JavaPanZoomController (JPZ) from mobile/android r=snorp 2016-08-16 14:33:43 -07:00
Wes Kocher d602abb016 Merge inbound to central, a=merge 2016-08-15 14:20:38 -07:00
Makoto Kato 191d54e86a Bug 1293585 - Remove more unused members in AndroidBridge after bug 1255628. r=snorp
MozReview-Commit-ID: C8W4dnY2his

--HG--
extra : rebase_source : 6214c05db368a9868916d6bc2e4703ff921bf997
2016-08-09 17:18:02 +09:00
Jim Chen 75ce4d9aaa Bug 1292323 - Move Java UI thread registration to mozglue; r=snorp
We need to register the Java UI thread in native code very early in the
startup process, before libxul registers its JNI entry points. So it
makes sense to register the Java UI thread in mozglue.
2016-08-12 23:15:52 -04:00
Carsten "Tomcat" Book cf611bec79 merge mozilla-inboudn to mozilla-central a=merge 2016-08-05 12:01:14 +02:00
Jim Chen 535fa2c33f Bug 1288821 - Refactor Java notification interface; r=snorp
Refactor the notification-related methods in GeckoAppShell. In
particular, combine showPersistentAlertNotification into
showAlertNotification, and move code out of AndroidBridge.
2016-08-04 09:17:54 -04:00
Jim Chen 580a7782fe Bug 1288834 - Remove ZOOMEDVIEW event from GeckoEvent; r=snorp
Remove the now-obsolete ZOOMEDVIEW event from GeckoEvent, and the
associated code in nsAppShell and AndroidBridge.
2016-08-04 09:15:17 -04:00
James Willcox 26bcde6a5e Bug 1255628 - Replace and/or remove some graphics-related calls in AndroidBridge with NDK equivalents r=jchen 2016-08-04 09:23:34 -05:00
Makoto Kato 36599f24c5 Bug 1288616 - Part 2. Remove unused ANativeWindow_fromSurfaceTexture and android_SurfaceTexture_getNativeWindow. r=snorp
MozReview-Commit-ID: 40rPBLzoLPO

--HG--
extra : rebase_source : 4ab9b4a45610df1be14c764a9927f78cc2d0a4a9
extra : histedit_source : 6f6821be672f77c57352355390eab6b0ab909ce1
2016-07-22 14:40:42 +09:00
Makoto Kato a0e21d5dea Bug 1288616 - Part 1. Remove unused AcquireNativeWindowFromSurfaceTexture / ReleaseNativeWindowForSurfaceTexture. r=snorp
MozReview-Commit-ID: 15SfycJX9Wn

--HG--
extra : rebase_source : b746aca45f437b56911b8034e8919cc2b8b6ce2c
extra : histedit_source : f915d9ce02a3fb564d7ff4593c0a2fe022f22de1
2016-07-22 14:39:09 +09:00