<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#c24">Comment # 24</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:zacharyli323&#64;gmail.com" title="Zach Li &lt;zacharyli323&#64;gmail.com&gt;"> <span class="fn">Zach Li</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=148388#c15">comment #15</a>)
<span class="quote">&gt; Comment on <span class="bz_obsolete"><a href="attachment.cgi?id=261233&amp;action=diff" name="attach_261233" title="Patch v2">attachment 261233</a> <a href="attachment.cgi?id=261233&amp;action=edit" title="Patch v2">[details]</a></span>
&gt; Patch v2
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=261233&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=261233&amp;action=review</a>
&gt; 
&gt; I think you should use std::chrono::system_clock::time_point for times
&gt; instead of double - then you can use std::chrono::system_clock::now() to
&gt; create a time.
&gt; 
&gt; You can convert between time_points and NSDates using
&gt; 
&gt;     NSTimeInterval timeInterval =
&gt; std::chrono::duration_cast&lt;std::chrono::duration&lt;double&gt;&gt;(modifiedSince.
&gt; time_since_epoch()).count();
&gt;     NSDate *date = [NSDate dateWithTimeIntervalSince1970:timeInterval];
&gt; 
&gt; Does older versions of WebKit deal with the updated user defaults format?</span >

After talking with Jessie, older versions of WebKit do not deal with the updated user defaults format. I should think of a way to migrate the preferences.

<span class="quote">&gt; 
&gt; &gt; Source/WebCore/platform/win/SearchPopupMenuWin.cpp:96
&gt; &gt; +        if (CFGetTypeID(item) == CFArrayGetTypeID() &amp;&amp; CFArrayGetCount((CFArrayRef)item) == 2) {
&gt; 
&gt; Can use dynamic_cf_cast here.
&gt; 
&gt; &gt; Source/WebKit/mac/WebCoreSupport/SearchPopupMenuMac.mm:64
&gt; &gt; +        [items addObject:[NSArray arrayWithObjects:searchItem.first, [[NSNumber alloc] initWithDouble:searchItem.second], nil]];
&gt; 
&gt; I think you should use NSDate for the times instead.
&gt; 
&gt; &gt; Source/WebKit/mac/WebCoreSupport/SearchPopupMenuMac.mm:77
&gt; &gt; +        if ([item isKindOfClass:[NSArray class]] &amp;&amp; ((NSArray*)item).count == 2)
&gt; &gt; +            searchItems.append(std::make_pair((String)item[0], ((NSNumber*)item[1]).doubleValue));
&gt; 
&gt; You can use dynamic_objc_cast here.</span ></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>