Bug 1741610 - Start LoginDetectionService on Android. r=agi,dimi

Differential Revision: https://phabricator.services.mozilla.com/D131357
This commit is contained in:
Andreas Farre 2021-12-15 13:19:56 +00:00
Родитель 5baddd1ec2
Коммит 37827b10de
3 изменённых файлов: 23 добавлений и 0 удалений

Просмотреть файл

@ -12,5 +12,6 @@ Classes = [
'singleton': True,
'headers': ['/dom/ipc/LoginDetectionService.h'],
'constructor': 'mozilla::dom::LoginDetectionService::GetSingleton',
'processes': ProcessSelector.MAIN_PROCESS_ONLY,
},
]

Просмотреть файл

@ -21,6 +21,14 @@ XPCOMUtils.defineLazyModuleGetters(this, {
const { debug, warn } = GeckoViewUtils.initLogging("Startup");
var { DelayedInit } = ChromeUtils.import(
"resource://gre/modules/DelayedInit.jsm"
);
function InitLater(fn, object, name) {
return DelayedInit.schedule(fn, object, name, 15000 /* 15s max wait */);
}
const JSWINDOWACTORS = {
LoadURIDelegate: {
child: {
@ -56,6 +64,10 @@ class GeckoViewStartup {
switch (aTopic) {
case "app-startup": {
// Parent and content process.
EventDispatcher.instance.registerListener(this, [
"GeckoView:StorageDelegate:Attached",
]);
GeckoViewUtils.addLazyGetter(this, "GeckoViewPermission", {
service: "@mozilla.org/content-permission/prompt;1",
observers: [
@ -240,6 +252,15 @@ class GeckoViewStartup {
pls
);
break;
case "GeckoView:StorageDelegate:Attached":
InitLater(() => {
const loginDetection = Cc[
"@mozilla.org/login-detection-service;1"
].createInstance(Ci.nsILoginDetectionService);
loginDetection.init();
});
break;
}
}
}

Просмотреть файл

@ -1288,6 +1288,7 @@ public class Autocomplete {
public StorageProxy() {}
private void registerListener() {
EventDispatcher.getInstance().dispatch("GeckoView:StorageDelegate:Attached", null);
EventDispatcher.getInstance()
.registerUiThreadListener(
this,