First in-window viewStateChange synchronously blocks despite not previously being...
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jul 2015 00:43:04 +0000 (00:43 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Jul 2015 00:43:04 +0000 (00:43 +0000)
commitab7787f1f8aa47a2f7482f963e42c8e1e9a9fe52
tree77a837ba31802b9b43a92fbffb84f6d5f6a633b4
parente191168bd9e99ec6f016e1829a1bcd7a887ea175
First in-window viewStateChange synchronously blocks despite not previously being in-window
https://bugs.webkit.org/show_bug.cgi?id=147344
<rdar://problem/22021772>

Reviewed by Simon Fraser.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateViewState):
(WebKit::WebPageProxy::dispatchViewStateChange):
The whole point of m_viewWasEverInWindow was so that we would not
synchronously wait when a view was added to a window for the first time,
only all subsequent times.

However, since m_viewWasEverInWindow was being set *before* being
checked in dispatchViewStateChange, we were always blocking. This is
a huge waste of main-thread time, because there's no reason to wait
for the first paint if you've never seen the view before (and shouldn't
expect it to have content).

Instead, set the flag after dispatching a view state change, so it becomes
"have we ever sent a view state with IsInWindow set" instead.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@187471 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebPageProxy.cpp