Summary: | [Qt] [WK2] Improve the memory handling of the context menu for WebKit 2 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Benjamin Poulain <benjamin> | ||||||
Component: | WebKit2 | Assignee: | Benjamin Poulain <benjamin> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue | ||||||
Priority: | P2 | Keywords: | Qt, QtTriaged | ||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Attachments: |
|
Description
Benjamin Poulain
2011-02-21 12:52:47 PST
Created attachment 83208 [details]
Patch
Comment on attachment 83208 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=83208&action=review > Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp:97 > + OwnPtr<QMenu> menu(new QMenu); Why not create this as a PassOwnPtr? like in the PassRefPtr example here? http://www.webkit.org/coding/RefPtr.html (In reply to comment #2) > Why not create this as a PassOwnPtr? like in the PassRefPtr example here? http://www.webkit.org/coding/RefPtr.html I think the semantic of OwnPtr is better than PassPtr for this function. In the doc you mention, on top of the example, there is // example, not preferred style; should use RefCounted and adoptRef (see below) there is "we recommend PassRefPtr only for function argument and result types" in the text. Comment on attachment 83208 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=83208&action=review >> Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp:97 >> + OwnPtr<QMenu> menu(new QMenu); > > Why not create this as a PassOwnPtr? like in the PassRefPtr example here? http://www.webkit.org/coding/RefPtr.html This should use adoptPtr() or it won't build without LOOSE_PASS_OWN_PTR defined. Created attachment 83299 [details]
Patch
Comment on attachment 83299 [details] Patch Clearing flags on attachment: 83299 Committed r79316: <http://trac.webkit.org/changeset/79316> All reviewed patches have been landed. Closing bug. |