Summary: | Have DOMImplementation::document() and Element::attributes() return references | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||
Component: | DOM | Assignee: | Chris Dumez <cdumez> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | commit-queue, kling, rniwa | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Chris Dumez
2014-09-23 11:46:10 PDT
Created attachment 238556 [details]
Patch
Comment on attachment 238556 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=238556&action=review Sweet! r=me > Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:2993 > - $rootString = " Frame* root = js${interfaceName}->impl().frame();\n"; > + $rootString = " Frame* root = WTF::getPtr(js${interfaceName}->impl().frame());\n"; > $rootString .= " if (!root)\n"; > $rootString .= " return false;\n"; It would be cool if we could avoid the null check if the root is a reference. Although maybe the compiler takes care of that anyway. > Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:2997 > - $rootString = " Document* root = js${interfaceName}->impl().document();\n"; > + $rootString = " Document* root = WTF::getPtr(js${interfaceName}->impl().document());\n"; > $rootString .= " if (!root)\n"; > $rootString .= " return false;\n"; Same comment. > Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:3003 > - $rootString = " Element* element = js${interfaceName}->impl().element();\n"; > + $rootString = " Element* element = WTF::getPtr(js${interfaceName}->impl().element());\n"; > $rootString .= " if (!element)\n"; > $rootString .= " return false;\n"; Same comment. Comment on attachment 238556 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=238556&action=review >> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:2993 >> $rootString .= " return false;\n"; > > It would be cool if we could avoid the null check if the root is a reference. > Although maybe the compiler takes care of that anyway. Yes, I thought about this as well. I am hoping the compiler is being smart here but I'll try and take a look soon. Comment on attachment 238556 [details] Patch Clearing flags on attachment: 238556 Committed r173885: <http://trac.webkit.org/changeset/173885> All reviewed patches have been landed. Closing bug. |