Commit Graph

121 Commits

Author SHA1 Message Date
Ehsan Akhgari
e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01: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
9eadd7710b Bug 1486596 - Hold a WeakRef to EventDispatcher from native code r=jchen 2018-10-03 13:02:46 -05:00
James Willcox
f0e249edac Bug 1486596 - Add WeakRef support to mozilla::jni r=jchen 2018-10-03 13:02:44 -05:00
Jim Chen
4e55f50285 Bug 1492308 - 2. Create new native handle before clearing old one; r=snorp
Create a new native handle first before deleting any old ones, so we can
be sure the new handle would not have the same value as the old handle,
which can confuse our code.

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

--HG--
extra : moz-landing-system : lando
2018-10-02 19:59:32 +00:00
Jan Henning
07d61a0e0f Bug 1485833 - Use a backwards compatible way of handling NDK changes in jni.h. r=jchen
When building with the NDK clang, which is the easiest way of building locally,
NDK r17 doesn't work for ARM builds because of a broken clang, and while the
NDK r18-beta fixes that problem, for some people it causes a different set of
issues.
Since NDK r15c doesn't have the ndk-version.h headers, switch to a different
way of bridging the differences that allows people to continue building with
r15c locally.

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

--HG--
extra : moz-landing-system : lando
2018-08-28 20:05:36 +00:00
Jan Henning
e04236b5f9 Bug 1484823 - Fix Android build errors with NDK r18-beta1. r=snorp
Getting a working local build with the system clang might be tricky, while
building with NDK r17 clang is broken (bug 1484723).
NDK r18-beta1 fixes this, but also made all jvalue* method parameters in jni.h
const,so in order to support building with it we need to adjust our relevant
function types, too.

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

--HG--
extra : moz-landing-system : lando
2018-08-22 16:01:33 +00:00
Gabriele Svelto
15adf94f4d Bug 1348273 - Convert crash annotations into a machine-readable list of constants; r=ted.mielczarek,njn,dholbert,mak,cpearce,mcmanus,froydnj,Dexter,jrmuizel,jchen,jimm,bz,surkov
This introduces the machinery needed to generate crash annotations from a YAML
file. The relevant C++ functions are updated to take a typed enum. JavaScript
calls are unaffected but they will throw if the string argument does not
correspond to one of the known entries in the C++ enum. The existing whitelists
and blacklists of annotations are also generated from the YAML file and all
duplicate code related to them has been consolidated. Once written out to the
.extra file the annotations are converted in string form and are no different
than the existing ones.

All existing annotations have been included in the list (and some obsolete ones
have been removed) and all call sites have been updated including tests where
appropriate.

--HG--
extra : source : 4f6c43f2830701ec5552e08e3f1b06fe6d045860
2018-07-05 15:42:11 +02:00
Doug Thayer
10ff9c706f Bug 1448040 - Remove HangMonitor/ChromeHangs r=Nika
Fairly straightforward, just a blanket removal. Haven't heard
anything on dev-platform or fx-data-dev regarding this removal,
so I think it's likely safe to remove on Nightly, and we can
revert if anyone makes a fuss.

As part of removing the HangMonitor, I renamed a few things and
reorganized the namespaces to not depend on a HangMonitor
namespace. Hopefully this doesn't produce too much noise in the
diff, it just seemed appropriate to move everything around
rather than keep dangling vestiges of the old system.

MozReview-Commit-ID: 8C8NFnOP5GU

--HG--
extra : rebase_source : dd000a05bfc2da40c586644d33ca4508fa5330f6
2018-04-29 18:21:20 -07:00
Emilio Cobos Álvarez
1e9c395548 Bug 1466168: Remove mozilla::Forward in favor of std::forward. r=froydnj
Same approach as the other bug, mostly replacing automatically by removing
'using mozilla::Forward;' and then:

  s/mozilla::Forward/std::forward/
  s/Forward</std::forward</

The only file that required manual fixup was TestTreeTraversal.cpp, which had
a class called TestNodeForward with template parameters :)

MozReview-Commit-ID: A88qFG5AccP
2018-06-02 09:33:26 +02:00
Emilio Cobos Álvarez
fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Tom Bannister
988d18881f Bug 1434710 - Replaced all instances of mozilla::IndexSequence, mozilla::MakeIndexSequence and mozilla::IndexSequenceFor with std::index_sequence, std::make_index_sequence and std::index_sequence_for and removed mfbt/IndexSequence.h. r=botond
MozReview-Commit-ID: 1Ema7TUNr5v

--HG--
extra : rebase_source : e5bb164dbe19993214e8c16f92b0a1f5d2ff3fa1
2018-04-09 21:12:13 +10: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
Gabriele Svelto
cbb30621ec Bug 1402519 - Remove MOZ_CRASHREPORTER directives from widget; r=froydnj
--HG--
extra : rebase_source : 4472a8d6ce5edf1b5a4665d522a1816020308a43
2017-11-23 10:59:04 +01:00
shindli
fb855aa7ba Backed out 16 changesets (bug 1402519) for conflicts during merge r=backout on a CLOSED TREE
Backed out changeset 07fcf163241a (bug 1402519)
Backed out changeset c6d2ad45d8e2 (bug 1402519)
Backed out changeset 8a3caca61294 (bug 1402519)
Backed out changeset 01425eae2c48 (bug 1402519)
Backed out changeset cf298d3815de (bug 1402519)
Backed out changeset e1964f4389cd (bug 1402519)
Backed out changeset f405337f3569 (bug 1402519)
Backed out changeset a76356fd3359 (bug 1402519)
Backed out changeset d3bb350d1c34 (bug 1402519)
Backed out changeset 9d3bfd9f932c (bug 1402519)
Backed out changeset e3dd6e5b073f (bug 1402519)
Backed out changeset e801b0c00134 (bug 1402519)
Backed out changeset 8a4139fa5dca (bug 1402519)
Backed out changeset 8d01c14ac1ca (bug 1402519)
Backed out changeset 24e0dcd01898 (bug 1402519)
Backed out changeset f8fdf450613f (bug 1402519)
2017-11-23 00:11:44 +02:00
Gabriele Svelto
c60ce072a7 Bug 1402519 - Remove MOZ_CRASHREPORTER directives from widget; r=froydnj
This does not remove the directives in widget/ContentCache.cpp as those crash
annotations should be temporary and will be removed once bug 1405832 is fixed.

MozReview-Commit-ID: F0STyYDx8F4

--HG--
extra : rebase_source : 737d3e500e1dd066730660fede52226e832305e6
2017-10-10 16:04:47 +02:00
Jim Chen
ec08814aaa Bug 1406168 - 2. Remove AndroidJNIWrapper; r=snorp
Remove AndroidJNIWrapper. It was primarily used by JNI.jsm and WebRTC.
Usages in WebRTC are replaced with equivalent uses of JNI templates.

MozReview-Commit-ID: DPSeMOtH2wF
2017-11-01 14:48:48 -04:00
Nathan Froyd
be14985761 Bug 1411692 - move forward declaration to Refs.h; r=darchons
clang complains if we don't have a declaration for Context::sClassRef;
Accessors.h had one, but it's not in the right place to prevent clang
from complaining.  Moving it closer to where Context itself is declared
seems like a reasonable thing to do.
2017-10-25 17:37:15 -04:00
Jim Chen
1e2e862aea Bug 1401737 - 2. Add GeckoAppShell.appendAppNotesToCrashReport; r=snorp
Add a way to append app notes to the crash report from Java, so we can
associate additional crash data with the crash.

MozReview-Commit-ID: 6I6pGOWb1sZ
2017-10-05 14:59:32 -04:00
Nathan Froyd
5519cd83cc Bug 1396850 - explicitly declare static members of templates prior to use; r=darchons
Doing this avoids -Wundefined-var-template warnings with clang.  This
warning is mostly harmless (clang is trying to tell you a linker error
might be awaiting you later), but being careful with this might make
using C++ modules easier somewhere down the line.
2017-09-06 13:24:04 -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
Jim Chen
b9eff08b91 Bug 1382335 - 2. Revert workaround from bug 1372777; r=esawin
Introduce the crash again to get more crash reports for analysis.

MozReview-Commit-ID: DYq95o5RpzB
2017-07-31 12:30:13 -04:00
Jim Chen
54718c4c49 Bug 1382335 - 1. Record the type of null native pointers; r=esawin
Right now we throw NullPointerException with the message "Null native
pointer", but we can save the type of the native pointer in the message
to make it easier to categorize and analyze crashes. This patch uses the
__func__ feature to get the name of a particular template parameter
type.

MozReview-Commit-ID: GNWzIy91OD6
2017-07-31 12:30:13 -04:00
Jim Chen
454e868137 Bug 1382861 - 1. Replace jni::AbstractCall with nsIRunnable; r=esawin
The native binding code used `jni::AbstractCall` as the interface
between `ProxyNativeCall` and `DispatchToGeckoPriorityQueue`. However,
we already make use of `nsIRunnable` for dispatching to the XPCOM queue,
so we should just use `nsIRunnable` for the priority queue as well.

MozReview-Commit-ID: KmuNMZZkXX3
2017-07-25 17:25:58 -04:00
Bill McCloskey
f115503a0b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Carsten "Tomcat" Book
8a1350b5a6 Backed out changeset 4f6302a98ae4 (bug 1372405)
--HG--
extra : rebase_source : 41632f3158e88e692809731394a683d065a73dfb
2017-06-21 13:59:26 +02:00
Bill McCloskey
6b3e84ed5f Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Randall Barker
b31215e1b7 Bug 1372777 - Check that the native pointer has not been detached from the java object when dispatched to different thread r=esawin
MozReview-Commit-ID: DyeZDaHeWdL
2017-06-20 10:50:38 -07:00
Carsten "Tomcat" Book
ea1b86680c Backed out changeset 9846de3bd954 (bug 1372405)
--HG--
extra : rebase_source : 5d4a48e8ec394c329994689d938d2a6e9b2752b0
2017-06-20 08:27:02 +02:00
Bill McCloskey
4592152411 Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00
James Willcox
0199445b47 Bug 1322650 - Add jni::GetAPIVersion() to get Android API version r=jchen
MozReview-Commit-ID: EfPMfS7RmcH
2017-05-15 09:37:55 -05:00
James Willcox
2d93d7d835 Bug 1322650 - Adjust Android Flash support to API changes r=jchen
MozReview-Commit-ID: CmMINaGcTER
2017-05-15 09:37:52 -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
5f0f52f2b1 Bug 1322650 - Add jni::GetAPIVersion() to get Android API version r=jchen
MozReview-Commit-ID: EfPMfS7RmcH
2017-05-11 15:42:45 -05:00
James Willcox
8069ecfcd6 Bug 1322650 - Adjust Android Flash support to API changes r=jchen
MozReview-Commit-ID: CmMINaGcTER
2017-05-11 15:42:44 -05:00
Sebastian Hengst
f3bfd1e1da Backed out changeset d6516a10c808 (bug 1322650) 2017-05-05 18:53:40 +02:00
Sebastian Hengst
a73c158876 Backed out changeset adf185af7963 (bug 1322650) 2017-05-05 18:53:31 +02:00
James Willcox
2fec319cd5 Bug 1322650 - Add jni::GetAPIVersion() to get Android API version r=jchen
MozReview-Commit-ID: EfPMfS7RmcH
2017-05-05 08:56:39 -05:00
James Willcox
9392b1227a Bug 1322650 - Adjust Android Flash support to API changes r=jchen
MozReview-Commit-ID: CmMINaGcTER
2017-05-05 08:56:36 -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
Joel Maher
99137683e9 Bug 1355089 - add BUG_COMPONENT to widget/* files. r=mstange,jimm
MozReview-Commit-ID: 49Ug2HTqHnf
2017-04-14 05:54:36 -04: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
David Major
fa1854f65a Bug 1344629 - Part 7.5: Add constructors for jni::StringParam that accept literal strings. r=dbaron
MozReview-Commit-ID: 8vSf7TGwPmD

--HG--
extra : rebase_source : d212421502542b0efa22e3b22ce94a69f781e012
2017-03-14 15:26:36 +13:00
Iris Hsiao
5cece96e1c Backed out 12 changesets (bug 1344629) for stylo build bustage
Backed out changeset cf4273d3ac30 (bug 1344629)
Backed out changeset a96390e044e0 (bug 1344629)
Backed out changeset d9b330f9bc24 (bug 1344629)
Backed out changeset 2b460fe020af (bug 1344629)
Backed out changeset 0ada91b0452e (bug 1344629)
Backed out changeset 083304fcd6bd (bug 1344629)
Backed out changeset 53d7d1ce2c97 (bug 1344629)
Backed out changeset 55eee7078ae4 (bug 1344629)
Backed out changeset 7d3c06b3eca9 (bug 1344629)
Backed out changeset e5df14c3db61 (bug 1344629)
Backed out changeset 636095ff2815 (bug 1344629)
Backed out changeset 0be052ad24c1 (bug 1344629)
2017-03-14 11:52:24 +08:00
David Major
04420e097d Bug 1344629 - Part 7.5: Add constructors for jni::StringParam that accept literal strings. r=dbaron
MozReview-Commit-ID: 8vSf7TGwPmD

--HG--
extra : rebase_source : d212421502542b0efa22e3b22ce94a69f781e012
2017-03-14 15:26:36 +13: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
3a24d6364c Bug 1343027 - 2. Add jni::Ref::Lock function; r=snorp
Add a Lock function to jni::Ref to lock the referenced object akin to
the synchronized keyword in Java. It returns an AutoLock RAII object
that automatically unlocks the object when going out of scope.
2017-03-06 15:32:36 -05:00
Jim Chen
0d3d8e6fd1 Bug 1343027 - 1. Add jni::Ref::Cast function; r=snorp
Add a Cast function to jni::Ref to cast a reference to a different type
(e.g. if ref is a jni::Object::Ref referring to a String instance, use |
ref.Cast<jni::String>()->Length() | to get the length of the string).

In MOZ_CHECK_JNI builds, Cast() checks that an instance of the source
class can indeed be cast to the target class.
2017-03-06 15:32:36 -05:00