Bug 172029 - Stop using PassRefPtr under WebKit2/UIProcess
Summary: Stop using PassRefPtr under WebKit2/UIProcess
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-12 08:40 PDT by Chris Dumez
Modified: 2017-05-12 15:15 PDT (History)
9 users (show)

See Also:


Attachments
Patch (72.97 KB, patch)
2017-05-12 09:31 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (73.69 KB, patch)
2017-05-12 09:36 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (74.43 KB, patch)
2017-05-12 09:41 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2017-05-12 08:40:41 PDT
Stop using PassRefPtr under WebKit2/UIProcess.
Comment 1 Chris Dumez 2017-05-12 09:31:18 PDT
Created attachment 309901 [details]
Patch
Comment 2 Build Bot 2017-05-12 09:32:23 PDT
Attachment 309901 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/WebPageProxy.cpp:5715:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 1 in 47 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Chris Dumez 2017-05-12 09:36:49 PDT
Created attachment 309902 [details]
Patch
Comment 4 Build Bot 2017-05-12 09:39:26 PDT
Attachment 309902 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/WebPageProxy.cpp:5715:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 1 in 48 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Chris Dumez 2017-05-12 09:41:30 PDT
Created attachment 309903 [details]
Patch
Comment 6 Build Bot 2017-05-12 09:44:47 PDT
Attachment 309903 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/WebPageProxy.cpp:5715:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 1 in 49 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Chris Dumez 2017-05-12 15:00:06 PDT
Comment on attachment 309903 [details]
Patch

Clearing flags on attachment: 309903

Committed r216794: <http://trac.webkit.org/changeset/216794>
Comment 8 Chris Dumez 2017-05-12 15:00:08 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Darin Adler 2017-05-12 15:02:00 PDT
Comment on attachment 309903 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=309903&action=review

> Source/WebKit2/UIProcess/WebPageProxy.h:862
> +    void registerEditCommand(Ref<WebEditCommandProxy>&&, UndoOrRedo);

I think this should take WebEditCommandProxy&; it’s not transferring ownership. As far as I can tell, the callers are passing *this, not a newly created object nor the last reference to an object.
Comment 10 Chris Dumez 2017-05-12 15:15:43 PDT
(In reply to Darin Adler from comment #9)
> Comment on attachment 309903 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=309903&action=review
> 
> > Source/WebKit2/UIProcess/WebPageProxy.h:862
> > +    void registerEditCommand(Ref<WebEditCommandProxy>&&, UndoOrRedo);
> 
> I think this should take WebEditCommandProxy&; it’s not transferring
> ownership. As far as I can tell, the callers are passing *this, not a newly
> created object nor the last reference to an object.

2 call sites pass *this and another passes a Ref<>&&:
void WebPageProxy::registerEditCommandForUndo(uint64_t commandID, uint32_t editAction)
{
    registerEditCommand(WebEditCommandProxy::create(commandID, static_cast<EditAction>(editAction), this), Undo);
}

Also, the implementation ends up storing the command into a RefPtr.