[VD] Flush Local Storage and Cookie when app exit 47/209247/4
authorliwei <wei90727.li@samsung.com>
Thu, 4 Jul 2019 01:08:57 +0000 (09:08 +0800)
committerliwei <wei90727.li@samsung.com>
Thu, 4 Jul 2019 03:28:00 +0000 (11:28 +0800)
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 <wei90727.li@samsung.com>
wrt_app/src/web_application.js

index 77e9f63..90aaaf6 100755 (executable)
@@ -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(() => {