[VD][Service] Add getApplicationId() for extensions 79/237379/3
authorDongHyun Song <dh81.song@samsung.com>
Tue, 30 Jun 2020 01:24:03 +0000 (10:24 +0900)
committerDongHyun Song <dh81.song@samsung.com>
Wed, 1 Jul 2020 01:06:28 +0000 (01:06 +0000)
webapis.getApplicationId() will be used to get the current application
ID by eden preview webapis.
Previously ContentServiceManager is getting the sender application ID
from messsage port parameter, but in case of global wrt-service, it is
org.tizen.chromium-efl.wrt-service, not expected application ID.
So that eden preview webapi can get the intended application ID, this
API will be used in eden preview side.

Change-Id: Ibfeddefe384da92b7ecbeb3d72f14bf5c26c1eef
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
wrt_app/common/service_manager.js

index a3d1952..a699a6f 100644 (file)
@@ -28,8 +28,10 @@ function startService(id, filename) {
     sandbox[id].module.exports.onStop = () => {
       callFunctionInContext('module.exports.onExit', sandbox[id]);
     };
-    if (wrt.tv)
+    if (wrt.tv) {
       sandbox[id].webapis = webapis;
+      sandbox[id].webapis.getApplicationId = () => { return id; }
+    }
 
     if (is_global_service) {
       const permissions = wrt.getPrivileges(id);