[Webkit-unassigned] [Bug 16401] [GTK] GObject/C DOM binding

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 2 01:59:04 PST 2008


https://bugs.webkit.org/show_bug.cgi?id=16401





------- Comment #104 from lkcl at lkcl.net  2008-12-02 01:59 PDT -------
(In reply to comment #101)
> (In reply to comment #100)
> > Can you provide a bit more detail about what you tried here, and what errors
> > you ran in to?  
> 
> Sure. The functions are declared as follows:
> 
>   gpointer toGDOM(WebCore::CSSValue* node);
>   gpointer toGDOM(WebCore::Document* node);
>   gpointer toGDOM(WebCore::Element* node);
>   gpointer toGDOM(WebCore::Event* node);
> 
> There are more, but you get the idea. These functions actually wrap the node
> object into a GObject and return it. If I change them to
> 
>   gpointer toGDOM(PassRefPtr<WebCore::CSSValue> node);
>   gpointer toGDOM(PassRefPtr<WebCore::Document> node);
>   gpointer toGDOM(PassRefPtr<WebCore::Element> node);
>   gpointer toGDOM(PassRefPtr<WebCore::Event> node);
> 
> I get error messages such as the following (this is just the first file that
> fails):
> 
> DerivedSources/gdom/GdomAttr.cpp: In function �void
> gdom_attr__get_property_fn(GObject*, guint, GValue*, GParamSpec*)�:
> DerivedSources/gdom/GdomAttr.cpp:198: error: call of overloaded
> �toGDOM(WebCore::Element*)� is ambiguous
> ./WebCore/bindings/gdom/GDOMBinding.h:61: note: candidates are: void*
> WebKit::toGDOM(WTF::PassRefPtr<WebCore::Element>)
> ./WebCore/bindings/gdom/GDOMBinding.h:63: note:                 void*
> WebKit::toGDOM(WTF::PassRefPtr<WebCore::EventTarget>)
> ./WebCore/bindings/gdom/GDOMBinding.h:64: note:                 void*
> WebKit::toGDOM(WTF::PassRefPtr<WebCore::EventTargetNode>)
> ./WebCore/bindings/gdom/GDOMBinding.h:66: note:                 void*
> WebKit::toGDOM(WTF::PassRefPtr<WebCore::Node>)
> 
> The offending code looks as follows
> 
> 197:  PassRefPtr<WebCore::Element> ptr = gself->ownerElement();
> 198:  g_value_set_object (value, WebKit::toGDOM(ptr.get()));

 this is exactly what the javascript code does.

 the pointer is stored in a RefPtr<WebCore::Element> in the "internal"
 c++ class that has GDOMObject as its base: a private member called m_impl.

 perhaps the solution to satisfy mark's concerns is as simple a matter of
 removing the calls to ref() and deref() - i'll see what effect that has.

 the calls to ref() and deref() were added from copying the style of
 the ObjC bindings DOMObject cacheing.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list