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

113 Коммитов

Автор SHA1 Сообщение Дата
Jim Chen d5f3264031 Bug 1442250 - 5. Reset native queue early when transferring; r=esawin
When we reset the old native queue when transferring to another session,
perform the reset right after the transfer() call, instead of in
onTransfer(), which is too late for clearing stale pending calls.

Then, after transferring to a new queue, let Gecko call Window.onReady
to set the new queue's state if needed. That way the Java queue state is
consistent with the Gecko state.

MozReview-Commit-ID: CUXGrhR4FCD

--HG--
extra : rebase_source : a196361f1db1304c178a3471082d586dddfe2a32
2018-03-09 12:34:38 -05:00
Eugen Sawin 05eba99d35 Bug 1432235 - [1.2] Move GeckoView API classes to org.mozilla.geckoview. r=snorp,jchen 2018-02-22 00:46:26 +01:00
Jim Chen 7d5be27cff Bug 1416918 - 5. Update generated bindings; r=jchen
MozReview-Commit-ID: JF2T2i1xyGy

--HG--
extra : rebase_source : ce75ae2339c8514a9fa74658298b1bd6c9138d17
2017-12-13 22:57:22 -05:00
Jim Chen 675847149d Bug 1416316 - 4. Update comments and bindings; r=jchen
MozReview-Commit-ID: 9CBe7Iej1D8

--HG--
extra : rebase_source : 0db28213833915747d9b34fe58458348a33458ad
2017-11-30 13:25:51 -05:00
Jim Chen 4fc4969b9b Bug 1415994 - 8. Update auto-generated bindings; r=jchen
MozReview-Commit-ID: 2r1V6Hvl5Pb

--HG--
extra : rebase_source : c0347e4d915d3f585a6971fc3048d1f658490ec6
2017-11-14 18:18:36 -05:00
Randall Barker 7fe4594a76 Bug 1413362 - part 1: Add GeckoVRManager to support GVR WebVR implementation on Android r=jchen,snorp
MozReview-Commit-ID: C7XTF8N1W9a
2017-11-07 10:50:14 -08:00
Jim Chen 832cd8d996 Bug 1415074 - Fix unresponsiveness after restoring GeckoView states; r=jchen
Fix a bug where GeckoView becomes unresponsive to dispatched events
after restoring states, due to the native queue not being restored.
r=me for small, tested patch.

MozReview-Commit-ID: K1cVjjNaZK1

--HG--
extra : rebase_source : b1329c84d82f5bdc06767bf310ca87e52ff6ec9b
2017-11-07 01:53:11 -05:00
Jim Chen edb0428314 Bug 1413698 - 2. Move GeckoView to GeckoSession; r=snorp
Rename GeckoView to GeckoSession. Strip out parts of it that depended on
being a subclass of View. Also strip out parts of it that dealt with
switching EventDispatcher and NativeQueue, because now there's only one
copy of each for each GeckoSession.

MozReview-Commit-ID: J699twtpmTS

--HG--
rename : mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoView.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoSession.java
extra : rebase_source : 60e045f6f1e6a70dcabc03f5a32cae5576c2edd8
2017-11-06 14:54:09 -05:00
Jim Chen 6fdb886eb4 Bug 1413698 - 1. Separate out attach() from open() in GeckoView.Window; r=snorp
Right now, `GeckoView.Window.open()` consists of opening a new Gecko
nsWindow and attaching it to the opening GeckoView. This patch separates
the attaching step into an `Window.attach()` function that was renamed
from `Window.reattach()`. Going forward, `Window.open()` and
`Window.close()` will correspond to opening and closing a session, which
`Window.attach()` will correspond to attaching a display to a session.

MozReview-Commit-ID: 94Un74pwizY

--HG--
extra : rebase_source : a7d9c6c3227de4b05e800d77a184f1deae9af5f8
2017-11-06 14:54:08 -05:00
Jim Chen 453375471c Bug 1412872 - 3. Remove native GeckoView loadUri call; r=snorp
Remove the native GeckoView loadUri call because it's Fennec-only.
Replace the call with a Fennec-only "Tab:OpenUri" event.

MozReview-Commit-ID: 7xZW9aceoPL
2017-11-01 14:54:03 -04:00
James Willcox 91a9c48755 Bug 1395497 - Regenerate JNI binding r=me
MozReview-Commit-ID: D1zqIMsH1fH
2017-10-30 10:58:56 -05:00
Jim Chen 2ec8c3aaff Bug 1378410 - 3. Update generated bindings; r=jchen
MozReview-Commit-ID: fKCoCqFmZk

--HG--
extra : rebase_source : a619627530b5216e591682f18f887ae2797cfeb7
2017-09-01 14:02:44 -04:00
Eugen Sawin ffad978150 Bug 1368701 - [1.2] Add shutdown intent action to shutdown Fennec. r=snorp,bc 2017-07-06 19:20:43 +02:00
James Cheng 0570b48852 Bug 1368907 - Part5 - Regenerate the JNI glue codes after renaming the java files. r=jolin
MozReview-Commit-ID: 88A44j5vmGv

--HG--
extra : rebase_source : b7ada44c84a9766fc4ebd8e187c27521f5994712
2017-06-12 16:30:57 +08:00
James Cheng ce2fbd2836 Bug 1350250 - Add a GeckoHlsResourceWrapper java glue. r=jolin,jya
MozReview-Commit-ID: KMAqkJSk2tT

--HG--
extra : rebase_source : efe73b1f70e5bde6c6d9fd7ad36ee98ad21eaf7c
2017-05-17 17:05:42 +08:00
Kilik Kuo 444875671e Bug 1350253 - Provide GeckoHlsDemuxerWrapper & corresponding generated JNI files as the glue for HLSDemuxer and GeckoHlsPlayer. r=jolin,jya
MozReview-Commit-ID: 62cnGQsmdNS

--HG--
extra : rebase_source : 4431d9e55f4ee38faeae50d03b46fbb57629fb8e
2017-05-25 20:48:03 +08:00
Jim Chen 3858e8e18e Bug 1363567 - 2. Move onFullScreenPluginHidden to GeckoApp; r=rbarker
Move the native call onFullScreenPluginHidden from GeckoAppShell to
GeckoApp itself.

MozReview-Commit-ID: APhGRBTNl0X
2017-05-15 23:11:18 -04:00
James Willcox 6247da6c0d Bug 1322650 - Update JNI bindings r=jchen
MozReview-Commit-ID: EjRjyY8BQxw
2017-05-15 09:37:54 -05:00
Iris Hsiao e22349b74b Backed out 11 changesets (bug 1322650) for media test failures on android. a=backout
Backed out changeset 31bd912fba54 (bug 1322650)
Backed out changeset 4d486c7469eb (bug 1322650)
Backed out changeset 4cf8f4d5064c (bug 1322650)
Backed out changeset 3cb108f7492f (bug 1322650)
Backed out changeset bd53533c108e (bug 1322650)
Backed out changeset 3522917d8f10 (bug 1322650)
Backed out changeset 2c2c1e33eccc (bug 1322650)
Backed out changeset 2f19977cd6ab (bug 1322650)
Backed out changeset 4519296a323e (bug 1322650)
Backed out changeset e56e5e1c8786 (bug 1322650)
Backed out changeset 96fe52231b57 (bug 1322650)

--HG--
extra : amend_source : b11d2181d8f545f4ed1074f09986eddab0b637c8
2017-05-12 10:21:14 +08:00
James Willcox 4a8c671a89 Bug 1322650 - Update JNI bindings r=jchen
MozReview-Commit-ID: EjRjyY8BQxw
2017-05-11 15:42:44 -05:00
Sebastian Hengst 2340610625 Backed out changeset 9d3843274c67 (bug 1322650) 2017-05-05 18:53:36 +02:00
James Willcox daee505699 Bug 1322650 - Update JNI bindings r=jchen
MozReview-Commit-ID: EjRjyY8BQxw
2017-05-05 08:56:38 -05:00
Randall Barker a606cd8b60 Bug 1335895 - Android GeckoView Dynamic Toolbar Version 3 r=botond,dvander,jchen,kats
This version of the Dynamic Toolbar moves the animation of the toolbar
from the Android UI thread to the compositor thread. All animation for
showing and hiding the toolbar are done with the compositor and a static
snapshot of the real toolbar.

MozReview-Commit-ID: BCe8zpbkWQt
2017-04-20 15:15:14 -07:00
John Lin ab9060d531 Bug 1349883 - part 3: resolve decode promise according to buffer status. r=jya
MozReview-Commit-ID: JwOOi56t30Y

--HG--
extra : rebase_source : 48f0cc0bfde3f84cc0574c5a5da6c738112c843f
2017-04-07 17:07:02 +08:00
James Willcox 224324d56d Bug 1344347 - Move Android out-of-process decoder service into GeckoView r=jolin
MozReview-Commit-ID: QTnp95uhQV


--HG--
rename : mobile/android/base/aidl/org/mozilla/gecko/media/FormatParam.aidl => mobile/android/geckoview/src/main/aidl/org/mozilla/gecko/media/FormatParam.aidl
rename : mobile/android/base/aidl/org/mozilla/gecko/media/ICodec.aidl => mobile/android/geckoview/src/main/aidl/org/mozilla/gecko/media/ICodec.aidl
rename : mobile/android/base/aidl/org/mozilla/gecko/media/ICodecCallbacks.aidl => mobile/android/geckoview/src/main/aidl/org/mozilla/gecko/media/ICodecCallbacks.aidl
rename : mobile/android/base/aidl/org/mozilla/gecko/media/IMediaDrmBridge.aidl => mobile/android/geckoview/src/main/aidl/org/mozilla/gecko/media/IMediaDrmBridge.aidl
rename : mobile/android/base/aidl/org/mozilla/gecko/media/IMediaDrmBridgeCallbacks.aidl => mobile/android/geckoview/src/main/aidl/org/mozilla/gecko/media/IMediaDrmBridgeCallbacks.aidl
rename : mobile/android/base/aidl/org/mozilla/gecko/media/IMediaManager.aidl => mobile/android/geckoview/src/main/aidl/org/mozilla/gecko/media/IMediaManager.aidl
rename : mobile/android/base/aidl/org/mozilla/gecko/media/Sample.aidl => mobile/android/geckoview/src/main/aidl/org/mozilla/gecko/media/Sample.aidl
rename : mobile/android/base/aidl/org/mozilla/gecko/media/SessionKeyInfo.aidl => mobile/android/geckoview/src/main/aidl/org/mozilla/gecko/media/SessionKeyInfo.aidl
rename : mobile/android/base/java/org/mozilla/gecko/media/AsyncCodec.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/AsyncCodec.java
rename : mobile/android/base/java/org/mozilla/gecko/media/AsyncCodecFactory.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/AsyncCodecFactory.java
rename : mobile/android/base/java/org/mozilla/gecko/media/Codec.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/Codec.java
rename : mobile/android/base/java/org/mozilla/gecko/media/CodecProxy.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/CodecProxy.java
rename : mobile/android/base/java/org/mozilla/gecko/media/FormatParam.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/FormatParam.java
rename : mobile/android/base/java/org/mozilla/gecko/media/GeckoMediaDrm.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoMediaDrm.java
rename : mobile/android/base/java/org/mozilla/gecko/media/GeckoMediaDrmBridgeV21.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoMediaDrmBridgeV21.java
rename : mobile/android/base/java/org/mozilla/gecko/media/GeckoMediaDrmBridgeV23.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoMediaDrmBridgeV23.java
rename : mobile/android/base/java/org/mozilla/gecko/media/JellyBeanAsyncCodec.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/JellyBeanAsyncCodec.java
rename : mobile/android/base/java/org/mozilla/gecko/media/MediaDrmProxy.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/MediaDrmProxy.java
rename : mobile/android/base/java/org/mozilla/gecko/media/MediaManager.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/MediaManager.java
rename : mobile/android/base/java/org/mozilla/gecko/media/RemoteMediaDrmBridge.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/RemoteMediaDrmBridge.java
rename : mobile/android/base/java/org/mozilla/gecko/media/RemoteMediaDrmBridgeStub.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/RemoteMediaDrmBridgeStub.java
rename : mobile/android/base/java/org/mozilla/gecko/media/SamplePool.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/SamplePool.java
rename : mobile/android/base/java/org/mozilla/gecko/media/SessionKeyInfo.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/SessionKeyInfo.java
rename : mobile/android/base/java/org/mozilla/gecko/mozglue/SharedMemory.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/SharedMemory.java
2017-04-06 14:32:58 -05:00
Makoto Kato 4d5b7f9b2d Bug 1350169 - Part 1. Remove Android backend for Alarm API. r=snorp
After landing bug 1300884 and B2G is dead, Web Alarm API is removed.  So we should remove Android backend for Alarm API. This implementation was for B2GDroid.

MozReview-Commit-ID: ItmjOQrVSgs

--HG--
extra : rebase_source : 1844b81c515c043245c9bed034698a1904f03286
2017-03-24 10:35:38 +09:00
Jim Chen b00f1b075f Bug 1344892 - Let native calls dispatch to XPCOM event queue; r=snorp
Bug 1344892 - 1. Add option to dispatch to priority queue; r=snorp

For the regular "gecko" option, change to dispatching to the XPCOM event
queue, and add a new "gecko_priority" option that dispatches calls to
the widget event queue. GeckoThread.waitOnGecko is changed to wait on
both the widget queue and the XPCOM queue. nsAppShell::SyncRunEvent is
changed to avoid a possible deadlock condition involving locking
sAppShellLock twice.

Bug 1344892 - 2. Update dispatchTo = "gecko" options; r=snorp

Update some existing dispatchTo = "gecko" options to "gecko_priority",
which typically involve UI events or JNI management calls like
disposeNative. As a rule, disposeNative is dispatched to the queue with
the least priority among the queues that other native members of the
same class dispatch to (i.e. "gecko_priority" if all other native
members dispatch to "gecko_priority", or "gecko" if any native members
dispatch to "gecko").

Bug 1344892 - 3. Update auto-generated bindings; r=me
2017-03-16 23:30:54 -04:00
Iris Hsiao 4f73e7bc5f Backed out changeset 4f5a93b89b2b (bug 1344892) for Mochitest rc4 failures in Android 2017-03-15 17:37:39 +08:00
Jim Chen 61f2f7ff7b Bug 1344892 - Let native calls dispatch to XPCOM event queue; r=snorp
Bug 1344892 - 1. Add option to dispatch to priority queue; r=snorp

For the regular "gecko" option, change to dispatching to the XPCOM event
queue, and add a new "gecko_priority" option that dispatches calls to
the widget event queue.

Bug 1344892 - 2. Update dispatchTo = "gecko" options; r=snorp

Update some existing dispatchTo = "gecko" options to "gecko_priority",
which typically involve UI events or JNI management calls like
disposeNative.

Bug 1344892 - 3. Update auto-generated bindings; r=me
2017-03-14 17:47:16 -04:00
Jim Chen 53a1107cd1 Bug 1343075 - Use GeckoEditableSupport from PuppetWidget; r=masayuki r=rbarker r=snorp r=esawin
Bug 1343075 - 1a. Add TextEventDispatcherListener::GetIMEUpdatePreference; r=masayuki

Add a GetIMEUpdatePreference method to TextEventDispatcherListener to
optionally control which IME notifications are received by NotifyIME.
This patch also makes nsBaseWidget forward its GetIMEUpdatePreference
call to the widget's native TextEventDispatcherListener.

Bug 1343075 - 1b. Implement GetIMEUpdatePreference for all TextEventDispatcherListener; r=masayuki

This patch implements GetIMEUpdatePreference for all
TextEventDispatcherListener implementations, by moving previous
implementations of nsIWidget::GetIMEUpdatePreference.

Bug 1343075 - 2. Allow setting a PuppetWidget's native TextEventDispatcherListener; r=masayuki

In PuppetWidget, add getter and setter for the widget's native
TextEventDispatcherListener. This allows overriding of PuppetWidget's
default IME handling. For example, on Android, the PuppetWidget's native
TextEventDispatcherListener will communicate directly with Java IME code
in the main process.

Bug 1343075 - 3. Add AIDL interface for main process; r=rbarker

Add AIDL definition and implementation for an interface for the main
process that child processes can access.

Bug 1343075 - 4. Set Gecko thread JNIEnv for child process; r=snorp

Add a JNIEnv* parameter to XRE_SetAndroidChildFds, which is used to set
the Gecko thread JNIEnv for child processes. XRE_SetAndroidChildFds is
the only Android-specific entry point for child processes, so I think
it's the most logical place to initialize JNI.

Bug 1343075 - 5. Support multiple remote GeckoEditableChild; r=esawin

Support remote GeckoEditableChild instances that are created in the
content processes and connect to the parent process GeckoEditableParent
through binders.

Support having multiple GeckoEditableChild instances in GeckoEditable by
keeping track of which child is currently focused, and only allow
calls to/from the focused child by using access tokens.

Bug 1343075 - 6. Add method to get GeckoEditableParent instance; r=esawin

Add IProcessManager.getEditableParent, which a content process can call
to get the GeckoEditableParent instance that corresponds to a given
content process tab, from the main process.

Bug 1343075 - 7. Support GeckoEditableSupport in content processes; r=esawin

Support creating and running GeckoEditableSupport attached to a
PuppetWidget in content processes.

Because we don't know PuppetWidget's lifetime as well as nsWindow's,
when attached to PuppetWidget, we need to attach/detach our native
object on focus/blur, respectively.

Bug 1343075 - 8. Connect GeckoEditableSupport on PuppetWidget creation; r=esawin

Listen to the "tab-child-created" notification and attach our content
process GeckoEditableSupport to the new PuppetWidget.

Bug 1343075 - 9. Update auto-generated bindings; r=me
2017-03-07 22:34:39 -05:00
Jim Chen c7d526d4ee Bug 1339685 - Split GeckoEditable into parent and child classes; r=nalexander r=esawin r=snorp
Bug 1339685 - 1. Support compiling GeckoView aidl from multiple packages; r=nalexander

Specify a list of AIDL files for GeckoView so we can include AIDLs from
multiple packages, and not just those from the org.mozilla.gecko.process
package.

Bug 1339685 - 2. Add AIDLs for GeckoEditable; r=esawin

Add IGeckoEditableParent.aidl and IGeckoEditableChild.aidl for two-way
communication between the parent, which lives in the main process, and
the child, which lives in the main process or a child content process.

Bug 1339685 - 3. Refactor some GeckoEditable code; r=esawin

Auto-generate native constants for the constants in GeckoEditableClient,
instead of keeping a separate set of constants in native code.

Bug 1339685 - 4. Add GeckoEditableChild; r=esawin

Add the GeckoEditableChild class, which is currently only used in the
main process as the interface between the native nsWindow and
GeckoEditable. Eventually, it will be expanded to child content
processes as the interface between the native PuppetWidget and
main process GeckoEditable.

Bug 1339685 - 5. Use GeckoEditableChild from GeckoEditable; r=esawin

Make calls to GeckoEditableChild from GeckoEditable, and remove code
that exists in GeckoEditableChild from GeckoEditable.

Bug 1339685 - 6. Add GetNativeObject member to proxied native calls; r=snorp

Add a convenience function for getting the C++ object that is the target
of the native call.

Bug 1339685 - 7. Use GeckoEditableChild from native code; r=esawin

Make nsWindow and GeckoEditableSupport use GeckoEditableChild for
communication. nsWindow still keeps a reference to GeckoEditable for
switching views.

Bug 1339685 - 8. Updated generated bindings; r=me
2017-03-02 13:47:14 -05: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
John Lin d6335c2417 Bug 1075025 - part 1: receive vsync events through Choreographer. r=snorp
MozReview-Commit-ID: 69MefRKMWmh
2016-12-22 12:55:19 +08:00
James Willcox 7a2672f6a2 Bug 1314974 - Make GeckoView on Android work again r=jchen
--HG--
rename : mobile/android/base/java/org/mozilla/gecko/ScreenManagerHelper.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/ScreenManagerHelper.java
2016-11-14 14:55:29 -06: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
Jim Chen d79992b10f Bug 1307816 - 7. Flush text before sending focus event; r=esawin
We used to flush the Java side text upon receiving the acknowledge-focus
event, at which point the Java side is waiting on the Gecko side.
Because of the async IME refactoring, we can no longer wait on the Java
side, so we have to flush the text early, before sending the first focus
notification. Also, the acknowledge-focus event is no longer needed as a
result.

Our call to InputMethodManager to restart input also has to changed due
to the change in calling sequence between notifyIME and
notifyIMEContext.
2016-10-25 12:28:53 -04: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 fc338f45cf Bug 1303806 - 2. Update auto-generated bindings; r=me 2016-09-20 17:42:08 -04:00
Jim Chen 396eaa38e0 Bug 1291375 - 4. Update auto-generated bindings; r=me 2016-09-16 15:13:48 -04:00
Jim Chen cb7a422ffa Bug 1296744 - Update auto-generated bindings; r=me 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 adde79eb82 Bug 1294481 - Update auto-generated bindings; r=me 2016-08-23 18:52:30 -04:00
Jim Chen 7b67a45c6a Bug 1294479 - Update auto-generated bindings; r=me 2016-08-19 17:17:25 -04:00
Jim Chen 767998ce0c Bug 1294077 - Move reportJavaCrash out of AndroidJNI.cpp; r=snorp
Move reportJavaCrash out of AndroidJNI.cpp and re-implement it as a
native method in GeckoAppShellSupport.
2016-08-18 18:04:11 -04:00
Jim Chen f78bb41597 Bug 1294482 - Move onFullScreenPluginHidden out of AndroidJNI.cpp; r=snorp
Move onFullScreenPluginHidden out of AndroidJNI.cpp and into a new-style
native method in nsAppShell.cpp.
2016-08-18 18:04:11 -04:00
Jim Chen 16c96d39f8 Bug 1294071 - Move dispatchMemoryPressure out of GeckoAppShell; r=snorp
Move dispatchMemoryPressure out of GeckoAppShell and AndroidJNI.cpp
2016-08-18 18:04:11 -04:00
Jim Chen ef76c29f7a Bug 1294069 - Move notifyBatteryChange out of GeckoAppShell; r=snorp
Move notifyBatteryChange out of GeckoAppShell and AndroidJNI.cpp.
2016-08-18 18:04:11 -04:00
Jim Chen f76d27da14 Bug 1294710 - Move UI thread methods out of GeckoAppShell; r=snorp
Move methods to run callbacks on UI thread out of GeckoAppShell and into
GeckoThread.
2016-08-18 18:04:11 -04:00