<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:darin&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <span class="fn">Darin Adler</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebKitTestRunner needs layoutTestController.setDashboardCompatibilityMode"
   href="https://bugs.webkit.org/show_bug.cgi?id=42547">bug 42547</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;">Attachment #285589 Flags</td>
           <td>review?
           </td>
           <td>review+
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebKitTestRunner needs layoutTestController.setDashboardCompatibilityMode"
   href="https://bugs.webkit.org/show_bug.cgi?id=42547#c6">Comment # 6</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebKitTestRunner needs layoutTestController.setDashboardCompatibilityMode"
   href="https://bugs.webkit.org/show_bug.cgi?id=42547">bug 42547</a>
              from <span class="vcard"><a class="email" href="mailto:darin&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <span class="fn">Darin Adler</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=285589&amp;action=diff" name="attach_285589" title="Patch">attachment 285589</a> <a href="attachment.cgi?id=285589&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=285589&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=285589&amp;action=review</a>

<span class="quote">&gt; Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp:323
&gt; +    const HashSet&lt;Page*&gt;&amp; pages = PageGroup::pageGroup(pageGroup-&gt;identifier())-&gt;pages();
&gt; +    for (HashSet&lt;Page*&gt;::iterator iter = pages.begin(); iter != pages.end(); ++iter)
&gt; +        (*iter)-&gt;settings().setUsesDashboardBackwardCompatibilityMode(enabled);</span >

Here’s how we should write this in new code (other code in tis file is old):

    for (auto&amp; page : PageGroup::pageGroup(pageGroup-&gt;identifier())-&gt;pages())
        page-&gt;settings().setUsesDashboardBackwardCompatibilityMode(enabled);

We don’t use abbreviations in WebKit code, so code should be using &quot;iter&quot; (even though there are many other functions in this file doing it). And with a C++11 for loop we don’t need to bother with a local variable.

<span class="quote">&gt; Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:420
&gt; +    fputs(&quot;Dashboard unsupported\n&quot;, stderr);</span >

This isn’t a good idea. The test runner should not be writing things out directly to stderr.</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>