<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Add support for playbackControlsManager"
   href="https://bugs.webkit.org/show_bug.cgi?id=154742#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Add support for playbackControlsManager"
   href="https://bugs.webkit.org/show_bug.cgi?id=154742">bug 154742</a>
              from <span class="vcard"><a class="email" href="mailto:sam&#64;webkit.org" title="Sam Weinig &lt;sam&#64;webkit.org&gt;"> <span class="fn">Sam Weinig</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=272362&amp;action=diff" name="attach_272362" title="Patch">attachment 272362</a> <a href="attachment.cgi?id=272362&amp;action=edit" title="Patch">[details]</a></span>
Patch

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

<span class="quote">&gt; Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm:289
&gt; +    uint64_t contextId;
&gt; +
&gt; +    auto addResult = m_videoElements.add(&amp;videoElement, 0);
&gt; +    if (addResult.isNewEntry)
&gt; +        addResult.iterator-&gt;value = nextContextId();
&gt; +    contextId = addResult.iterator-&gt;value;</span >

There is new fangled way to do this using HashMap::ensure(..)

uint64_t contextId = m_videoElements.add(&amp;videoElement, [&amp;] { return nextContextId(); }).iterator-&gt;value;

or in two lines:

auto addResult = m_videoElements.add(&amp;videoElement, [&amp;] { return nextContextId(); });
auto contextId = addResult.iterator-&gt;value;</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>