Open Bug 1513404 Opened 5 years ago Updated 1 year ago

Check if GeckoRuntime is created on a service process

Categories

(GeckoView :: General, enhancement, P3)

enhancement

Tracking

(firefox66 affected)

Tracking Status
firefox66 --- affected

People

(Reporter: agi, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Creating two GeckoRuntime on different process yields a very confusing behavior where one GeckoRuntime will kill the other and the embedder would have no way of knowing what is going on without a lot of debugging, e.g. see [0].

We should explicitly check which process is trying to call `GeckoRuntime#create` and fail if it is not what we expect.

[0] https://github.com/mozilla-mobile/reference-browser/issues/324
As :snorp mentioned on slack we need an API to let the embedder know whether it can create a GeckoRuntime or not.

I'm not sure how helpful it would be to have a `GeckoRuntime#isOwnedProcess` API though, in the end we don't really care whether the process is owned by GeckoView or by the app, if the app tries to create two `GeckoRuntime`s we have a problem anyway.

I can see two things we could do:

- Add an opaque `GeckoRuntime#canCreate` API which returns true if we're on the app process. In the future this API may return true if the GeckoRuntime has not been created yet (e.g. for allowing embedders to create a runtime on a service)

- Keep it simple and add a `GeckoRuntime#isAppProcess` that just checks whether the current process is the main app process by doing `processName.contains(':')`

I would go with the latter but we may have plans for the former.
Agi says P2 because this doesn't fix a user-facing bug but it could avoid a lot of developer headaches when debugging.
Priority: -- → P2
Product: Firefox for Android → GeckoView

raising priority, Fenix hit this and many other people will hit this problem.

Priority: P2 → P1

I'm editing a bunch of GeckoView bugs. If you'd like to filter all this bugmail, search and destroy emails containing this UUID:

e88a5094-0fc0-4b7c-b7c5-aef00a11dbc9

Priority: P1 → P2
Rank: 20
Priority: P2 → P3
Assignee: agi → nobody
Severity: normal → S3
Rank: 20 → 333

Tasks and enhancements should have severity N/A.

Severity: S3 → N/A
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: