2009-10-23  Chris Evans  <cevans@chromium.org>

        Reviewed by Adam Barth.

        Added test for bug 27239 (ignore Refresh for view source mode).
        https://bugs.webkit.org/show_bug.cgi?id=27239

        * http/tests/security/view-source-no-refresh.html: Added
        * http/tests/security/view-source-no-refresh-expected.txt: Added
        * http/tests/security/resources/view-source-no-refresh.php: Added
2009-10-23  Chris Evans  <cevans@chromium.org>

        Reviewed by Adam Barth.

        Ignore the Refresh header if we're in view source mode.

        https://bugs.webkit.org/show_bug.cgi?id=27239

        Test: http/tests/security/view-source-no-refresh.html

        * loader/FrameLoader.cpp: ignore Refresh in view-source mode.

git-svn-id: svn://svn.chromium.org/blink/trunk@50018 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void FrameLoader::dispatchWindowObjectAvailable()
{
    if (!m_frame->script()->isEnabled() || !m_frame->script()->existingWindowShell(mainThreadNormalWorld()))
        return;

    m_client->windowObjectCleared();

#if ENABLE(INSPECTOR)
    if (Page* page = m_frame->page()) {
        if (InspectorController* inspector = page->inspectorController())
            inspector->inspectedWindowScriptObjectCleared(m_frame);
        if (InspectorController* inspector = page->parentInspectorController())
            inspector->windowScriptObjectAvailable();
    }
#endif
}

void FrameLoader::dispatchWindowObjectAvailable()
{
    if (!m_frame->script()->isEnabled() || !m_frame->script()->existingWindowShell(mainThreadNormalWorld()))
        return;

    m_client->windowObjectCleared();

#if ENABLE(INSPECTOR)
    if (Page* page = m_frame->page()) {
        if (InspectorController* inspector = page->inspectorController())
            inspector->inspectedWindowScriptObjectCleared(m_frame);
        if (InspectorController* inspector = page->parentInspectorController())
            inspector->windowScriptObjectAvailable();
    }
#endif
}
