Open Bug 1945252 Opened 5 months ago Updated 3 months ago

[Gecko iOS] Land remaining changes from Cedar on mozilla-central

Categories

(GeckoView :: General, enhancement, P1)

All
Android
enhancement

Tracking

(firefox137 affected)

REOPENED
137 Branch
Tracking Status
firefox137 --- affected

People

(Reporter: nika, Assigned: nika)

Details

Attachments

(22 files, 2 obsolete files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
No description provided.

This is the backend used on Android, and we plan to use the same architecture
on iOS.

The page size on arm64 macOS and iOS is 16k, yet we try to create stacks with
sizes which are not a multiple of 16k in some situations. Unify these stack
size calculations, and ensure they are always a multiple of 16k.

On arm64 macOS, the posix threads implementation is detecting stack sizes which
are a multiple of 4k, and rounding them up to a multiple of 16k to improve
compatibility, but that is not done on iOS.

Depends on D236401

This is a hack to align the android and iOS logging code. It is replaced with
an improved logging backend in D203492, which can be landed after this patch
stack.

Depends on D236402

As a large chunk of the Gecko-side frontend will be shared between Android and
iOS, this changes a number of prefs to be checking for mobile rather than
Android, under the assumption that mobile code will largely want the same configurations.

Depends on D236403

In the future we'll want to hook up to the system clipboard on iOS, but for now
we can use the headless clipboard to shim out the functionality.

Depends on D236406

Like on android, GeckoView on android does not work like on desktop, so the
Firefox Desktop default command line handler should not be used.

Depends on D236407

This aims to improve the handling of some behaviours, such as nested event
loops, to make them more similar to the behaviour on macOS.

Depends on D236408

This is required to support basic rendering on iOS.

Depends on D236409

This makes some methods which would previously retunr an error instead return a
default (empty) value, avoiding crashes/failures in callers.

This is required to enable basic rendering on iOS.

Depends on D236410

Without this change, the level and availPercent values would be uninitialized
in the error case.

Depends on D236411

Currently this has a large amount of copied code from Android, and contains
some fairly gross code for translating JS objects from/into Objective-C/Swift
NSDictionary objects.

In the future it would be nice to unify this more with the Android
implementation, to share code and other logic, but that has been left out of
scope for now.

Depends on D236412

The global dispatcher in GeckoView is currrently accessed through the
Services.androidBridge object. This patch adds an instance of this object for
iOS.

This should be renamed (likely to geckoViewBridge) in a follow-up bug.

Depends on D236413

This shim matches the behaviour of nsUserIdleService on Android, which is also
minimal.

Depends on D236414

This is required to allow GeckoView modules to initialize during GeckoSession
startup, as it contains the initial configuration options.

Depends on D236415

This aligns the way that windows are created on iOS more with how they are
handled on Android, where there is no intial window created by Gecko startup,
and instead windows are created on-demand by the embedder to serve as content
for GeckoSessions.

Depends on D236416

This is required to use modern WebRender-based rendering on iOS, and aligns iOS
better with macOS when it comes to rendering.

Depends on D236417

This interfaces with the GeckoView internal API which has been added in
previous parts to expose a GeckoView-like interface to an example browser
application.

Currently this xcode project is not hooked into mozillabuild and needs to be
built & run separately. This should be changed in the future, with the
GeckoView framework extracted so that it can be used by other projects (e.g.
Firefox for iOS).

In addition, bundling of XUL is done using a bash script and rsync. While this
is functional for local testing, it should be improved with better iOS support
in the build system in the future.

Depends on D236418

iOS doesn't provide very granular sandbox controls, so this is the only
configuraiton we have. Like sandboxing on other platforms, this is performed
after start-up and can be controlled by the MOZ_DISABLE_CONTENT_SANDBOX
environment variable, and security.sandbox.content.level pref.

Depends on D236420

Native event processing on iOS currently only really works in the primary
process, and should not be used in other processes. This aligns the code more
with macOS.

Depends on D236421

Severity: -- → N/A
Priority: -- → P1
Attachment #9463221 - Attachment is obsolete: true
Attachment #9463220 - Attachment description: Bug 1945252 - Part 2: Avoid stack sizes which are not a multiple of 16k, r=glandium! → Bug 1945252 - Part 2: Avoid stack sizes which are not a multiple of the system page size, r=glandium!
Attachment #9463222 - Attachment description: Bug 1945252 - Part 4: Make some preferences in StaticPrefList.yaml mobile-specific instead of android-specific, r=glandium! → Bug 1945252 - Part 3: Make some preferences in StaticPrefList.yaml mobile-specific instead of android-specific, r=glandium!
Attachment #9463223 - Attachment description: Bug 1945252 - Part 5: Support looking up the temporary directory on iOS, r=glandium! → Bug 1945252 - Part 4: Support looking up the temporary directory on iOS, r=glandium!
Attachment #9463224 - Attachment description: Bug 1945252 - Part 6: Support macOS-style profile locking on iOS, r=glandium! → Bug 1945252 - Part 5: Support macOS-style profile locking on iOS, r=glandium!
Attachment #9463225 - Attachment description: Bug 1945252 - Part 7: Temporarily use a headless clipboard on iOS, r=glandium! → Bug 1945252 - Part 6: Temporarily use a headless clipboard on iOS, r=glandium!

This platform-independent xpcom component appears to be indepently registered
in each platform's widget components.conf, so we also need to register it here
for iOS.

Depends on D236407

Attachment #9463226 - Attachment description: Bug 1945252 - Part 7: Disable the DefaultClH on iOS, r=glandium! → Bug 1945252 - Part 8: Disable the DefaultClH on iOS, r=glandium!
Attachment #9463227 - Attachment description: Bug 1945252 - Part 8: Update UIKit event loop to align better with macOS, r=glandium! → Bug 1945252 - Part 9: Update UIKit event loop to align better with macOS, r=glandium!
Attachment #9463228 - Attachment description: Bug 1945252 - Part 9: Add a UIKit ScreenHelper implementation, r=mstange! → Bug 1945252 - Part 10: Add a UIKit ScreenHelper implementation, r=mstange!
Attachment #9463229 - Attachment description: Bug 1945252 - Part 10: Improve GfxInfo shimming on iOS, r=mstange! → Bug 1945252 - Part 11: Improve GfxInfo shimming on iOS, r=mstange!
Attachment #9463236 - Attachment description: Bug 1945252 - Part 11: Recover from sysctlbyname failure in nsAvailableMemoryWatcher, r=haik! → Bug 1945252 - Part 12: Recover from sysctlbyname failure in nsAvailableMemoryWatcher, r=haik!
Attachment #9463237 - Attachment description: Bug 1945252 - Part 12: Implement a basic EventDispatcher for iOS, r=owlish!,glandium! → Bug 1945252 - Part 13: Implement a basic EventDispatcher for iOS, r=owlish!,glandium!
Attachment #9463238 - Attachment description: Bug 1945252 - Part 13: Expose AndroidBridge on iOS, r=owlish!,glandium! → Bug 1945252 - Part 14: Expose AndroidBridge on iOS, r=owlish!,glandium!
Attachment #9463239 - Attachment description: Bug 1945252 - Part 14: Implement a nsUserIdleService for UIKit, r=glandium! → Bug 1945252 - Part 15: Implement a nsUserIdleService for UIKit, r=glandium!
Attachment #9463240 - Attachment description: Bug 1945252 - Part 15: Expose initData from nsIGeckoViewView on iOS, r=glandium! → Bug 1945252 - Part 16: Expose initData from nsIGeckoViewView on iOS, r=glandium!
Attachment #9463241 - Attachment description: Bug 1945252 - Part 16: Delegate initial window creation to the embedder on iOS, r=glandium! → Bug 1945252 - Part 17: Delegate initial window creation to the embedder on iOS, r=glandium!
Attachment #9463242 - Attachment description: Bug 1945252 - Part 17: Use CoreAnimation for rendering on iOS, r=mstange! → Bug 1945252 - Part 18: Use CoreAnimation for rendering on iOS, r=mstange!
Attachment #9463244 - Attachment description: Bug 1945252 - Part 18: Add an XCode project with an iOS testing browser, r=glandium! → Bug 1945252 - Part 19: Add an XCode project with an iOS testing browser, r=glandium!
Attachment #9463245 - Attachment description: Bug 1945252 - Part 19: Enable stricter sandboxing for the content process on iOS, r=#ipc-reviewers! → Bug 1945252 - Part 20: Enable stricter sandboxing for the content process on iOS, r=#ipc-reviewers!
Attachment #9463246 - Attachment description: Bug 1945252 - Part 20: Use non-native event processing in more utility processes on iOS, r=#ipc-reviewers! → Bug 1945252 - Part 21: Use non-native event processing in more utility processes on iOS, r=#ipc-reviewers!
Attachment #9463238 - Attachment description: Bug 1945252 - Part 14: Expose AndroidBridge on iOS, r=owlish!,glandium! → Bug 1945252 - Part 14: Expose geckoviewBridge on iOS, r=owlish!,glandium!
Pushed by nlayzell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b7bb79fc3287 Part 1: Use the GeckoView ExternalHelperAppService on iOS, r=glandium https://hg.mozilla.org/integration/autoland/rev/7a1747f9ccf7 Part 2: Avoid stack sizes which are not a multiple of the system page size, r=glandium https://hg.mozilla.org/integration/autoland/rev/f93ee14b5ac6 Part 3: Make some preferences in StaticPrefList.yaml mobile-specific instead of android-specific, r=glandium https://hg.mozilla.org/integration/autoland/rev/1def4e404b8e Part 4: Support looking up the temporary directory on iOS, r=glandium https://hg.mozilla.org/integration/autoland/rev/dbad55e50e02 Part 5: Support macOS-style profile locking on iOS, r=glandium,profiles-reviewers,mossop https://hg.mozilla.org/integration/autoland/rev/57f8d3989e6e Part 6: Temporarily use a headless clipboard on iOS, r=glandium https://hg.mozilla.org/integration/autoland/rev/94854a893950 Part 7: Register nsHtmlFormatConverter on iOS, r=glandium https://hg.mozilla.org/integration/autoland/rev/4560e84313ae Part 8: Disable the DefaultClH on iOS, r=glandium https://hg.mozilla.org/integration/autoland/rev/457c02bdb130 Part 9: Update UIKit event loop to align better with macOS, r=glandium https://hg.mozilla.org/integration/autoland/rev/ca7ee3d3ff1e Part 10: Add a UIKit ScreenHelper implementation, r=mstange https://hg.mozilla.org/integration/autoland/rev/dda5192538fa Part 11: Improve GfxInfo shimming on iOS, r=mstange https://hg.mozilla.org/integration/autoland/rev/c892f001d7f6 Part 12: Recover from sysctlbyname failure in nsAvailableMemoryWatcher, r=haik

Re-opening as I've only landed the first 12 parts.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attachment #9463237 - Attachment is obsolete: true
Attachment #9463238 - Attachment description: Bug 1945252 - Part 14: Expose geckoviewBridge on iOS, r=owlish!,glandium! → Bug 1945252 - Part 13: Expose geckoviewBridge on iOS, r=owlish!,glandium!
Attachment #9463239 - Attachment description: Bug 1945252 - Part 15: Implement a nsUserIdleService for UIKit, r=glandium! → Bug 1945252 - Part 14: Implement a nsUserIdleService for UIKit, r=glandium!
Attachment #9463240 - Attachment description: Bug 1945252 - Part 16: Expose initData from nsIGeckoViewView on iOS, r=glandium! → Bug 1945252 - Part 15: Expose initData from nsIGeckoViewView on iOS, r=glandium!

These methods were added previously in bug 1933373, but were not exposed
through GeckoViewSwiftSupport.

Depends on D236417

iOS has a similar situation to Android from D226135, and needs to reset small
alloc randomization for content processes after the allocator has already been
initialized.

Attachment #9463241 - Attachment description: Bug 1945252 - Part 17: Delegate initial window creation to the embedder on iOS, r=glandium! → Bug 1945252 - Part 16: Delegate initial window creation to the embedder on iOS, r=glandium!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: