Changeset 148537 in webkit
- Timestamp:
- Apr 16, 2013, 1:05:38 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
-
ChangeLog (modified) (1 diff)
-
bindings/js/ScriptState.cpp (modified) (2 diffs)
-
bindings/js/ScriptState.h (modified) (2 diffs)
-
inspector/InjectedScriptBase.cpp (modified) (3 diffs)
-
inspector/ScriptArguments.cpp (modified) (2 diffs)
-
inspector/ScriptArguments.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r148536 r148537 1 2013-04-16 Anders Carlsson <andersca@apple.com> 2 3 Begin chipping away at ScriptState 4 https://bugs.webkit.org/show_bug.cgi?id=114695 5 6 Reviewed by Geoffrey Garen. 7 8 Remove ScriptStateProtectedPtr as well as evalEnabled and setEvalEnabled. 9 10 * bindings/js/ScriptState.cpp: 11 * bindings/js/ScriptState.h: 12 * inspector/InjectedScriptBase.cpp: 13 (WebCore::InjectedScriptBase::callFunctionWithEvalEnabled): 14 * inspector/ScriptArguments.cpp: 15 (WebCore::ScriptArguments::ScriptArguments): 16 (WebCore::ScriptArguments::globalState): 17 * inspector/ScriptArguments.h: 18 1 19 2013-04-15 Anders Carlsson <andersca@apple.com> 2 20 -
trunk/Source/WebCore/bindings/js/ScriptState.cpp
r148373 r148537 49 49 namespace WebCore { 50 50 51 ScriptStateProtectedPtr::~ScriptStateProtectedPtr()52 {53 }54 55 ScriptStateProtectedPtr::ScriptStateProtectedPtr(ScriptState* scriptState)56 : m_globalObject(scriptState->globalData(), scriptState->lexicalGlobalObject())57 {58 }59 60 ScriptState* ScriptStateProtectedPtr::get() const61 {62 if (m_globalObject)63 return const_cast<JSC::JSGlobalObject*>(m_globalObject.get())->globalExec();64 return 0;65 }66 67 51 DOMWindow* domWindowFromScriptState(ScriptState* scriptState) 68 52 { … … 79 63 return 0; 80 64 return JSC::jsCast<JSDOMGlobalObject*>(globalObject)->scriptExecutionContext(); 81 }82 83 bool evalEnabled(ScriptState* scriptState)84 {85 JSC::JSGlobalObject* globalObject = scriptState->lexicalGlobalObject();86 return globalObject->evalEnabled();87 }88 89 void setEvalEnabled(ScriptState* scriptState, bool enabled)90 {91 JSC::JSGlobalObject* globalObject = scriptState->lexicalGlobalObject();92 return globalObject->setEvalEnabled(enabled);93 65 } 94 66 -
trunk/Source/WebCore/bindings/js/ScriptState.h
r109540 r148537 33 33 #define ScriptState_h 34 34 35 #include <heap/Strong.h>36 #include <wtf/Noncopyable.h>37 38 35 namespace JSC { 39 36 class ExecState; … … 56 53 typedef JSC::ExecState ScriptState; 57 54 58 class ScriptStateProtectedPtr {59 WTF_MAKE_NONCOPYABLE(ScriptStateProtectedPtr);60 public:61 explicit ScriptStateProtectedPtr(ScriptState*);62 ~ScriptStateProtectedPtr();63 ScriptState* get() const;64 private:65 JSC::Strong<JSC::JSGlobalObject> m_globalObject;66 };67 68 55 DOMWindow* domWindowFromScriptState(ScriptState*); 69 56 ScriptExecutionContext* scriptExecutionContextFromScriptState(ScriptState*); 70 71 bool evalEnabled(ScriptState*);72 void setEvalEnabled(ScriptState*, bool);73 57 74 58 ScriptState* mainWorldScriptState(Frame*); -
trunk/Source/WebCore/inspector/InjectedScriptBase.cpp
r141891 r148537 38 38 #include "InspectorValues.h" 39 39 #include "ScriptFunctionCall.h" 40 #include <runtime/JSGlobalObject.h> 40 41 #include <wtf/text/WTFString.h> 41 42 … … 81 82 bool evalIsDisabled = false; 82 83 if (scriptState) { 83 evalIsDisabled = ! evalEnabled(scriptState);84 evalIsDisabled = !scriptState->lexicalGlobalObject()->evalEnabled(); 84 85 // Temporarily enable allow evals for inspector. 85 86 if (evalIsDisabled) 86 s etEvalEnabled(scriptState,true);87 scriptState->lexicalGlobalObject()->setEvalEnabled(true); 87 88 } 88 89 … … 90 91 91 92 if (evalIsDisabled) 92 s etEvalEnabled(scriptState,false);93 scriptState->lexicalGlobalObject()->setEvalEnabled(false); 93 94 94 95 InspectorInstrumentation::didCallFunction(cookie); -
trunk/Source/WebCore/inspector/ScriptArguments.cpp
r95901 r148537 42 42 43 43 ScriptArguments::ScriptArguments(ScriptState* scriptState, Vector<ScriptValue>& arguments) 44 : m_ scriptState(scriptState)44 : m_globalObject(scriptState->globalData(), scriptState->lexicalGlobalObject()) 45 45 { 46 46 m_arguments.swap(arguments); … … 59 59 ScriptState* ScriptArguments::globalState() const 60 60 { 61 return m_scriptState.get(); 61 if (m_globalObject) 62 return const_cast<JSC::JSGlobalObject*>(m_globalObject.get())->globalExec(); 63 return 0; 62 64 } 63 65 -
trunk/Source/WebCore/inspector/ScriptArguments.h
r127757 r148537 32 32 #define ScriptArguments_h 33 33 34 #include "ScriptState.h"34 #include <heap/Strong.h> 35 35 #include <wtf/Forward.h> 36 36 #include <wtf/RefCounted.h> … … 38 38 #include <wtf/text/WTFString.h> 39 39 40 namespace JSC { 41 class ExecState; 42 class JSGlobalObject; 43 } 44 40 45 namespace WebCore { 41 46 47 typedef JSC::ExecState ScriptState; 42 48 class ScriptValue; 43 49 … … 59 65 ScriptArguments(ScriptState*, Vector<ScriptValue>& arguments); 60 66 61 ScriptStateProtectedPtr m_scriptState;67 JSC::Strong<JSC::JSGlobalObject> m_globalObject; 62 68 Vector<ScriptValue> m_arguments; 63 69 };
Note:
See TracChangeset
for help on using the changeset viewer.