Changeset 51538 in webkit


Ignore:
Timestamp:
Dec 1, 2009 8:17:42 AM (14 years ago)
Author:
yurys@chromium.org
Message:

2009-12-01 Yury Semikhatsky <yurys@chromium.org>

Reviewed by Adam Barth.

Provide a way to get ScriptState for the inspected page.

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

  • bindings/v8/ScriptController.cpp: (WebCore::ScriptController::mainWorldScriptState):
  • bindings/v8/ScriptController.h:
  • bindings/v8/ScriptState.cpp: (WebCore::scriptStateFromPage):
Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r51537 r51538  
     12009-12-01  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Provide a way to get ScriptState for the inspected page.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=32020
     8
     9        * bindings/v8/ScriptController.cpp:
     10        (WebCore::ScriptController::mainWorldScriptState):
     11        * bindings/v8/ScriptController.h:
     12        * bindings/v8/ScriptState.cpp:
     13        (WebCore::scriptStateFromPage):
     14
    1152009-12-01  Chris Marrin  <cmarrin@apple.com>
    216
  • trunk/WebCore/bindings/v8/ScriptController.cpp

    r51524 r51538  
    4848#include "NPV8Object.h"
    4949#include "ScriptSourceCode.h"
     50#include "ScriptState.h"
    5051#include "Settings.h"
    5152#include "V8Binding.h"
     
    355356}
    356357
     358ScriptState* ScriptController::mainWorldScriptState()
     359{
     360    if (!m_mainWorldScriptState)
     361        m_mainWorldScriptState.set(new ScriptState(m_frame, V8Proxy::mainWorldContext(m_frame)));
     362    return m_mainWorldScriptState.get();
     363}
     364
    357365static NPObject* createNoScriptObject()
    358366{
  • trunk/WebCore/bindings/v8/ScriptController.h

    r51524 r51538  
    4949    class HTMLPlugInElement;
    5050    class ScriptSourceCode;
     51    class ScriptState;
    5152    class String;
    5253    class Widget;
     
    171172        static void getAllWorlds(Vector<DOMWrapperWorld*>& worlds);
    172173
     174        // Script state for the main world context.
     175        ScriptState* mainWorldScriptState();
     176
    173177    private:
    174178        Frame* m_frame;
     
    193197        // The XSSAuditor associated with this ScriptController.
    194198        OwnPtr<XSSAuditor> m_XSSAuditor;
     199
     200        // Script state for the main world context.
     201        OwnPtr<ScriptState> m_mainWorldScriptState;
    195202    };
    196203
  • trunk/WebCore/bindings/v8/ScriptState.cpp

    r51524 r51538  
    6969ScriptState* scriptStateFromPage(DOMWrapperWorld*, Page* page)
    7070{
    71     // This should be never reached with V8 bindings.
    72     ASSERT_NOT_REACHED();
    73     return 0;
     71    // This should be only reached with V8 bindings from single process layout tests.
     72    return page->mainFrame()->script()->mainWorldScriptState();
    7473}
    7574
Note: See TracChangeset for help on using the changeset viewer.