Add and rename APIs for RWI termination 11/215311/8
authorDongHyun Song <dh81.song@samsung.com>
Mon, 7 Oct 2019 04:04:44 +0000 (13:04 +0900)
committerSangYong Park <sy302.park@samsung.com>
Thu, 10 Oct 2019 04:25:33 +0000 (04:25 +0000)
1)
To stop binded debugging RWI port, call stopInspectorServer().

2)
To close all dialogs while finalize(), call cancelDialogs().
Sometimes there are crash problems if Javascript dialogs are remained

Related chromium-efl patch:
  https://review.tizen.org/gerrit/215309/

Change-Id: I5efee849616ff00ea7d9b8431ffd630d494602bb
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
wrt_app/src/runtime.js
wrt_app/src/web_application.js

index d6df801..b00e397 100755 (executable)
@@ -271,10 +271,10 @@ class Runtime {
         return (bundleDebug || this.inspectorEnabledByVconf);
     }
     launchInspector(appControl) {
-        var portnum = wrt.getDebuggingPort();
-        var data    = { "port" :  [ portnum.toString() ] };
+        var debugPort = wrt.startInspectorServer();
+        var data    = { "port" :  [ debugPort.toString() ] };
         if (this.webApplication)
-            this.webApplication.debugPort = portnum;
+            this.webApplication.debugPort = debugPort;
         appControl.reply(data);
     }
     configureRuntime(appControl) {
index abccbdd..085239e 100755 (executable)
@@ -281,7 +281,7 @@ class WebApplication {
             "network log from the initial loading.\r\nPlease click Record button " +
             "in Timeline panel in PC before click OK button,\r\nThen you can get " +
             "profile log from the initial loading."
-        wrt.modalDialog(this.mainWindow.webContents, message);
+        wrt.showDialog(this.mainWindow.webContents, message);
     }
     suspend(evtEmitter) {
         console.log('WebApplication : suspend');
@@ -330,6 +330,12 @@ class WebApplication {
     }
     finalize() {
         this.inspectorSrc = '';
+        wrt.cancelDialogs(this.mainWindow.webContents);
+        if (this.debugPort) {
+            console.log('stop inspector server');
+            this.debugPort = 0;
+            wrt.stopInspectorServer();
+        }
         this.windowList.forEach((window) => {
             window.removeAllListeners();
         });