Changeset 65730 in webkit
- Timestamp:
- Aug 20, 2010 4:34:16 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r65729 r65730 1 2010-08-20 Yury Semikhatsky <yurys@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: discard InjectedScript reference on ScriptState when clearing injected scripts 6 https://bugs.webkit.org/show_bug.cgi?id=44328 7 8 Otherwise if the reference is not cleared we may remove InjectedScript from the 9 map on InjectedScriptHost but keep it on ScriptState and try to reuse it later. 10 11 * bindings/js/JSInjectedScriptHostCustom.cpp: 12 (WebCore::InjectedScriptHost::discardInjectedScript): 13 * bindings/v8/V8HiddenPropertyName.h: 14 * bindings/v8/custom/V8InjectedScriptHostCustom.cpp: 15 (WebCore::InjectedScriptHost::discardInjectedScript): 16 (WebCore::InjectedScriptHost::injectedScriptFor): 17 * inspector/InjectedScript.h: 18 (WebCore::InjectedScript::scriptState): 19 * inspector/InjectedScriptHost.cpp: 20 (WebCore::InjectedScriptHost::discardInjectedScripts): 21 * inspector/InjectedScriptHost.h: 22 1 23 2010-08-20 Nikolas Zimmermann <nzimmermann@rim.com> 2 24 -
trunk/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
r65506 r65730 104 104 } 105 105 106 void InjectedScriptHost::discardInjectedScript(ScriptState* scriptState) 107 { 108 JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject()); 109 globalObject->setInjectedScript(0); 110 } 111 106 112 #if ENABLE(JAVASCRIPT_DEBUGGER) 107 113 JSValue JSInjectedScriptHost::currentCallFrame(ExecState* exec) -
trunk/WebCore/bindings/v8/V8HiddenPropertyName.h
r62380 r65730 41 41 V(attributeListener) \ 42 42 V(scriptState) \ 43 V(devtoolsInjectedScript) \ 43 44 V(sleepFunction) \ 44 45 V(toStringString) \ 45 46 V(event) 47 46 48 47 49 class V8HiddenPropertyName { -
trunk/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
r65506 r65730 47 47 #include "V8DOMWindow.h" 48 48 #include "V8Database.h" 49 #include "V8HiddenPropertyName.h" 49 50 #include "V8JavaScriptCallFrame.h" 50 51 #include "V8Node.h" … … 121 122 } 122 123 124 void InjectedScriptHost::discardInjectedScript(ScriptState* inspectedScriptState) 125 { 126 v8::HandleScope handleScope; 127 v8::Local<v8::Context> context = inspectedScriptState->context(); 128 v8::Context::Scope contextScope(context); 129 130 v8::Local<v8::Object> global = context->Global(); 131 // Skip proxy object. The proxy object will survive page navigation while we need 132 // an object whose lifetime consides with that of the inspected context. 133 global = v8::Local<v8::Object>::Cast(global->GetPrototype()); 134 135 v8::Handle<v8::String> key = V8HiddenPropertyName::devtoolsInjectedScript(); 136 global->DeleteHiddenValue(key); 137 } 138 123 139 v8::Handle<v8::Value> V8InjectedScriptHost::nodeForIdCallback(const v8::Arguments& args) 124 140 { … … 207 223 global = v8::Local<v8::Object>::Cast(global->GetPrototype()); 208 224 209 v8:: Local<v8::String> key = v8::String::New("Devtools_InjectedScript");225 v8::Handle<v8::String> key = V8HiddenPropertyName::devtoolsInjectedScript(); 210 226 v8::Local<v8::Value> val = global->GetHiddenValue(key); 211 227 if (!val.IsEmpty() && val->IsObject()) -
trunk/WebCore/inspector/InjectedScript.h
r65072 r65730 55 55 PassRefPtr<InspectorValue> wrapForConsole(ScriptValue); 56 56 void releaseWrapperObjectGroup(const String&); 57 ScriptState* scriptState() const { return m_injectedScriptObject.scriptState(); } 57 58 58 59 private: -
trunk/WebCore/inspector/InjectedScriptHost.cpp
r65072 r65730 150 150 void InjectedScriptHost::discardInjectedScripts() 151 151 { 152 IdToInjectedScriptMap::iterator end = m_idToInjectedScript.end(); 153 for (IdToInjectedScriptMap::iterator it = m_idToInjectedScript.begin(); it != end; ++it) 154 discardInjectedScript(it->second.scriptState()); 152 155 m_idToInjectedScript.clear(); 153 156 } -
trunk/WebCore/inspector/InjectedScriptHost.h
r65669 r65730 98 98 RemoteInspectorFrontend* remoteFrontend(); 99 99 ScriptObject createInjectedScript(const String& source, ScriptState* scriptState, long id); 100 void discardInjectedScript(ScriptState*); 100 101 101 102 InspectorController* m_inspectorController;
Note: See TracChangeset
for help on using the changeset viewer.