From: DongHyun Song Date: Thu, 30 Sep 2021 01:30:24 +0000 (+0900) Subject: Move FlushData() after setEnable() X-Git-Tag: submit/tizen/20210930.160018^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=592d9604bbca422c4db7accf7de11a8202d702cc;p=platform%2Fframework%2Fweb%2Fwrtjs.git Move FlushData() after setEnable() With low-end product, FlushData() looks to take too much time to flush StoragePartition. Then renderer can be not stopped immediately. Change-Id: Ibc96785878fd92e26d08e92dcffa9b9e6d39fb9d Signed-off-by: DongHyun Song --- diff --git a/wrt_app/src/web_application.ts b/wrt_app/src/web_application.ts index 12384970..b68bf17d 100755 --- a/wrt_app/src/web_application.ts +++ b/wrt_app/src/web_application.ts @@ -308,6 +308,10 @@ export class WebApplication { } } + private isPausable() { + return !this.profileDelegate.canIgnoreSuspend() && !this.backgroundRunnable(); + } + suspend() { if (this.suspended || this.inQuit) return; @@ -317,10 +321,7 @@ export class WebApplication { addonManager.emit('lcSuspend', this.mainWindow.id); this.windowList[this.windowList.length - 1].hide(); } - this.flushData(); - if (this.profileDelegate.canIgnoreSuspend()) - return; - if (!this.backgroundRunnable()) { + if (this.isPausable()) { this.windowList.forEach((window) => window.setEnabled(false)); if (!this.multitaskingSupport) { setTimeout(() => { @@ -329,6 +330,7 @@ export class WebApplication { }, 0); } } + this.flushData(); } resume() { @@ -344,11 +346,11 @@ export class WebApplication { quit() { console.log('WebApplication : quit'); - this.flushData(); this.windowList.forEach((window) => { window.removeAllListeners(); window.setEnabled(false); }); + this.flushData(); this.inQuit = false; }