RESOLVED DUPLICATE of bug 67797 66548
check-webkit-style should allow out RefPtr parameters
https://bugs.webkit.org/show_bug.cgi?id=66548
Summary check-webkit-style should allow out RefPtr parameters
Pavel Feldman
Reported 2011-08-19 05:50:02 PDT
Source/WebCore/inspector/InspectorDOMAgent.h:131: The parameter type should use PassRefPtr instead of RefPtr. [readability/pass_ptr] [5]
Attachments
Eric Seidel (no email)
Comment 2 2011-08-19 10:10:55 PDT
void getAttributes(ErrorString*, int nodeId, RefPtr<InspectorArray>* result);
Eric Seidel (no email)
Comment 3 2011-08-19 10:12:30 PDT
I think other parts of the code would write that as a reference instead of a pointer. Or they'd return a PassRefPtr from the method itself. Also, "get" is not normally used in method names, except where dictated by the DOM api. I'm not sure if there is a bug here.
Darin Adler
Comment 4 2011-08-19 10:21:01 PDT
(In reply to comment #3) > I think other parts of the code would write that as a reference instead of a pointer. Or they'd return a PassRefPtr from the method itself. Yes. > Also, "get" is not normally used in method names, except where dictated by the DOM api. I disagree; get is correctly used here to indicate a function that uses an out argument rather than a function result. But as Eric says, in this case there is no obvious reason for use of an out argument for a single function result. Returning a PassRefPtr is the idiom for this sort of thing.
Pavel Feldman
Comment 5 2011-10-04 13:40:43 PDT
> But as Eric says, in this case there is no obvious reason for use of an out argument for a single function result. Returning a PassRefPtr is the idiom for this sort of thing. This is a part of the inspector protocol, methods on the agents are called from the generated dispatcher. Generator was treating RefPtr as the rest of the types, using raw pointers for all out parameters. We'll change it to: void getAttributes(ErrorString*, int nodeId, RefPtr&<InspectorArray> result); to address this warning under https://bugs.webkit.org/show_bug.cgi?id=69366.
David Levin
Comment 6 2011-10-04 19:26:27 PDT
I missed this when I fixed it, so I'l just resolve this as a duplicate of the bug that I fixed for this. If you're still get style errors about this, either let me know or feel free to submit a fix. (It should be trivial especially when you see my previous fix.) *** This bug has been marked as a duplicate of bug 67797 ***
Note You need to log in before you can comment on or make changes to this bug.