<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [ThreadedCompositor] Opening the inspector in a window causes a crash."
href="https://bugs.webkit.org/show_bug.cgi?id=154444#c19">Comment # 19</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [ThreadedCompositor] Opening the inspector in a window causes a crash."
href="https://bugs.webkit.org/show_bug.cgi?id=154444">bug 154444</a>
from <span class="vcard"><a class="email" href="mailto:zan@falconsigh.net" title="Zan Dobersek <zan@falconsigh.net>"> <span class="fn">Zan Dobersek</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=281244&action=diff" name="attach_281244" title="Updated patch">attachment 281244</a> <a href="attachment.cgi?id=281244&action=edit" title="Updated patch">[details]</a></span>
Updated patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=281244&action=review">https://bugs.webkit.org/attachment.cgi?id=281244&action=review</a>
<span class="quote">> Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:69
> + ASSERT((handle && !m_nativeSurfaceHandle) || (m_nativeSurfaceHandle && !handle));</span >
That's a good assert. Could be simplified into an exclusive-or.
<span class="quote">> Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:76
> + // In case m_nativeSurfaceHandle is 0 now, tryEnsureGLContext will destroy the current context and will
> + // fail to ensure a new one, so that any previous operation pending and new ones will be discarded.
> + // In case m_nativeSurfaceHandle is a valid handle, tryEnsureGLContext will create a new context for the
> + // new handle.
> + tryEnsureGLContext();</span >
You're not 'ensuring' anything if the handle is null, and you are creating the context prematurely (and blocking the main thread) if the handle is not null.
I propose just nulling out m_context here if the handle is null, avoiding any changes to ThreadedCompositor::ensureGLContext().</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>