[webkit-dev] Question about JSGlobalObject and RootObject use in the objc bridge
remy.saissy at gmail.com
Sun Oct 30 07:49:01 PDT 2011
parameters being bridged to NSString.
It works fine but I think it can be improved, but to do it, I first need
some explanations from you guys :).
What I've found out is that in WebCore::objc_utility.mm, when the method
*ObjcValue convertValueToObjcValue(ExecState* exec, JSValue value,
Receives an ObjcObjectType it tries to retrieve both the originRootObject
and the rootObject. In the case of a non object parameter, both are be the
The issue is that:
*JSGlobalObject *originGlobalObject = exec->dynamicGlobalObject();*
*RootObject* originRootObject = findRootObject(originGlobalObject);*
Returns the originGlobalObject but *findRootObject()* returns nil.
My patch adds an if else statement at the end of this case block but I
think that the correct way to fix the issue is to let the conversion to
and to figure out why there is no originRootObject return (and thus no
rootObject). From my current understanding, it is because the following
method in *runtime_root.cpp*
*PassRefPtr<RootObject> RootObject::create(const void* nativeHandle,
is not called everytime it should be. For example, I think it should be
called in *WebScriptObject.mm:- (*void*)setValue:(*id*)*value* forKey:(*
NSString* *)**key* so the root object at this time will be in in the
rootObjectSet of runtime_root.cpp.* *But since I am not sure to correctly
understand what is the difference between a RootObject and a JSGlobalObject
and how they interact with each other and with the ExecState, I prefer to
It would be nice if somebody could explain me or at least point me to some
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev