From: liwei Date: Thu, 4 Jul 2019 01:08:57 +0000 (+0800) Subject: [VD] Flush Local Storage and Cookie when app exit X-Git-Tag: submit/tizen/20190814.020427~10^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b42b763369d1c303dd678da777852da0866d65b;p=platform%2Fframework%2Fweb%2Fwrtjs.git [VD] Flush Local Storage and Cookie when app exit 1. In current logic, data will be set to SQLite database every 30s, if app exit immediately after it's launched, the data will not be set to SQLite database, so we should flush SQLite database commit all pending operations before app terminate, it's same with local storage database. Bcz app can be killed by LMF, so suspend is proper timing. For eg. AIO(3201606009648)'s account is stored in Cookie, if app is exited immedatley, the account will not stored to Cookie, then when AIO launch again, account can not be signed atuomatically. 2. In WRTJS, EWebView class will not be used anymore, so this logic should be moved to WRTJS side. Refrence Patch: https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/203302/ Native Patch: https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/208872/ Change-Id: I63a21ef88d59876b2e43348f0e004ce3c8011c81 Signed-off-by: liwei --- diff --git a/wrt_app/src/web_application.js b/wrt_app/src/web_application.js index 77e9f631..90aaaf6c 100755 --- a/wrt_app/src/web_application.js +++ b/wrt_app/src/web_application.js @@ -251,6 +251,10 @@ class WebApplication { return; } let windows = WRTWindow.getAllWindows(); + if (this.isTVProfile) { + wrt.flushCookie(); + this.windowList.forEach((window) => window.webContents.session.flushStorageData()); + } if (!this.multitaskingSupport) { // FIXME : terminate app after visibilitychange event handling setTimeout(() => {