[Webkit-unassigned] [Bug 54230] [GTK] Implement WebPage class for WebKit2

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 25 06:10:45 PDT 2011


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





--- Comment #17 from Alejandro G. Castro <alex at igalia.com>  2011-03-25 06:10:45 PST ---
(In reply to comment #15)
> (From update of attachment 86284 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=86284&action=review
> 
> > Source/WebKit2/UIProcess/gtk/WebView.cpp:300
> > +    m_pendingEditorCommands = &commandsList;
> 
> Taking a pointer of a stack-based object like this is dangerous. What ensures that we don't end up with a dangling pointer here? Could we fix it in some other way?
> 

Yep, you are right, in this case it is used just to pass the pointer to some callbacks that are only called through this method and do not get this pointer, this way we avoid a copy just for getting the result from the callbacks. To make sure no one uses this for other cases I'm adding a = 0, when the method finishes and asserting initially it does no have any value, and I'm adding transient to the name of the attribute.

> > Source/WebKit2/UIProcess/gtk/WebView.cpp:312
> > +    static HashMap<int, const char*> keyDownCommandsMap;
> > +    static HashMap<int, const char*> keyPressCommandsMap;
> 
> These should use the DEFINE_STATIC_LOCAL to avoid exit-time destructors.
> 

I added this to the StdLibExtras.h:

// WEBKIT_COMMA: Required when using macros like DEFINE_STATIC_LOCAL and you
// need to define a template with multiple arguments i.e.
// DEFINE_STATIC_LOCAL(HasMap<type1 COMMA type2>, ...)
#define WEBKIT_COMMA ,

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



More information about the webkit-unassigned mailing list