2011-03-28 Maciej Stachowiak <mjs@apple.com>
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Mar 2011 07:37:30 +0000 (07:37 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Mar 2011 07:37:30 +0000 (07:37 +0000)
commit592668d1e7c07bff4a998c02be82e3fd140e5912
tree3b27c6d3f8370d9ed64e71433129fd4ee5009490
parentf3ee6fe77c35ea63d100a5faa72112e6ec5cd737
2011-03-28  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Dan Bernstein.

        WKPageGetSourceForFrame and WKPageGetContentsAsString should throw an error in case of a race with page loading
        https://bugs.webkit.org/show_bug.cgi?id=57305
        <rdar://problem/8738060>, <rdar://problem/8780168>

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::close): Clear m_loadDependentStringCallbackIDs
        (WebKit::WebPageProxy::getSourceForFrame): track the callback as load dependent
        (WebKit::WebPageProxy::getContentsAsString): ditto
        (WebKit::WebPageProxy::clearLoadDependentCallbacks): Invalidate all load dependent callbacks
        (WebKit::WebPageProxy::didCommitLoadForFrame): Call clearLoadDependentCallbacks
        (WebKit::WebPageProxy::didFailLoadForFrame): ditto
        (WebKit::WebPageProxy::stringCallback): Remove callback from load dependent set if appropriate
        (WebKit::WebPageProxy::processDidCrash): Clear m_loadDependentStringCallbackIDs
        * UIProcess/WebPageProxy.h: Add m_loadDependentStringCallbackIDs hash set.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82206 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h