<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - We should also store the time information for recent searches"
   href="https://bugs.webkit.org/show_bug.cgi?id=148388#c7">Comment # 7</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - We should also store the time information for recent searches"
   href="https://bugs.webkit.org/show_bug.cgi?id=148388">bug 148388</a>
              from <span class="vcard"><a class="email" href="mailto:mitz&#64;webkit.org" title="mitz&#64;webkit.org &lt;mitz&#64;webkit.org&gt;"> <span class="fn">mitz&#64;webkit.org</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=259787&amp;action=diff" name="attach_259787" title="Patch">attachment 259787</a> <a href="attachment.cgi?id=259787&amp;action=edit" title="Patch">[details]</a></span>
Patch

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

This seems to be breaking the Windows build.

<span class="quote">&gt; Source/WebCore/ChangeLog:4
&gt; +        Replace Vector&lt;String&gt; with Vector&lt;std::pair&lt;String, double&gt;&gt; for recent searches
&gt; +        in order to store additional time information.</span >

Typically the summary begins with a high-level description of the change and what motivates it. Something along the lines of “Augment &lt;input type=search&gt;’s recent search history with the time each entry was added, in order to allow time-based clearing of search history”.

<span class="quote">&gt; Source/WebKit/mac/WebCoreSupport/SearchPopupMenuMac.mm:64
&gt; +        [items addObject:&#64;{ searchItem.first: [[NSNumber alloc] initWithDouble:searchItem.second] }];</span >

Just like the single-object HashMap before, what is the point of a single-object dictionary? Why not just an array?

<span class="quote">&gt; Source/WebKit/mac/WebCoreSupport/SearchPopupMenuMac.mm:76
&gt; +        if ([item isKindOfClass:[NSDictionary class]] &amp;&amp; item.allKeys &gt; 0) {</span >

Checking if a pointer type (item.allKeys) is greater than an integer (0) doesn’t make much sense.

This also seems like it will fail to load information saved by the current version of the code, causing it to be lost.

<span class="quote">&gt; Source/WebKit2/UIProcess/Cocoa/WebPageProxyCocoa.mm:54
&gt;          items = adoptCF(CFArrayCreateMutable(0, searchItems.size(), &amp;kCFTypeArrayCallBacks));
&gt;  
&gt; -        for (const auto&amp; searchItem : searchItems)
&gt; -            CFArrayAppendValue(items.get(), searchItem.createCFString().get());
&gt; +        for (const auto&amp; searchItem : searchItems) {
&gt; +            const void* searchItemString[] = { searchItem.first };
&gt; +            const void* searchItemDate[] = { CFNumberCreate(kCFAllocatorDefault, kCFNumberDoubleType, &amp;searchItem.second) };
&gt; +            RetainPtr&lt;CFDictionaryRef&gt; searchItemMap = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, searchItemString, searchItemDate, 1, &amp;kCFTypeDictionaryKeyCallBacks, &amp;kCFTypeDictionaryValueCallBacks));
&gt; +            CFArrayAppendValue(items.get(), searchItemMap.get());</span >

Seems weird to use CF API instead of Foundation API in this Objective-C file.

<span class="quote">&gt; Source/WebKit2/UIProcess/Cocoa/WebPageProxyCocoa.mm:81
&gt; +        if (auto item = dynamic_cf_cast&lt;CFDictionaryRef&gt;(CFArrayGetValueAtIndex(items.get(), i))) {
&gt; +            CFIndex size = CFDictionaryGetCount(item);
&gt; +            Vector&lt;CFStringRef, 1&gt; keys(size);
&gt; +            Vector&lt;CFNumberRef, 1&gt; values(size);
&gt; +            CFDictionaryGetKeysAndValues(item, reinterpret_cast&lt;const void**&gt;(keys.data()), reinterpret_cast&lt;const void**&gt;(values.data()));
&gt; +            if (size &gt; 0)
&gt; +                searchItems.append(std::make_pair((String)keys[0], ((__bridge NSNumber*)values[0]).doubleValue));
&gt; +        }</span >

Ditto.</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>