Now that -Wc++2a-compat is no longer enabled (bug 1887580), we don't need these pragmas disabling -Wc++2a-compat warnings about u8"" string literals' type changing from const char[] in C++17 to const char8_t[] in C++20.
Depends on D206742
Differential Revision: https://phabricator.services.mozilla.com/D206743
When compiled with -std=c++17, `u8""` string literals have type `const char[]`. When compiled with -std=c++20, `u8""` strings have type `const char8_t[]`. `JS_ReportErrorUTF8()` has no override for `char8_t` strings, so `u8"Invalid event data property %s"` at https://searchfox.org/mozilla-central/rev/5eedf36dc46f1683af7478c7adaf308ceb42911b/widget/android/EventDispatcher.cpp#132 fails to compile. In this case, there's no reason for `"Invalid event data property %s"` to be a `u8` string because it contains no non-ASCII characters that would be encoded incorrectly. Plus, clang's default character encoding for .cpp files is UTF-8, so `u8` is redundant here.
widget/android/EventDispatcher.cpp:125:7: error: no matching function for call to 'JS_ReportErrorUTF8'
125 | JS_ReportErrorUTF8(
| ^~~~~~~~~~~~~~~~~~
obj-aarch64-unknown-linux-android/dist/include/js/ErrorReport.h:465:27: note: candidate function not viable: no known conversion from 'const char8_t[31]' to 'const char *' for 2nd argument
465 | extern JS_PUBLIC_API void JS_ReportErrorUTF8(JSContext* cx, const char* format,
| ^ ~~~~~~~~~~~~~~~~~~
Differential Revision: https://phabricator.services.mozilla.com/D200553
When the session storage prefs are enabled, GeckoSession updateSessionState will provide the bundle of information, including zoom, scroll, and form data, to the delegate. Currently works for Fission and on Fenix.
Differential Revision: https://phabricator.services.mozilla.com/D148215
When the session storage prefs are enabled, GeckoSession updateSessionState will provide the bundle of information, including zoom, scroll, and form data, to the delegate. Currently works for Fission and on Fenix.
Differential Revision: https://phabricator.services.mozilla.com/D148215
When the session storage prefs are enabled, GeckoSession updateSessionState will provide the bundle of information, including zoom, scroll, and form data, to the delegate. Currently works for Fission and on Fenix.
Differential Revision: https://phabricator.services.mozilla.com/D148215
When the session storage prefs are enabled, GeckoSession updateSessionState will provide the bundle of information, including zoom, scroll, and form data, to the delegate. Currently works for Fission and on Fenix.
Differential Revision: https://phabricator.services.mozilla.com/D148215
This reverts commit e542e8826b92f70dbabaf577d80a32273c684d1b.
In hindsight, this was a pretty bad change. It introduces a third place where
the EventDispatcher can be shutdown (JavaScript) and doesn't do a good job at
communicating this across all consumers.
I introduced this change in Bug 1567341 to fix some leaks in xpcshell tests at
xpcom shutdown, and it was never meant to affect a normal browser use (turns
out, it does).
I ran the tests again in try and they are still green when reverting this
change, I suspect that the actual failures I was seeing were due to a separate
leak that I fixed while developing the patches.
Differential Revision: https://phabricator.services.mozilla.com/D112637
If JavaScript string is UTF-16, we can return error when we cannot allocate
Java string. But if it is Latin-1, GeckoView crashes due to using infallible
version of StringParam.
So we should use fallible version of StringParam instead even if Latin-1.
Differential Revision: https://phabricator.services.mozilla.com/D112176
This patch adds a "named" EventDispatcher that can be accessed on both java and
javascript by calling
```
EventDispatcher.byName(...)
```
A named EventDispatcher will receive messages only from it's counterpart with
the same name and can be used to implement bidirectional communication like
WebExtension ports.
Differential Revision: https://phabricator.services.mozilla.com/D84260
This patch adds a "named" EventDispatcher that can be accessed on both java and
javascript by calling
```
EventDispatcher.byName(...)
```
A named EventDispatcher will receive messages only from it's counterpart with
the same name and can be used to implement bidirectional communication like
WebExtension ports.
Differential Revision: https://phabricator.services.mozilla.com/D84260
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.
find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
if [ -n "$interfaces" ]; then
if [[ "$interfaces" == *$'\n'* ]]; then
regexp="\("
for i in $interfaces; do regexp="$regexp$i\|"; done
regexp="${regexp%%\\\|}\)"
else
regexp="$interfaces"
fi
interface=$(basename "$path")
rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
if [ $hits -eq 0 ]; then
echo "Removing ${interface} from ${path2}"
grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
mv -f "$path2".tmp "$path2"
fi
done
fi
done
Differential Revision: https://phabricator.services.mozilla.com/D55444
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
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
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
Add a new interface, nsIAndroidEventFinalizer, that is called whenever a
callback object is finalized, i.e. there can be no more callbacks for a
particular dispatch. Add the finalizer as a new parameter to dispatch().
Existing callers that don't need a finalizer are not affected.
This functionality is required in order to unregister our message
manager listener in a child process, after dispatching an event with
callback from a child process.
MozReview-Commit-ID: 8n89c63UGNm
In an "attach > detach > attach" sequence, detach will post a call to
disposeNative, so the sequence looks like "attach > detach > attach >
disposeNative". In that case, disposeNative will cancel attach. This
patch makes us ignore disposeNative in that case, so the second attach
works as intended.
MozReview-Commit-ID: Kr55PZcsPg1