Summary: | Update generated bindings code so that dictionary structures no longer need explicit constructors | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||
Component: | Bindings | Assignee: | Chris Dumez <cdumez> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | cdumez, darin, sam | ||||||
Priority: | P2 | ||||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 163624 | ||||||||
Attachments: |
|
Description
Chris Dumez
2016-10-09 16:53:32 PDT
Created attachment 291054 [details]
Patch
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. (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). Created attachment 291055 [details]
Patch
Comment on attachment 291055 [details] Patch Clearing flags on attachment: 291055 Committed r206974: <http://trac.webkit.org/changeset/206974> All reviewed patches have been landed. Closing bug. |