Changeset 18461 in webkit for trunk/JavaScriptCore/bindings/runtime_root.cpp
- Timestamp:
- Dec 28, 2006, 5:44:28 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bindings/runtime_root.cpp
r15990 r18461 29 29 #include <wtf/HashCountedSet.h> 30 30 31 using namespace KJS; 32 using namespace KJS::Bindings; 31 namespace KJS { namespace Bindings { 33 32 34 33 // Java does NOT always call finalize (and thus KJS_JSObject_JSFinalize) when … … 46 45 // are represented by a jlong. 47 46 48 typedef HashMap<const Bindings::RootObject*, ReferencesSet*> ReferencesByRootMap;47 typedef HashMap<const RootObject*, ReferencesSet*> ReferencesByRootMap; 49 48 50 49 static ReferencesByRootMap* getReferencesByRootMap() … … 58 57 } 59 58 60 static ReferencesSet* getReferencesSet(const Bindings::RootObject *root)59 static ReferencesSet* getReferencesSet(const RootObject* rootObject) 61 60 { 62 61 ReferencesByRootMap* refsByRoot = getReferencesByRootMap(); 63 62 ReferencesSet* referencesSet = 0; 64 63 65 referencesSet = refsByRoot->get(root );64 referencesSet = refsByRoot->get(rootObject); 66 65 if (!referencesSet) { 67 66 referencesSet = new ReferencesSet; 68 refsByRoot->add(root , referencesSet);67 refsByRoot->add(rootObject, referencesSet); 69 68 } 70 69 return referencesSet; … … 76 75 // FIXME: This is a potential performance bottleneck with many applets. We could fix be adding a 77 76 // imp to root dictionary. 78 ReferencesSet* KJS::Bindings::findReferenceSet(JSObject *imp)77 ReferencesSet* findReferenceSet(JSObject* imp) 79 78 { 80 79 ReferencesByRootMap* refsByRoot = getReferencesByRootMap (); … … 94 93 // FIXME: This is a potential performance bottleneck with many applets. We could fix be adding a 95 94 // imp to root dictionary. 96 const Bindings::RootObject *KJS::Bindings::rootForImp (JSObject *imp)95 const RootObject* rootObjectForImp (JSObject* imp) 97 96 { 98 97 ReferencesByRootMap* refsByRoot = getReferencesByRootMap (); 99 const Bindings::RootObject *rootObject = 0;98 const RootObject* rootObject = 0; 100 99 101 100 if (refsByRoot) { … … 113 112 } 114 113 115 const Bindings::RootObject *KJS::Bindings::rootForInterpreter (KJS::Interpreter *interpreter)114 const RootObject* rootObjectForInterpreter(Interpreter* interpreter) 116 115 { 117 116 ReferencesByRootMap* refsByRoot = getReferencesByRootMap (); … … 120 119 ReferencesByRootMap::const_iterator end = refsByRoot->end(); 121 120 for (ReferencesByRootMap::const_iterator it = refsByRoot->begin(); it != end; ++it) { 122 const Bindings::RootObject* aRootObject = it->first;121 const RootObject* aRootObject = it->first; 123 122 124 123 if (aRootObject->interpreter() == interpreter) … … 130 129 } 131 130 132 void KJS::Bindings::addNativeReference (const Bindings::RootObject *root, JSObject *imp)133 { 134 if (root ) {135 ReferencesSet* referenceMap = getReferencesSet (root);131 void addNativeReference(const RootObject* rootObject, JSObject* imp) 132 { 133 if (rootObject) { 134 ReferencesSet* referenceMap = getReferencesSet(rootObject); 136 135 137 136 unsigned numReferences = referenceMap->count(imp); … … 144 143 } 145 144 146 void KJS::Bindings::removeNativeReference (JSObject *imp)145 void removeNativeReference(JSObject* imp) 147 146 { 148 147 if (!imp) … … 280 279 // thread that a JavaScript call needs to be invoked. 281 280 CFRunLoopSourceContext sourceContext = {0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, performJavaScriptAccess}; 282 Bindings::RootObject::_performJavaScriptSource = CFRunLoopSourceCreate(NULL, 0, &sourceContext);283 CFRunLoopAddSource( Bindings::RootObject::_runLoop, Bindings::RootObject::_performJavaScriptSource, kCFRunLoopDefaultMode);281 RootObject::_performJavaScriptSource = CFRunLoopSourceCreate(NULL, 0, &sourceContext); 282 CFRunLoopAddSource(RootObject::_runLoop, RootObject::_performJavaScriptSource, kCFRunLoopDefaultMode); 284 283 } 285 284 #endif … … 303 302 } 304 303 305 void RootObject::setInterpreter ( KJS::Interpreter *i)306 { 307 _interpreter = i ;308 } 309 310 304 void RootObject::setInterpreter (Interpreter* interpreter) 305 { 306 _interpreter = interpreter; 307 } 308 309 } } // namespace KJS::Bindings
Note:
See TracChangeset
for help on using the changeset viewer.