-
ggaren authored
Reviewed by Brian Dash... err... Mark Rowe. More cleanup in preparation for fixing <rdar://problem/4608404> WebScriptObject's _executionContext lack of ownership policy causes crashes (e.g., in Dashcode) The key change here is to RootObject::RootObject(). * JavaScriptCore.exp: * bindings/c/c_utility.cpp: (KJS::Bindings::convertValueToNPVariant): Changed to use new constructor. * bindings/jni/jni_jsobject.cpp: (JavaJSObject::createNative): Changed to use new constructor. Replaced large 'if' followed by default condition with "if !" and explicit default condition. * bindings/objc/objc_runtime.mm: (convertValueToObjcObject): Changed to use new constructor. * bindings/runtime_root.cpp: (KJS::Bindings::RootObject::destroy): "removeAllNativeReferences" => "destroy" because this function actually destroys the RootObject. * bindings/runtime_root.h: Changed Interpreter* to RefPtr<Interpreter> to prevent a RootObject from holding a stale Interperter*. (KJS::Bindings::RootObject::RootObject): Changed constructor to take an Interpreter*, since it's pointless to create a RootObject without one. Removed setRootObjectImp() and rootObjectImp() because they were just a confusing way of setting and getting the Interpreter's global object. (KJS::Bindings::RootObject::nativeHandle): "_nativeHandle" => "m_nativeHandle" (KJS::Bindings::RootObject::interpreter): "_interpreter" => "m_interpreter" WebCore: Reviewed by Brian Dash... err... Mark Rowe. More cleanup in preparation for fixing <rdar://problem/4608404> WebScriptObject's _executionContext lack of ownership policy causes crashes (e.g., in Dashcode) The key change here is to RootObject::RootObject(). Layout tests pass. Renamed "_bindingRoot" => "_bindingRootObject" because "RootObject" is the type name. * bindings/objc/WebScriptObject.mm: (_didExecute): Use Interpreter::globalObject(), since RootObject::rootObjectImp() no longer exists. * page/mac/FrameMac.mm: (WebCore::FrameMac::bindingRootObject): Use the new RootObject constructor. Stop lying about who deletes _bindingRoot. (WebCore::FrameMac::cleanupPluginObjects): => "destroy". Fixed a bug where the RootObject would only free its own memory if there were a ReferencesSet* associated with it. * page/mac/WebCoreFrameBridge.mm: (-[WebCoreFrameBridge rootObjectForView:]): Use new constructor. Changed misleading comment. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@18481 268f45cc-cd09-0410-ab3c-d52691b4dbfc
7593bef1