Changeset 201541 in webkit
- Timestamp:
- May 31, 2016 5:45:59 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 9 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r201539 r201541 1 2016-05-31 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: ReportExtraMemoryCost IDL attribute should also be used to generate estimatedSize method 4 https://bugs.webkit.org/show_bug.cgi?id=158144 5 6 Reviewed by Darin Adler. 7 8 * bindings/scripts/CodeGeneratorJS.pm: 9 (InstanceNeedsEstimatedSize): 10 (GenerateHeader): 11 (GenerateImplementation): 12 When an interface includes ReportExtraMemoryCost, generate an estimatedSize 13 method which includes the Base::estimatedSize and the memoryCost(). 14 15 * bindings/scripts/test/GObject/WebKitDOMInterfaceName.cpp: Added. 16 (WebKit::kit): 17 (WebKit::core): 18 (WebKit::wrapInterfaceName): 19 (webkit_dom_interface_name_finalize): 20 (webkit_dom_interface_name_constructor): 21 (webkit_dom_interface_name_class_init): 22 (webkit_dom_interface_name_init): 23 * bindings/scripts/test/GObject/WebKitDOMInterfaceName.h: Added. 24 * bindings/scripts/test/GObject/WebKitDOMInterfaceNamePrivate.h: Added. 25 * bindings/scripts/test/JS/JSInterfaceName.cpp: Added. 26 (WebCore::JSInterfaceNamePrototype::create): 27 (WebCore::JSInterfaceNamePrototype::createStructure): 28 (WebCore::JSInterfaceNamePrototype::JSInterfaceNamePrototype): 29 (WebCore::JSInterfaceNameConstructor::prototypeForStructure): 30 (WebCore::JSInterfaceNameConstructor::initializeProperties): 31 (WebCore::JSInterfaceNamePrototype::finishCreation): 32 (WebCore::JSInterfaceName::JSInterfaceName): 33 (WebCore::JSInterfaceName::createPrototype): 34 (WebCore::JSInterfaceName::prototype): 35 (WebCore::JSInterfaceName::destroy): 36 (WebCore::jsInterfaceNameConstructor): 37 (WebCore::setJSInterfaceNameConstructor): 38 (WebCore::JSInterfaceName::getConstructor): 39 (WebCore::JSInterfaceName::visitChildren): 40 (WebCore::JSInterfaceName::estimatedSize): 41 (WebCore::JSInterfaceNameOwner::isReachableFromOpaqueRoots): 42 (WebCore::JSInterfaceNameOwner::finalize): 43 (WebCore::toJSNewlyCreated): 44 (WebCore::toJS): 45 (WebCore::JSInterfaceName::toWrapped): 46 * bindings/scripts/test/JS/JSInterfaceName.h: Added. 47 (WebCore::JSInterfaceName::create): 48 (WebCore::JSInterfaceName::createStructure): 49 (WebCore::JSInterfaceName::finishCreation): 50 (WebCore::wrapperOwner): 51 (WebCore::wrapperKey): 52 (WebCore::toJS): 53 (WebCore::toJSNewlyCreated): 54 * bindings/scripts/test/ObjC/DOMInterfaceName.h: Added. 55 * bindings/scripts/test/ObjC/DOMInterfaceName.mm: Added. 56 (-[DOMInterfaceName dealloc]): 57 (core): 58 (kit): 59 * bindings/scripts/test/ObjC/DOMInterfaceNameInternal.h: Added. 60 * bindings/scripts/test/TestReportExtraMemoryCost.idl: Added. 61 Include a test for the ReportExtraMemoryCost attribute. 62 1 63 2016-05-31 Alex Christensen <achristensen@webkit.org> 2 64 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r201428 r201541 734 734 || $interface->extendedAttributes->{"ReportExtraMemoryCost"} 735 735 || IsJSBuiltinConstructor($interface) 736 } 737 738 sub InstanceNeedsEstimatedSize 739 { 740 my $interface = shift; 741 return $interface->extendedAttributes->{"ReportExtraMemoryCost"}; 736 742 } 737 743 … … 1317 1323 push(@headerContent, " void visitAdditionalChildren(JSC::SlotVisitor&);\n") if $interface->extendedAttributes->{"JSCustomMarkFunction"}; 1318 1324 push(@headerContent, "\n"); 1325 } 1326 1327 if (InstanceNeedsEstimatedSize($interface)) { 1328 push(@headerContent, " static size_t estimatedSize(JSCell*);\n"); 1319 1329 } 1320 1330 … … 3262 3272 } 3263 3273 3274 if (InstanceNeedsEstimatedSize($interface)) { 3275 push(@implContent, "size_t ${className}::estimatedSize(JSCell* cell)\n"); 3276 push(@implContent, "{\n"); 3277 push(@implContent, " auto* thisObject = jsCast<${className}*>(cell);\n"); 3278 push(@implContent, " return Base::estimatedSize(thisObject) + thisObject->wrapped().memoryCost();\n"); 3279 push(@implContent, "}\n\n"); 3280 } 3281 3264 3282 # Cached attributes are indeed allowed when there is a custom mark/visitChildren function. 3265 3283 # The custom function must make sure to account for the cached attribute.
Note: See TracChangeset
for help on using the changeset viewer.