Ignore:
Timestamp:
Dec 29, 2006, 4:48:56 PM (18 years ago)
Author:
ggaren
Message:

JavaScriptCore:

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().


  • 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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCore.exp

    r18461 r18481  
    180180__ZN3KJS7UStringC1ERKS0_S2_
    181181__ZN3KJS7UStringaSEPKc
    182 __ZN3KJS8Bindings10RootObject14setInterpreterEPNS_11InterpreterE
    183 __ZN3KJS8Bindings10RootObject25removeAllNativeReferencesEv
    184182__ZN3KJS8Bindings10RootObject40setFindRootObjectForNativeHandleFunctionEPFPS1_PvE
    185183__ZN3KJS8Bindings10RootObject41_findRootObjectForNativeHandleFunctionPtrE
     184__ZN3KJS8Bindings10RootObject7destroyEv
    186185__ZN3KJS8Bindings10throwErrorEPNS_9ExecStateENS_9ErrorTypeEP8NSString
    187186__ZN3KJS8Bindings18addNativeReferenceEPKNS0_10RootObjectEPNS_8JSObjectE
Note: See TracChangeset for help on using the changeset viewer.