Ignore:
Timestamp:
Jun 7, 2007, 4:16:37 PM (18 years ago)
Author:
andersca
Message:

Reviewed by Geoff.

Get rid of Instance::setRootObject and pass the root object to the instance constructor instead.


  • bindings/c/c_instance.cpp: (KJS::Bindings::CInstance::CInstance):
  • bindings/c/c_instance.h:
  • bindings/jni/jni_instance.cpp: (JavaInstance::JavaInstance):
  • bindings/jni/jni_instance.h:
  • bindings/jni/jni_jsobject.cpp: (JavaJSObject::convertJObjectToValue):
  • bindings/objc/objc_instance.h:
  • bindings/objc/objc_instance.mm: (ObjcInstance::ObjcInstance):
  • bindings/runtime.cpp: (KJS::Bindings::Instance::Instance): (KJS::Bindings::Instance::createBindingForLanguageInstance):
  • bindings/runtime.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bindings/runtime.cpp

    r19183 r22056  
    9696
    9797
    98 Instance::Instance()
    99     : _refCount(0)
     98Instance::Instance(PassRefPtr<RootObject> rootObject)
     99    : _rootObject(rootObject)
     100    , _refCount(0)
    100101{
    101102}
     
    127128#if HAVE(JNI)
    128129        case Instance::JavaLanguage: {
    129             newInstance = new Bindings::JavaInstance((jobject)nativeInstance);
     130            newInstance = new Bindings::JavaInstance((jobject)nativeInstance, rootObject);
    130131            break;
    131132        }
     
    133134#if PLATFORM(MAC)
    134135        case Instance::ObjectiveCLanguage: {
    135             newInstance = new Bindings::ObjcInstance((ObjectStructPtr)nativeInstance);
     136            newInstance = new Bindings::ObjcInstance((ObjectStructPtr)nativeInstance, rootObject);
    136137            break;
    137138        }
    138139#endif
    139140        case Instance::CLanguage: {
    140             newInstance = new Bindings::CInstance((NPObject *)nativeInstance);
     141            newInstance = new Bindings::CInstance((NPObject *)nativeInstance, rootObject);
    141142            break;
    142143        }
    143144#if PLATFORM(QT)
    144145        case Instance::QtLanguage: {
    145             newInstance = new Bindings::QtInstance((QObject *)nativeInstance);
     146            newInstance = new Bindings::QtInstance((QObject *)nativeInstance, rootObject);
    146147            break;
    147148        }
     
    151152    }
    152153
    153     if (newInstance)
    154         newInstance->setRootObject(rootObject);
    155        
    156154    return newInstance;
    157155}
     
    165163}
    166164
    167 void Instance::setRootObject(PassRefPtr<RootObject> rootObject)
    168 {
    169     _rootObject = rootObject;
    170 }
    171 
    172165RootObject* Instance::rootObject() const
    173166{
Note: See TracChangeset for help on using the changeset viewer.