Bug 138206 - Remove create() factory function in FooAnimationValue classes
Summary: Remove create() factory function in FooAnimationValue classes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Gyuyoung Kim
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-29 18:55 PDT by Gyuyoung Kim
Modified: 2014-11-09 22:47 PST (History)
13 users (show)

See Also:


Attachments
Patch (16.11 KB, patch)
2014-10-29 18:56 PDT, Gyuyoung Kim
no flags Details | Formatted Diff | Diff
Patch (16.91 KB, patch)
2014-10-30 18:46 PDT, Gyuyoung Kim
no flags Details | Formatted Diff | Diff
Patch (16.92 KB, patch)
2014-10-30 21:42 PDT, Gyuyoung Kim
no flags Details | Formatted Diff | Diff
Rebased (16.90 KB, patch)
2014-11-09 18:27 PST, Gyuyoung Kim
no flags Details | Formatted Diff | Diff
Patch for landing (16.72 KB, patch)
2014-11-09 22:01 PST, Gyuyoung Kim
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gyuyoung Kim 2014-10-29 18:55:19 PDT
SSIA
Comment 1 Gyuyoung Kim 2014-10-29 18:56:29 PDT
Created attachment 240647 [details]
Patch
Comment 2 Gyuyoung Kim 2014-10-30 18:46:23 PDT
Created attachment 240719 [details]
Patch
Comment 3 Gyuyoung Kim 2014-10-30 21:42:27 PDT
Created attachment 240724 [details]
Patch
Comment 4 Ryosuke Niwa 2014-10-31 20:48:31 PDT
Comment on attachment 240724 [details]
Patch

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

> Source/WebCore/platform/graphics/GraphicsLayer.h:91
> +    FloatAnimationValue(double keyTime, float value, TimingFunction* timingFunction = nullptr)
> +        : AnimationValue(keyTime, timingFunction)
> +        , m_value(value)
>      {
> -        return adoptPtr(new FloatAnimationValue(keyTime, value, timingFunction));
>      }

Doesn't this change expose the copy constructor as a public member function?
Comment 5 Gyuyoung Kim 2014-10-31 23:25:39 PDT
(In reply to comment #4)
> Comment on attachment 240724 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=240724&action=review
> 
> > Source/WebCore/platform/graphics/GraphicsLayer.h:91
> > +    FloatAnimationValue(double keyTime, float value, TimingFunction* timingFunction = nullptr)
> > +        : AnimationValue(keyTime, timingFunction)
> > +        , m_value(value)
> >      {
> > -        return adoptPtr(new FloatAnimationValue(keyTime, value, timingFunction));
> >      }
> 
> Doesn't this change expose the copy constructor as a public member function?


When I try to create FloatAnimationValue through copy constructor, there is no build error. If you have concern about it, could you let me know it ?
Comment 6 Gyuyoung Kim 2014-11-03 20:56:09 PST
(In reply to comment #5)
> (In reply to comment #4)
> > Comment on attachment 240724 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=240724&action=review
> > 
> > > Source/WebCore/platform/graphics/GraphicsLayer.h:91
> > > +    FloatAnimationValue(double keyTime, float value, TimingFunction* timingFunction = nullptr)
> > > +        : AnimationValue(keyTime, timingFunction)
> > > +        , m_value(value)
> > >      {
> > > -        return adoptPtr(new FloatAnimationValue(keyTime, value, timingFunction));
> > >      }
> > 
> > Doesn't this change expose the copy constructor as a public member function?
> 
> 
> When I try to create FloatAnimationValue through copy constructor, there is
> no build error.

I succeed to create FloatAnimationValue object using copy constructor as below,

 FloatAnimationValue* fValue = new FloatAnimationValue(key, keyframeStyle->opacity(), tf);
 FloatAnimationValue* copyValue(fValue);

It looks the change can support copy constructor.
Comment 7 Gyuyoung Kim 2014-11-09 18:27:26 PST
Created attachment 241266 [details]
Rebased
Comment 8 Darin Adler 2014-11-09 21:48:56 PST
Comment on attachment 241266 [details]
Rebased

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

> Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp:160
> +    std::unique_ptr<AnimationValue> intialValue = std::make_unique<FloatAnimationValue>(0, 1);
> +    fadeKeyframes.insert(WTF::move(intialValue));

I think this would read better without a local variable:

    fadeKeyframes.insert(std::make_unique<FloatAnimationValue>(0, 1));

> Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp:163
> +    std::unique_ptr<AnimationValue> finalValue = std::make_unique<FloatAnimationValue>(0.25, 0);
> +    fadeKeyframes.insert(WTF::move(finalValue));

I think this would read better without a local variable:

    fadeKeyframes.insert(std::make_unique<FloatAnimationValue>(0.25, 0));
Comment 9 Gyuyoung Kim 2014-11-09 22:01:59 PST
Created attachment 241275 [details]
Patch for landing
Comment 10 Gyuyoung Kim 2014-11-09 22:02:59 PST
(In reply to comment #8)
> Comment on attachment 241266 [details]
> Rebased
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=241266&action=review
> 
> > Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp:160
> > +    std::unique_ptr<AnimationValue> intialValue = std::make_unique<FloatAnimationValue>(0, 1);
> > +    fadeKeyframes.insert(WTF::move(intialValue));
> 
> I think this would read better without a local variable:
> 
>     fadeKeyframes.insert(std::make_unique<FloatAnimationValue>(0, 1));
> 
> > Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp:163
> > +    std::unique_ptr<AnimationValue> finalValue = std::make_unique<FloatAnimationValue>(0.25, 0);
> > +    fadeKeyframes.insert(WTF::move(finalValue));
> 
> I think this would read better without a local variable:
> 
>     fadeKeyframes.insert(std::make_unique<FloatAnimationValue>(0.25, 0));

Thank you for review ! Fixed all.
Comment 11 WebKit Commit Bot 2014-11-09 22:47:02 PST
Comment on attachment 241275 [details]
Patch for landing

Clearing flags on attachment: 241275

Committed r175799: <http://trac.webkit.org/changeset/175799>
Comment 12 WebKit Commit Bot 2014-11-09 22:47:09 PST
All reviewed patches have been landed.  Closing bug.