[webkit-reviews] review granted: [Bug 177852] Replace some stack raw pointers with RefPtrs within WebCore/dom : [Attachment 322692] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Oct 4 20:56:04 PDT 2017
Ryosuke Niwa <rniwa at webkit.org> has granted Jiewen Tan <jiewen_tan at apple.com>'s
request for review:
Bug 177852: Replace some stack raw pointers with RefPtrs within WebCore/dom
https://bugs.webkit.org/show_bug.cgi?id=177852
Attachment 322692: Patch
https://bugs.webkit.org/attachment.cgi?id=322692&action=review
--- Comment #5 from Ryosuke Niwa <rniwa at webkit.org> ---
Comment on attachment 322692
--> https://bugs.webkit.org/attachment.cgi?id=322692
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=322692&action=review
> Source/WebCore/dom/EventTarget.cpp:236
> + RefPtr<EventTarget> protectedThis(this); // Try to prevent this event
target being removed by an event handler.
I don't think we should add this protectThis objects in this refactoring
effort.
protectedThis is really an anti-pattern that only exists because we don't have
caller which holds onto a Ref/RefPtr of this.
> Source/WebCore/dom/MouseRelatedEvent.cpp:172
> - Node* n = targetNode;
> + Node* n = targetNode.get();
Use RefPtr here.
More information about the webkit-reviews
mailing list