In window.hide(),
'visibilitychange' or 'webkitvisibilitychange' event is dispatched from
Document::DidChangeVisibilityState(), which is triggered by
RenderWidgetHostViewEfl::SetPageVisibility()
In window.setEnable(),
it try to request suspending to renderer thread, then it try to stop
chromium resources even JavaScript context.
Thus if hide() is called after setEnable(), it can defer application's
'visibilitchange' callback unexpectedly.
Change-Id: Ibe89b79f8a01ca170db40af8a5792fe64e9bf4ba
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
console.log('WebApplication : suspend - Invalid event emitter');
}
this.suspended = true;
+ this.windowList[this.windowList.length - 1].hide();
if (wrt.tv) {
wrt.tv.flushCookie();
this.windowList.forEach((window) => window.webContents.session.flushStorageData());
this.windowList.forEach((window) => window.setEnabled(false));
}
}
- this.windowList[this.windowList.length - 1].hide();
}
resume() {
console.log('WebApplication : resume');
-
this.suspended = false;
-
if (this.addonEmitter) {
console.log('WebApplication : resume - Found event emitter');
this.addonEmitter.emit('lcResume', this.mainWindow.id);
if (!this.firstRendered) {
console.log('WebApplication : resume firstRendered is false');
- return;
+ return;
}
if (!this.backgroundRunnable()) {
this.windowList.forEach((window) => window.setEnabled(true));