Like an earlier patch in the series, this uses `Split()` to return dependent
substrings into the blocklist string, rather than copying each individual
entry out for parsing. We also, in passing, eliminate a copy from the
converted UTF8 string into an entirely separate string.
Depends on D89169
Differential Revision: https://phabricator.services.mozilla.com/D89170
Instead of splitting the entire entry into an `nsTArray`, we can use
`nsTSubstring::Split` to provide dependent strings into the entry. We copy
the actual keys and values later, so this should be perfectly safe.
Depends on D89168
Differential Revision: https://phabricator.services.mozilla.com/D89169
There's a lot of string splitting here, which needlessly copies, and then
there's a lot of copies out of the split arrays. This patch at least
addresses the latter by using references where possible.
Differential Revision: https://phabricator.services.mozilla.com/D89168
This patch was generated by running:
```
perl -p -i \
-e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF8toUTF16\((.*)\);/\1CopyUTF8toUTF16(\3, \2);/;' \
-e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF16toUTF8\((.*)\);/\1CopyUTF16toUTF8(\3, \2);/;' \
$FILE
```
against every .cpp and .h in mozilla-central, and then fixing up the
inevitable errors that happen as a result of matching C++ expressions with
regexes. The errors fell into three categories:
1. Calling the convert functions with `std::string::c_str()`; these were
changed to simply pass the string instead, relying on implicit conversion
to `mozilla::Span`.
2. Calling the convert functions with raw pointers, which is not permitted
with the copy functions; these were changed to invoke `MakeStringSpan` first.
3. Other miscellaneous errors resulting from over-eager regexes and/or the
replacement not being type-aware. These changes were reverted.
Differential Revision: https://phabricator.services.mozilla.com/D88903
Use g_dbus_method_invocation_return_value() to return a reply to DBus
clients that call service methods. Sending a reply is required by the
DBus specification and failing to do so may cause subtle bugs in
clients.
Differential Revision: https://phabricator.services.mozilla.com/D88737
This patch is similar to part 4 but for MediaSessionSupport.
Conversions over to `NativeWeakPtr` are pretty straight forward thanks to the
type system. Basically we take a `NativeWeakPtr`, call `Access()` on it, and
if the accessor is truthy, then we call whatever methods we need to call.
Creation of new pointers is done using `NativeWeakPtrHolder::Attach()` and
detaching of strong references is done by `NativeWeakPtr::Detach()`.
Differential Revision: https://phabricator.services.mozilla.com/D88088
This patch is similar to part 4 but for `GeckoEditableSupport`.
Conversions over to `NativeWeakPtr` are pretty straight forward thanks to the
type system. Basically we take a `NativeWeakPtr`, call `Access()` on it, and
if the accessor is truthy, then we call whatever methods we need to call.
Creation of new pointers is done using `NativeWeakPtrHolder::Attach()` and
detaching of strong references is done by `NativeWeakPtr::Detach()`.
Differential Revision: https://phabricator.services.mozilla.com/D87364
These conversions are pretty straight forward thanks to the type system.
Basically we take a `NativeWeakPtr`, call `Access()` on it, and if the
accessor is truthy, then we call whatever methods we need to call.
Creation of new pointers is done using `NativeWeakPtrHolder::Attach()` and
detaching of strong references is done by `NativeWeakPtr::Detach()`.
Differential Revision: https://phabricator.services.mozilla.com/D87363
* Having `AndroidView` and `GeckoViewSupport` as nested classes inside of
`nsWindow` make it impossible to forward declare them. We move those classes
into their own headers. We also move `WindowEvent` into its own header.
* We remove the old `NativePtr` and `WindowPtr` implementations from `nsWindow`
and convert the class definitions in this patch to use the new `NativeWeakPtr`.
* `GeckoViewSupport` had a unique quirk where it was owned by `nsWindow`
instead of its Java counterpart. To make `GeckoViewSupport`'s ownership work
like the other classes that use `NativeWeakPtr` (and to substantially simplify
the implementation of `NativeWeakPtr` itself), I have reversed that: now
`nsWindow` holds a `NativeWeakPtr` to `GeckoViewSupport`, while
`GeckoViewSupport` is owned by its Java counterpart and holds a strong ref to
the `nsWindow`.
* `GeckoViewSupport` no longer inherits from `SupportsWeakPtr`, since using it
with `NativeWeakPtr` provides stronger and safer guarantees.
Differential Revision: https://phabricator.services.mozilla.com/D87362
* We rename the existing `NativePtr` struct to `NativePtrTraits`, as that is
more descriptive of what that code actually does;
* We introduce `NativeWeakPtr` as a smart pointer type that holds a pointer
to an object and allows its access in a thread-safe way. See comments.
* We replace some explicit uses of template types with type deduction via
`auto` and `decltype(auto)`. This allows for more use of forward declarations.
Differential Revision: https://phabricator.services.mozilla.com/D87361
This pauses composition when a window becomes fully occluded.
This is particularly important for platforms like macOS, where minimized /
hidden windows historically would remain compositing, potentially on every vsync
if the hidden window contained animations. This should lead to a nice power
savings by skipping this unnecessary work.
This change affects both the WebRender and legacy compositor paths.
As bug 1580117 is believed to be a macOS specific issue, this is currently
implemented for macOS only, but could in the future be generalized to other
platforms as well (likely using size mode changes since other platforms do not
notify on occlusion change).
Differential Revision: https://phabricator.services.mozilla.com/D85954
- Restore active texture when dmabuf texture is created at DMABufSurfaceRGBA::CreateTexture()/DMABufSurfaceYUV::CreateTexture.
- Provide more logging for DMABufSurfaceRGBA surfaces.
- Implement DMABufSurfaceRGBA::DumpToFile() to save dmabuf surface content to png file.
Differential Revision: https://phabricator.services.mozilla.com/D88382
This patch ensures that our fallback paper list (used for print saving
as PDF) will use PWG standardized names for the paper sizes for GTK
print settings.
Differential Revision: https://phabricator.services.mozilla.com/D88736
There are three cases,
- Move to inner OOP frame.
- Move to outer OOP frame.
- Move to an OOP frame that is in different sub-tree.
We could use common BrowserParent ancestor to determine which case is and
dispatch MouseExitFromWidget event with proper ExitFrom type.
Depends on D84748
Differential Revision: https://phabricator.services.mozilla.com/D84761
eTopLevel is reused in content process to indicates that the mouse leaves
the puppet widget rendering area, now we add a separated type, ePuppet, for it.
Differential Revision: https://phabricator.services.mozilla.com/D84748
Print settings stores margin units in TWIPS, but the API expects inches.
This was causing an extra conversion from inches to TWIPS on values that
were already in TWIPS.
Differential Revision: https://phabricator.services.mozilla.com/D88674
Our data indicates a few users of x86 system hit failure to load urlmon.dll
for unknown reasons. Since we don't always require urlmon.dll,
we delay-load it, which causes a crash if loading urlmon.dll fails.
A proposed fix is to dynamically load urlmon.dll on x86.
Differential Revision: https://phabricator.services.mozilla.com/D88534
This patch is similar to part 4 but for MediaSessionSupport.
Conversions over to `NativeWeakPtr` are pretty straight forward thanks to the
type system. Basically we take a `NativeWeakPtr`, call `Access()` on it, and
if the accessor is truthy, then we call whatever methods we need to call.
Creation of new pointers is done using `NativeWeakPtrHolder::Attach()` and
detaching of strong references is done by `NativeWeakPtr::Detach()`.
Differential Revision: https://phabricator.services.mozilla.com/D88088
This patch is similar to part 4 but for `GeckoEditableSupport`.
Conversions over to `NativeWeakPtr` are pretty straight forward thanks to the
type system. Basically we take a `NativeWeakPtr`, call `Access()` on it, and
if the accessor is truthy, then we call whatever methods we need to call.
Creation of new pointers is done using `NativeWeakPtrHolder::Attach()` and
detaching of strong references is done by `NativeWeakPtr::Detach()`.
Differential Revision: https://phabricator.services.mozilla.com/D87364
These conversions are pretty straight forward thanks to the type system.
Basically we take a `NativeWeakPtr`, call `Access()` on it, and if the
accessor is truthy, then we call whatever methods we need to call.
Creation of new pointers is done using `NativeWeakPtrHolder::Attach()` and
detaching of strong references is done by `NativeWeakPtr::Detach()`.
Differential Revision: https://phabricator.services.mozilla.com/D87363
* Having `AndroidView` and `GeckoViewSupport` as nested classes inside of
`nsWindow` make it impossible to forward declare them. We move those classes
into their own headers. We also move `WindowEvent` into its own header.
* We remove the old `NativePtr` and `WindowPtr` implementations from `nsWindow`
and convert the class definitions in this patch to use the new `NativeWeakPtr`.
* `GeckoViewSupport` had a unique quirk where it was owned by `nsWindow`
instead of its Java counterpart. To make `GeckoViewSupport`'s ownership work
like the other classes that use `NativeWeakPtr` (and to substantially simplify
the implementation of `NativeWeakPtr` itself), I have reversed that: now
`nsWindow` holds a `NativeWeakPtr` to `GeckoViewSupport`, while
`GeckoViewSupport` is owned by its Java counterpart and holds a strong ref to
the `nsWindow`.
* `GeckoViewSupport` no longer inherits from `SupportsWeakPtr`, since using it
with `NativeWeakPtr` provides stronger and safer guarantees.
Differential Revision: https://phabricator.services.mozilla.com/D87362
* We rename the existing `NativePtr` struct to `NativePtrTraits`, as that is
more descriptive of what that code actually does;
* We introduce `NativeWeakPtr` as a smart pointer type that holds a pointer
to an object and allows its access in a thread-safe way. See comments.
* We replace some explicit uses of template types with type deduction via
`auto` and `decltype(auto)`. This allows for more use of forward declarations.
Differential Revision: https://phabricator.services.mozilla.com/D87361
There are three cases,
- Move to inner OOP frame.
- Move to outer OOP frame.
- Move to an OOP frame that is in different sub-tree.
We could use common BrowserParent ancestor to determine which case is and
dispatch MouseExitFromWidget event with proper ExitFrom type.
Differential Revision: https://phabricator.services.mozilla.com/D84761
eTopLevel is reused in content process to indicates that the mouse leaves
the puppet widget rendering area, now we add a separated type, ePuppet, for it.
Differential Revision: https://phabricator.services.mozilla.com/D84748