WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
157627
Drop toJS() overload taking a PassRefPtr<> parameter
https://bugs.webkit.org/show_bug.cgi?id=157627
Summary
Drop toJS() overload taking a PassRefPtr<> parameter
Chris Dumez
Reported
2016-05-12 10:14:28 PDT
Drop toJS() overload taking a PassRefPtr<> parameter.
Attachments
Patch
(42.96 KB, patch)
2016-05-12 12:13 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(44.38 KB, patch)
2016-05-12 12:17 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2016-05-12 12:13:25 PDT
Created
attachment 278746
[details]
Patch
Chris Dumez
Comment 2
2016-05-12 12:17:37 PDT
Created
attachment 278748
[details]
Patch
Alex Christensen
Comment 3
2016-05-12 13:02:03 PDT
Comment on
attachment 278748
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=278748&action=review
> Source/WebCore/css/CSSPrimitiveValue.cpp:-945 > - ec = 0;
Why are you deleting this here and not elsewhere?
Chris Dumez
Comment 4
2016-05-12 13:03:15 PDT
Comment on
attachment 278748
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=278748&action=review
>> Source/WebCore/css/CSSPrimitiveValue.cpp:-945 >> - ec = 0; > > Why are you deleting this here and not elsewhere?
Where else do you want me to remove it? We don't check ec in this function so there is no point in setting it to 0.
Alex Christensen
Comment 5
2016-05-12 13:04:35 PDT
Comment on
attachment 278748
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=278748&action=review
>>> Source/WebCore/css/CSSPrimitiveValue.cpp:-945 >>> - ec = 0; >> >> Why are you deleting this here and not elsewhere? > > Where else do you want me to remove it? > > We don't check ec in this function so there is no point in setting it to 0.
ec is a reference, so changing this changes the behavior of the caller. Many other functions in this file do the same thing. I think this is a bad change.
Chris Dumez
Comment 6
2016-05-12 13:09:11 PDT
Comment on
attachment 278748
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=278748&action=review
>>>> Source/WebCore/css/CSSPrimitiveValue.cpp:-945 >>>> - ec = 0; >>> >>> Why are you deleting this here and not elsewhere? >> >> Where else do you want me to remove it? >> >> We don't check ec in this function so there is no point in setting it to 0. > > ec is a reference, so changing this changes the behavior of the caller. Many other functions in this file do the same thing. I think this is a bad change.
and yet. The assignment to 0 here is unnecessary. The rule is that you need to set ec to 0 if you are going to check its value after calling a function. It is therefore the caller of getRGBColorValue()'s responsibility to set ec to 0 if they check ec after calling getRGBColorValue(). Note that getRGBColorValue() is only called from the bindings and they do indeed set ec to 0 before calling getRGBColorValue() and then check the value of ec after calling the function.
Chris Dumez
Comment 7
2016-05-12 13:11:13 PDT
Comment on
attachment 278748
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=278748&action=review
>>>>> Source/WebCore/css/CSSPrimitiveValue.cpp:-945 >>>>> - ec = 0; >>>> >>>> Why are you deleting this here and not elsewhere? >>> >>> Where else do you want me to remove it? >>> >>> We don't check ec in this function so there is no point in setting it to 0. >> >> ec is a reference, so changing this changes the behavior of the caller. Many other functions in this file do the same thing. I think this is a bad change. > > and yet. The assignment to 0 here is unnecessary. The rule is that you need to set ec to 0 if you are going to check its value after calling a function. It is therefore the caller of getRGBColorValue()'s responsibility to set ec to 0 if they check ec after calling getRGBColorValue(). Note that getRGBColorValue() is only called from the bindings and they do indeed set ec to 0 before calling getRGBColorValue() and then check the value of ec after calling the function.
And to answer your other question, I did not update the other methods because I did not touch them in this patch and dropping ec like this requires some work to make sure the call sites are correct.
Alex Christensen
Comment 8
2016-05-12 13:15:58 PDT
Comment on
attachment 278748
[details]
Patch ok
Chris Dumez
Comment 9
2016-05-12 14:12:23 PDT
Comment on
attachment 278748
[details]
Patch Clearing flags on attachment: 278748 Committed
r200789
: <
http://trac.webkit.org/changeset/200789
>
Chris Dumez
Comment 10
2016-05-12 14:12:28 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug