Defer ScriptExecutionContext::Task's in Document when page loading is deferred.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Dec 2011 23:41:21 +0000 (23:41 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Dec 2011 23:41:21 +0000 (23:41 +0000)
commitbe858b8d9f421fbcc32ab85b5c6ee43fb2c3eac2
treebbc6c4c9632f7dcb7ed49caeda177cffb9199f52
parent81974ca8f566a5e1e9e79e7b924b11fead65556d
Defer ScriptExecutionContext::Task's in Document when page loading is deferred.
Schedule them with timer when page loading is resumed. The tasks will be performed
in the original order. This fixes the problem that database callbacks could be missed
when page loading was deferred.
https://bugs.webkit.org/show_bug.cgi?id=49401

Patch by Yong Li <yoli@rim.com> on 2011-12-07
Reviewed by Darin Adler.

Manual test added: ManualTests/database-callback-deferred.html.

* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::didReceiveTask):
(WebCore::Document::postTask):
(WebCore::Document::pendingTasksTimerFired):
(WebCore::Document::suspendScheduledTasks):
(WebCore::Document::resumeScheduledTasks):
* dom/Document.h:
* page/PageGroupLoadDeferrer.cpp:
(WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer):
(WebCore::PageGroupLoadDeferrer::~PageGroupLoadDeferrer):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@102278 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ManualTests/database-callback-deferred.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/page/PageGroupLoadDeferrer.cpp