<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:cgarcia&#64;igalia.com" title="Carlos Garcia Campos &lt;cgarcia&#64;igalia.com&gt;"> <span class="fn">Carlos Garcia Campos</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GTK] Inspector crashes when using the console"
   href="https://bugs.webkit.org/show_bug.cgi?id=155745">bug 155745</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
               &nbsp;
           </td>
           <td>cgarcia&#64;igalia.com
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GTK] Inspector crashes when using the console"
   href="https://bugs.webkit.org/show_bug.cgi?id=155745#c7">Comment # 7</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GTK] Inspector crashes when using the console"
   href="https://bugs.webkit.org/show_bug.cgi?id=155745">bug 155745</a>
              from <span class="vcard"><a class="email" href="mailto:cgarcia&#64;igalia.com" title="Carlos Garcia Campos &lt;cgarcia&#64;igalia.com&gt;"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=155745#c5">comment #5</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=275093&amp;action=diff" name="attach_275093" title="Patch">attachment 275093</a> <a href="attachment.cgi?id=275093&amp;action=edit" title="Patch">[details]</a></span>
&gt; Patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=275093&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=275093&amp;action=review</a>
&gt; 
&gt; Great work! Just a few naming suggestions, and let's wait for EWS.</span >

Thanks for the review.

<span class="quote">&gt; It's weird that this crash happens on GTK but not Mac since we generate the
&gt; same protocol groups.</span >

I was also surprised, my guess is that for some reason in Mac you always end up using the JSC table that is bigger.

<span class="quote">&gt; In the longer term there won't be a need for client code (inspector Agents
&gt; etc) to use this helper directly because the protocol bindings will do the
&gt; type checking and conversions itself.
&gt; 
&gt; &gt; Source/JavaScriptCore/ChangeLog:19
&gt; &gt; +        getEnumConstantValue() generated and used foe every framework, so
&gt; 
&gt; Nit: 'for'</span >

Oops.

<span class="quote">&gt; &gt; Source/JavaScriptCore/ChangeLog:25
&gt; &gt; +        (CppGenerator.enums_namespace): Return the namespace name that
&gt; 
&gt; Suggestion: If you are going to line wrap with this few columns, it's a lot
&gt; easier to parse the changelog if you add newlines after each text block.</span >

It's emacs default :-) I'll try to make it easier to read either adding new lines or configuring emacs to use longer lines.

<span class="quote">&gt; &gt; Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp:219
&gt; &gt; +    if (typeString == Inspector::Protocol::InspectorEnums::getEnumConstantValue(Inspector::Protocol::Debugger::BreakpointAction::Type::Log)) {
&gt; 
&gt; Please change the namespace to XXXHelpers or XXXConversions. There are other
&gt; helpers we may want to put in a disambiguated namespace.</span >

Helpers is more generic, just in case we end up adding something that is not a conversor.

<span class="quote">&gt; &gt; Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py:53
&gt; &gt; +    def enums_namespace(self):
&gt; 
&gt; As above, please rename this function to helper_namespace or similar.</span >

Sure.

<span class="quote">&gt; &gt; Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py:76
&gt; &gt; +        sections.append('namespace %s {' % self.enums_namespace())
&gt; 
&gt; I would recommend extracting this entire snippet into a private method, the
&gt; top-level generation method is getting long.</span >

Ok.

<span class="quote">&gt; &gt; Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py:89
&gt; &gt; +        sections.append('} // namespace %s' % self.enums_namespace())
&gt; 
&gt; Please inline the namespace wrapping into
&gt; self._generate_declarations_for_enum_conversion_methods() and do not emit it
&gt; if there are no lines emitted into the namespace.</span >

Ok.

<span class="quote">&gt; &gt; Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py:298
&gt; &gt; +            lines.append('            m_result-&gt;%(keyedSet)s(ASCIILiteral(&quot;%(name)s&quot;), Inspector::Protocol::%(enumsNamespace)s::getEnumConstantValue(value));' % setter_args)
&gt; 
&gt; I am surprised that removing the cast doesn't cause a compiler error.</span >

We have a template function that makes the cast already.

<span class="quote">&gt; &gt; Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py:70
&gt; &gt; +        sections.append('} // namespace %s' % self.enums_namespace())
&gt; 
&gt; See comment above.
&gt; 
&gt; &gt; Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result:814
&gt; &gt; +
&gt; 
&gt; This extra newline isn't needed.</span >

That was --reset-results I haven't changed tests results manually.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>