From 592d9604bbca422c4db7accf7de11a8202d702cc Mon Sep 17 00:00:00 2001 From: DongHyun Song Date: Thu, 30 Sep 2021 10:30:24 +0900 Subject: [PATCH] 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 --- wrt_app/src/web_application.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/wrt_app/src/web_application.ts b/wrt_app/src/web_application.ts index 1238497..b68bf17 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; } -- 2.7.4