NEW300302
Fix Safer-CPP errors for code generated by generate-inspector-protocol-bindings.py
https://bugs.webkit.org/show_bug.cgi?id=300302
Summary Fix Safer-CPP errors for code generated by generate-inspector-protocol-bindin...
Frédéric Wang (:fredw)
Reported 2025-10-07 00:57:20 PDT
Looking at AutomationProtocolObjects.h, I see three kind of errors: * UncountedCallArgsCheckerExpectations with m_result at https://searchfox.org/wubkat/rev/dd05eb230972a07f0240b959e6e22ca685ef3445/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py#345 ; It's a RefPtr member but per https://github.com/WebKit/WebKit/wiki/Safer-CPP-Guidelines#mark-data-members-that-are-smart-pointers-as-const-if-they-never-get-reassigned we need either it to be a smart pointer on the stack or to be a const. The latter is not possible because of the function mentioned in the next bullet. * Unsafe cast from type 'Ref' to an unrelated type 'Ref' for https://searchfox.org/wubkat/rev/dd05eb230972a07f0240b959e6e22ca685ef3445/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator_templates.py#225 * Unsafe cast from type 'Builder' to an unrelated type 'Builder' for https://searchfox.org/wubkat/rev/dd05eb230972a07f0240b959e6e22ca685ef3445/Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator_templates.py#206
Attachments
Frédéric Wang (:fredw)
Comment 1 2025-10-07 01:03:08 PDT Comment hidden (obsolete)
Radar WebKit Bug Importer
Comment 2 2025-10-14 00:58:10 PDT
Note You need to log in before you can comment on or make changes to this bug.