From: DongHyun Song Date: Wed, 6 Oct 2021 06:25:04 +0000 (+0000) Subject: Revert "[Service] Remove initializeExtensionOnMain" X-Git-Tag: submit/tizen/20211006.160020^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8c4dbf280f29e6d8360780ff8ae6c8de1ff98a60;p=platform%2Fframework%2Fweb%2Fwrtjs.git Revert "[Service] Remove initializeExtensionOnMain" This reverts commit 5a7f3b5ebc8533f7545dc1b031a0458e4c317280. Smack problems are comming without this patch. "CreateTaskQueue" cannot solve the previous smack issue correctly. Change-Id: I1d71ca855bb30b6e71634d715c026ddd935d6573 --- diff --git a/wrt_app/service/service_manager.ts b/wrt_app/service/service_manager.ts index 9f8d3e5..8e0c5bb 100644 --- a/wrt_app/service/service_manager.ts +++ b/wrt_app/service/service_manager.ts @@ -1,5 +1,6 @@ import { Worker, isMainThread } from 'worker_threads'; import { wrt } from '../browser/wrt'; +import * as XWalkExtension from '../common/wrt_xwalk_extension'; interface WorkerMap { [id: string]: any; @@ -45,8 +46,19 @@ function terminateWorker(id: string, delay: number) { workers[id].postMessage({ type: 'stop', delay }); } +let initializeExtensionOnMain = () => { + initializeExtensionOnMain = () => {}; + XWalkExtension.initialize(); + // This is workaround solution to make webapis's singleton worker, which has + // same smack label with pid's. + // It must be handled ahead of dropThreadPrivilege() + // Otherwise, smack violation might hanppen from 'libdbuspolicy'. + global.tizen.systeminfo.getPropertyValue("CPU", () => { }, () => { }); +} + export function startService(id: string, filename: string) { console.debug(`startService - ${id}`); + initializeExtensionOnMain(); if (global['serviceType'] === 'STANDALONE') { let ids = id.split(':'); let serviceId = ids[0];