Changeset 51538 in webkit
- Timestamp:
- Dec 1, 2009, 8:17:42 AM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r51537 r51538 1 2009-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 1 15 2009-12-01 Chris Marrin <cmarrin@apple.com> 2 16 -
trunk/WebCore/bindings/v8/ScriptController.cpp
r51524 r51538 48 48 #include "NPV8Object.h" 49 49 #include "ScriptSourceCode.h" 50 #include "ScriptState.h" 50 51 #include "Settings.h" 51 52 #include "V8Binding.h" … … 355 356 } 356 357 358 ScriptState* 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 357 365 static NPObject* createNoScriptObject() 358 366 { -
trunk/WebCore/bindings/v8/ScriptController.h
r51524 r51538 49 49 class HTMLPlugInElement; 50 50 class ScriptSourceCode; 51 class ScriptState; 51 52 class String; 52 53 class Widget; … … 171 172 static void getAllWorlds(Vector<DOMWrapperWorld*>& worlds); 172 173 174 // Script state for the main world context. 175 ScriptState* mainWorldScriptState(); 176 173 177 private: 174 178 Frame* m_frame; … … 193 197 // The XSSAuditor associated with this ScriptController. 194 198 OwnPtr<XSSAuditor> m_XSSAuditor; 199 200 // Script state for the main world context. 201 OwnPtr<ScriptState> m_mainWorldScriptState; 195 202 }; 196 203 -
trunk/WebCore/bindings/v8/ScriptState.cpp
r51524 r51538 69 69 ScriptState* scriptStateFromPage(DOMWrapperWorld*, Page* page) 70 70 { 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(); 74 73 } 75 74
Note:
See TracChangeset
for help on using the changeset viewer.