Bug 164636 - Warning added in r208542
Summary: Warning added in r208542
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alejandro G. Castro
URL:
Keywords:
: 164688 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-11-11 01:46 PST by Alejandro G. Castro
Modified: 2016-11-15 22:51 PST (History)
6 users (show)

See Also:


Attachments
Patch (1.55 KB, patch)
2016-11-11 01:50 PST, Alejandro G. Castro
no flags Details | Formatted Diff | Diff
Patch (3.19 KB, patch)
2016-11-15 03:47 PST, Alejandro G. Castro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alejandro G. Castro 2016-11-11 01:46:16 PST
We have to call the base class explicetely in the copy constructors.
Comment 1 Alejandro G. Castro 2016-11-11 01:50:33 PST
Created attachment 294485 [details]
Patch
Comment 2 youenn fablet 2016-11-11 08:43:14 PST
Comment on attachment 294485 [details]
Patch

Change is fine I guess but it seems a bit strange to have a copy constructor of a refcounted class.

It might be better to remove the copy constructor here.
Instead, we could have a create() that would take the four parameters (source, track, and the booleans) with default values if needed.
Then clone would use create() instead of the copy constructor.
Comment 3 Alexey Proskuryakov 2016-11-11 10:08:12 PST
I agree, this code smells wrong. When is the copy constructor used?
Comment 4 Eric Carlson 2016-11-11 11:36:37 PST
(In reply to comment #2)
> Comment on attachment 294485 [details]
> Patch
> 
> Change is fine I guess but it seems a bit strange to have a copy constructor
> of a refcounted class.
> 
> It might be better to remove the copy constructor here.
> Instead, we could have a create() that would take the four parameters
> (source, track, and the booleans) with default values if needed.
> Then clone would use create() instead of the copy constructor.

I agree, Youenn's suggestion makes much more sense.
Comment 5 Alejandro G. Castro 2016-11-13 22:53:23 PST
*** Bug 164688 has been marked as a duplicate of this bug. ***
Comment 6 Alejandro G. Castro 2016-11-14 01:14:46 PST
(In reply to comment #4)
> (In reply to comment #2)
> > Comment on attachment 294485 [details]
> > Patch
> > 
> > Change is fine I guess but it seems a bit strange to have a copy constructor
> > of a refcounted class.
> > 
> > It might be better to remove the copy constructor here.
> > Instead, we could have a create() that would take the four parameters
> > (source, track, and the booleans) with default values if needed.
> > Then clone would use create() instead of the copy constructor.
> 
> I agree, Youenn's suggestion makes much more sense.

Right, as ap was saying I'm not sure if this is even used, just fixing the refactoring problem added, I seemed fishy that is why I wanted the review for fixing the warning. I'll check it in more detail.

Thanks for the review.
Comment 7 Alejandro G. Castro 2016-11-15 03:47:57 PST
Created attachment 294832 [details]
Patch
Comment 8 WebKit Commit Bot 2016-11-15 22:51:54 PST
Comment on attachment 294832 [details]
Patch

Clearing flags on attachment: 294832

Committed r208786: <http://trac.webkit.org/changeset/208786>
Comment 9 WebKit Commit Bot 2016-11-15 22:51:58 PST
All reviewed patches have been landed.  Closing bug.