WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
163188
Update generated bindings code so that dictionary structures no longer need explicit constructors
https://bugs.webkit.org/show_bug.cgi?id=163188
Summary
Update generated bindings code so that dictionary structures no longer need e...
Chris Dumez
Reported
2016-10-09 16:53:32 PDT
Update generated bindings code so that dictionary structures no longer need constructors.
Attachments
Patch
(45.24 KB, patch)
2016-10-09 17:15 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(45.62 KB, patch)
2016-10-09 17:46 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-10-09 17:15:09 PDT
Created
attachment 291054
[details]
Patch
Darin Adler
Comment 2
2016-10-09 17:39:24 PDT
Comment on
attachment 291054
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=291054&action=review
Now that I see your change written out, I don’t see any downside to this.
> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:1144 > + $result .= " return result;\n";
We want WTFMove(result) here, otherwise we end up copying the result to make the Optional<> version. Saves work and reference count churn when there are data members that have non-trivial constructors.
> Source/WebCore/dom/ClipboardEvent.h:37 > struct Init : public EventInit {
No need for the "public" here.
> Source/WebCore/dom/CustomEvent.h:44 > struct Init : public EventInit {
No need for the "public" here.
> Source/WebCore/dom/EventModifierInit.h:32 > struct EventModifierInit : public UIEventInit {
No need for the "public" here.
> Source/WebCore/editing/Editor.cpp:884 > RefPtr<DataTransfer> dataTransfer = DataTransfer::createForCopyAndPaste(policy);
This should be auto.
> Source/WebCore/editing/Editor.cpp:889 > + init.clipboardData = dataTransfer.get();
This should just be standard assignment. I don’t think a call to .get() would be needed here; RefPtr = RefPtr should compile and RefPtr = Ref should also compile with no get call.
Chris Dumez
Comment 3
2016-10-09 17:44:10 PDT
(In reply to
comment #2
)
> Comment on
attachment 291054
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=291054&action=review
> > Now that I see your change written out, I don’t see any downside to this.
Well, the downside is that we'll have to pass non-nullable wrapper type as raw pointers for now. Thankfully, this is not common in dictionaries (only 1 instance in WebKit).
Chris Dumez
Comment 4
2016-10-09 17:46:52 PDT
Created
attachment 291055
[details]
Patch
Chris Dumez
Comment 5
2016-10-09 18:18:40 PDT
Comment on
attachment 291055
[details]
Patch Clearing flags on attachment: 291055 Committed
r206974
: <
http://trac.webkit.org/changeset/206974
>
Chris Dumez
Comment 6
2016-10-09 18:18:45 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