<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@webkit.org" title="Sam Weinig <sam@webkit.org>"> <span class="fn">Sam Weinig</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=272362&action=diff" name="attach_272362" title="Patch">attachment 272362</a> <a href="attachment.cgi?id=272362&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=272362&action=review">https://bugs.webkit.org/attachment.cgi?id=272362&action=review</a>
<span class="quote">> Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm:289
> + uint64_t contextId;
> +
> + auto addResult = m_videoElements.add(&videoElement, 0);
> + if (addResult.isNewEntry)
> + addResult.iterator->value = nextContextId();
> + contextId = addResult.iterator->value;</span >
There is new fangled way to do this using HashMap::ensure(..)
uint64_t contextId = m_videoElements.add(&videoElement, [&] { return nextContextId(); }).iterator->value;
or in two lines:
auto addResult = m_videoElements.add(&videoElement, [&] { return nextContextId(); });
auto contextId = addResult.iterator->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>