2010-06-25 Tony Gentilcore <tonyg@chromium.org>
authortonyg@chromium.org <tonyg@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Jun 2010 05:27:37 +0000 (05:27 +0000)
committertonyg@chromium.org <tonyg@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Jun 2010 05:27:37 +0000 (05:27 +0000)
commit101203befe452fa986678bafb44976dbb5c8803e
tree6eb77e6dc42f8a246b03d8248f7c99ee855592b7
parente0127348cda88c5da1133b77a244a7fd130b286a
2010-06-25  Tony Gentilcore  <tonyg@chromium.org>

        Reviewed by Eric Seidel.

        Make PendingScript hold a CachedResourceClient open for its lifetime
        https://bugs.webkit.org/show_bug.cgi?id=40968

        This replaces the mechanism introduced in r61374 with a simpler
        appraoch for preventing unexpected purges: always keep a client open.
        This approach will allow deferred scripts to add a client after
        the resource may have already been loaded without having to worry about
        the buffer being purged in the meantime.

        No new tests because making a CachedResource purse itself is not
        testable from a LayoutTest.

        * html/HTMLDocumentParser.cpp:
        (WebCore::HTMLDocumentParser::watchForLoad):
        (WebCore::HTMLDocumentParser::notifyFinished):
        * html/HTMLScriptRunner.cpp:
        (WebCore::HTMLScriptRunner::~HTMLScriptRunner):
        (WebCore::HTMLScriptRunner::sourceFromPendingScript):
        (WebCore::HTMLScriptRunner::isPendingScriptReady):
        (WebCore::HTMLScriptRunner::executePendingScript):
        (WebCore::HTMLScriptRunner::watchForLoad):
        (WebCore::HTMLScriptRunner::stopWatchingForLoad):
        (WebCore::HTMLScriptRunner::executeScriptsWaitingForLoad):
        (WebCore::HTMLScriptRunner::requestScript):
        (WebCore::HTMLScriptRunner::PendingScript::~PendingScript):
        (WebCore::HTMLScriptRunner::PendingScript::releaseElementAndClear):
        (WebCore::HTMLScriptRunner::PendingScript::setCachedScript):
        (WebCore::HTMLScriptRunner::PendingScript::cachedScript):
        * html/HTMLScriptRunner.h:
        (WebCore::HTMLScriptRunner::PendingScript::PendingScript):
        (WebCore::HTMLScriptRunner::PendingScript::watchingForLoad):
        (WebCore::HTMLScriptRunner::PendingScript::setWatchingForLoad):
        (WebCore::HTMLScriptRunner::PendingScript::notifyFinished):
        * html/HTMLScriptRunnerHost.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@61940 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/html/HTMLDocumentParser.cpp
WebCore/html/HTMLScriptRunner.cpp
WebCore/html/HTMLScriptRunner.h
WebCore/html/HTMLScriptRunnerHost.h