[Service] Introduce worker isolation 85/242985/13
authorDongHyun Song <dh81.song@samsung.com>
Wed, 2 Sep 2020 08:16:19 +0000 (17:16 +0900)
committerDongHyun Song <dh81.song@samsung.com>
Tue, 8 Sep 2020 08:40:48 +0000 (08:40 +0000)
commit5f2026e23c25a9da850c1ec0c506eaa612ee7c8e
tree40362a7b13f765ad19c1c9b0b5e3d7ab84874408
parenta5bef9bb9dcb1b1d997a5098782cbee09e55eb10
[Service] Introduce worker isolation

node-vm, previous way to isolate service applications, has a big
problem of global scope sharing with Tizen webapis. Becuase tizen
webapi objects are registered on global scope, with DeviceAPIRouter
overrieded APIs are shared by each service application calling.
In addition, require() is also running on global scope, even though
apps are calling require() in their sandbox context, imported
modules are running global scope.

Thus, isolation of global scope is most important for global wrt-
service. Node worker is very proper way to isolate each service
application. With node worker, v8::Isolatee and v8::IsolateData
are created separately. Then, each service app is able to have
each independent global object.

Reference patch:
  https://review.tizen.org/230796/

Change-Id: Ic4008ed7a8331327eeb84facba55418e971e2271
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
wrt_app/common/service_manager.ts
wrt_app/common/service_runner.ts [new file with mode: 0644]
wrt_app/service/access_control_manager.ts
wrt_app/service/device_api_router.ts
wrt_app/service/main.ts