2009-12-14  Yael Aharon  <yael.aharon@nokia.com>

        Reviewed by Antti Koivisto.

        handling scripts can block UI
        https://bugs.webkit.org/show_bug.cgi?id=27612

        Break execution of external scrips to smaller chunks.
        No new tests since no new functionality was introduced.

        * html/HTMLTokenizer.cpp:
        (WebCore::HTMLTokenizer::HTMLTokenizer):
        (WebCore::HTMLTokenizer::reset):
        (WebCore::HTMLTokenizer::notifyFinished):
        (WebCore::HTMLTokenizer::executeExternalScriptsIfReady):
        (WebCore::HTMLTokenizer::executeExternalScriptsTimerFired):
        (WebCore::HTMLTokenizer::continueExecutingExternalScripts):
        * html/HTMLTokenizer.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/html/HTMLTokenizer.h b/WebCore/html/HTMLTokenizer.h
index d731b2d..2516eda 100644
--- a/WebCore/html/HTMLTokenizer.h
+++ b/WebCore/html/HTMLTokenizer.h
@@ -205,6 +205,10 @@
     // from CachedResourceClient
     void notifyFinished(CachedResource*);
 
+    void executeExternalScriptsIfReady();
+    void executeExternalScriptsTimerFired(Timer<HTMLTokenizer>*);
+    bool continueExecutingExternalScripts(double startTime);
+
     // Internal buffers
     ///////////////////
     UChar* m_buffer;
@@ -401,6 +405,9 @@
     // The timer for continued processing.
     Timer<HTMLTokenizer> m_timer;
 
+    // The timer for continued executing external scripts.
+    Timer<HTMLTokenizer> m_externalScriptsTimer;
+
 // This buffer can hold arbitrarily long user-defined attribute names, such as in EMBED tags.
 // So any fixed number might be too small, but rather than rewriting all usage of this buffer
 // we'll just make it large enough to handle all imaginable cases.