- Revision
- 158372
- Author
- [email protected]
- Date
- 2013-10-31 11:05:25 -0700 (Thu, 31 Oct 2013)
Log Message
Change WebPage, WebPageProxy, WebPageCreationParameters to use ViewState
https://bugs.webkit.org/show_bug.cgi?id=123379
Reviewed by Darin Adler.
Visibility state of the Page should be stored and communicated consistently.
Remove individual visibility flags from WebPageProxy, WebPageCreationParameters,
and replace them with a ViewState, and add a ViewState member to WebPage.
Merge together all messages that convey and individual aspect of the ViewState.
Restructure WebPageProxy::viewStateDidChange to break the operation down into
three steps: 1) update m_viewState, 2) send the new ViewState to the WebProcess,
and 3) perform any further work necessary in the UIProcess.
This patch fixes a problem that if the web process crashes m_isVisible &
m_isInWindow in WebPageProxy were not updated, and could have held stale values
on reattach.
In WebPage, add a new message to update the entire ViewState - diff the prior
value against the new one to detect changes, call existing methods accordingly.
* Shared/ViewState.h:
- Add constants 'Reset', 'AllFlags'
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
- Removed boolean visibility flags, added viewState.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
- Constructor calls updateViewState to initialize m_viewState.
(WebKit::WebPageProxy::reattachToWebProcess):
- ViewStaet is not updated while detatched; recalculate.
(WebKit::WebPageProxy::initializeWebPage):
- m_isVisible -> isViewVisible()
(WebKit::WebPageProxy::updateViewState):
- Added, update m_viewState by querying the page client.
(WebKit::WebPageProxy::viewStateDidChange):
- Restructured to use m_viewState, reordered to combine messages.
(WebKit::WebPageProxy::creationParameters):
- Removed boolean visibility flags, added viewState.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isInWindow):
(WebKit::WebPageProxy::isViewVisible):
- Removed boolean visibility flags, added viewState.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
- initial state now passed as a ViewState.
(WebKit::WebPage::setIsInWindow):
- Remove code to send reply (this is handled by setViewState).
(WebKit::WebPage::setViewState):
- Set m_viewState - diff from prior & call methods to update.
* WebProcess/WebPage/WebPage.h:
- Added setViewState, m_viewState.
* WebProcess/WebPage/WebPage.messages.in:
- Add SetViewState, remove individual messages.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
- initial state now passed as a ViewState.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (158371 => 158372)
--- trunk/Source/WebKit2/ChangeLog 2013-10-31 18:03:41 UTC (rev 158371)
+++ trunk/Source/WebKit2/ChangeLog 2013-10-31 18:05:25 UTC (rev 158372)
@@ -1,3 +1,66 @@
+2013-10-31 Gavin Barraclough <[email protected]>
+
+ Change WebPage, WebPageProxy, WebPageCreationParameters to use ViewState
+ https://bugs.webkit.org/show_bug.cgi?id=123379
+
+ Reviewed by Darin Adler.
+
+ Visibility state of the Page should be stored and communicated consistently.
+
+ Remove individual visibility flags from WebPageProxy, WebPageCreationParameters,
+ and replace them with a ViewState, and add a ViewState member to WebPage.
+ Merge together all messages that convey and individual aspect of the ViewState.
+
+ Restructure WebPageProxy::viewStateDidChange to break the operation down into
+ three steps: 1) update m_viewState, 2) send the new ViewState to the WebProcess,
+ and 3) perform any further work necessary in the UIProcess.
+
+ This patch fixes a problem that if the web process crashes m_isVisible &
+ m_isInWindow in WebPageProxy were not updated, and could have held stale values
+ on reattach.
+
+ In WebPage, add a new message to update the entire ViewState - diff the prior
+ value against the new one to detect changes, call existing methods accordingly.
+
+ * Shared/ViewState.h:
+ - Add constants 'Reset', 'AllFlags'
+ * Shared/WebPageCreationParameters.cpp:
+ (WebKit::WebPageCreationParameters::encode):
+ (WebKit::WebPageCreationParameters::decode):
+ * Shared/WebPageCreationParameters.h:
+ - Removed boolean visibility flags, added viewState.
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::WebPageProxy):
+ - Constructor calls updateViewState to initialize m_viewState.
+ (WebKit::WebPageProxy::reattachToWebProcess):
+ - ViewStaet is not updated while detatched; recalculate.
+ (WebKit::WebPageProxy::initializeWebPage):
+ - m_isVisible -> isViewVisible()
+ (WebKit::WebPageProxy::updateViewState):
+ - Added, update m_viewState by querying the page client.
+ (WebKit::WebPageProxy::viewStateDidChange):
+ - Restructured to use m_viewState, reordered to combine messages.
+ (WebKit::WebPageProxy::creationParameters):
+ - Removed boolean visibility flags, added viewState.
+ * UIProcess/WebPageProxy.h:
+ (WebKit::WebPageProxy::isInWindow):
+ (WebKit::WebPageProxy::isViewVisible):
+ - Removed boolean visibility flags, added viewState.
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::WebPage):
+ - initial state now passed as a ViewState.
+ (WebKit::WebPage::setIsInWindow):
+ - Remove code to send reply (this is handled by setViewState).
+ (WebKit::WebPage::setViewState):
+ - Set m_viewState - diff from prior & call methods to update.
+ * WebProcess/WebPage/WebPage.h:
+ - Added setViewState, m_viewState.
+ * WebProcess/WebPage/WebPage.messages.in:
+ - Add SetViewState, remove individual messages.
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+ (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
+ - initial state now passed as a ViewState.
+
2013-10-30 Gavin Barraclough <[email protected]>
WebPageCreationParameters should be consistent in Window.open
Modified: trunk/Source/WebKit2/Shared/ViewState.h (158371 => 158372)
--- trunk/Source/WebKit2/Shared/ViewState.h 2013-10-31 18:03:41 UTC (rev 158371)
+++ trunk/Source/WebKit2/Shared/ViewState.h 2013-10-31 18:05:25 UTC (rev 158372)
@@ -36,7 +36,11 @@
IsInWindow = 1 << 3,
WindowIsVisible = 1 << 4
};
+
typedef unsigned Flags;
+
+ static const Flags NoFlags = 0;
+ static const Flags AllFlags = WindowIsActive | IsFocused | IsVisible | IsInWindow | WindowIsVisible;
};
} // namespace WebKit
Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp (158371 => 158372)
--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp 2013-10-31 18:03:41 UTC (rev 158371)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp 2013-10-31 18:05:25 UTC (rev 158372)
@@ -33,10 +33,7 @@
void WebPageCreationParameters::encode(CoreIPC::ArgumentEncoder& encoder) const
{
encoder << viewSize;
- encoder << isActive;
- encoder << isFocused;
- encoder << isVisible;
- encoder << isInWindow;
+ encoder << viewState;
encoder << store;
encoder.encodeEnum(drawingAreaType);
@@ -73,14 +70,8 @@
{
if (!decoder.decode(parameters.viewSize))
return false;
- if (!decoder.decode(parameters.isActive))
+ if (!decoder.decode(parameters.viewState))
return false;
- if (!decoder.decode(parameters.isFocused))
- return false;
- if (!decoder.decode(parameters.isVisible))
- return false;
- if (!decoder.decode(parameters.isInWindow))
- return false;
if (!decoder.decode(parameters.store))
return false;
if (!decoder.decodeEnum(parameters.drawingAreaType))
Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.h (158371 => 158372)
--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.h 2013-10-31 18:03:41 UTC (rev 158371)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.h 2013-10-31 18:05:25 UTC (rev 158372)
@@ -29,6 +29,7 @@
#include "DrawingAreaInfo.h"
#include "LayerTreeContext.h"
#include "SessionState.h"
+#include "ViewState.h"
#include "WebCoreArgumentCoders.h"
#include "WebPageGroupData.h"
#include "WebPreferencesStore.h"
@@ -55,10 +56,7 @@
WebCore::IntSize viewSize;
- bool isActive;
- bool isFocused;
- bool isVisible;
- bool isInWindow;
+ ViewState::Flags viewState;
WebPreferencesStore store;
DrawingAreaType drawingAreaType;
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (158371 => 158372)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-10-31 18:03:41 UTC (rev 158371)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-10-31 18:05:25 UTC (rev 158372)
@@ -238,8 +238,7 @@
, m_geolocationPermissionRequestManager(this)
, m_notificationPermissionRequestManager(this)
, m_estimatedProgress(0)
- , m_isInWindow(m_pageClient->isViewInWindow())
- , m_isVisible(m_pageClient->isViewVisible())
+ , m_viewState(ViewState::NoFlags)
, m_backForwardList(WebBackForwardList::create(this))
, m_loadStateAtProcessExit(WebFrameProxy::LoadStateFinished)
, m_temporarilyClosedComposition(false)
@@ -319,10 +318,12 @@
#endif
, m_scrollPinningBehavior(DoNotPin)
{
+ updateViewState();
+
platformInitialize();
#if ENABLE(PAGE_VISIBILITY_API)
- if (!m_isVisible)
+ if (isViewVisible())
m_visibilityState = PageVisibilityStateHidden;
#endif
#ifndef NDEBUG
@@ -470,6 +471,8 @@
ASSERT(!m_process->isValid());
ASSERT(!m_process->isLaunching());
+ updateViewState();
+
m_isValid = true;
if (m_process->context()->processModel() == ProcessModelSharedSecondaryProcess)
@@ -528,7 +531,7 @@
#if ENABLE(PAGE_VISIBILITY_API)
m_process->send(Messages::WebPage::SetVisibilityState(m_visibilityState, /* isInitialState */ true), m_pageID);
#elif ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
- m_process->send(Messages::WebPage::SetVisibilityState(m_isVisible ? PageVisibilityStateVisible : PageVisibilityStateHidden, /* isInitialState */ true), m_pageID);
+ m_process->send(Messages::WebPage::SetVisibilityState(isViewVisible() ? PageVisibilityStateVisible : PageVisibilityStateHidden, /* isInitialState */ true), m_pageID);
#endif
#if PLATFORM(MAC)
@@ -965,59 +968,56 @@
m_pageClient->scrollView(scrollRect, scrollOffset);
}
-void WebPageProxy::viewStateDidChange(ViewState::Flags mayHaveChanged, WantsReplyOrNot wantsReply)
+void WebPageProxy::updateViewState(ViewState::Flags flagsToUpdate)
{
- // Wants reply currently only applies to the IsInWindow flag, so check only this is set.
- ASSERT(wantsReply == WantsReplyOrNot::DoesNotWantReply || mayHaveChanged == ViewState::IsInWindow);
+ m_viewState &= ~flagsToUpdate;
+ if (flagsToUpdate & ViewState::WindowIsVisible && m_pageClient->isWindowVisible())
+ m_viewState |= ViewState::WindowIsVisible;
+ if (flagsToUpdate & ViewState::IsFocused && m_pageClient->isViewFocused())
+ m_viewState |= ViewState::IsFocused;
+ if (flagsToUpdate & ViewState::WindowIsActive && m_pageClient->isViewWindowActive())
+ m_viewState |= ViewState::WindowIsActive;
+ if (flagsToUpdate & ViewState::IsVisible && m_pageClient->isViewVisible())
+ m_viewState |= ViewState::IsVisible;
+ if (flagsToUpdate & ViewState::IsInWindow && m_pageClient->isViewInWindow())
+ m_viewState |= ViewState::IsInWindow;
+}
+void WebPageProxy::viewStateDidChange(ViewState::Flags mayHaveChanged, WantsReplyOrNot wantsReply)
+{
if (!isValid())
return;
- if (mayHaveChanged & ViewState::WindowIsVisible)
- process()->send(Messages::WebPage::SetWindowIsVisible(m_pageClient->isWindowVisible()), m_pageID);
+ // Record the prior view state, update the flags that may have changed,
+ // and check which flags have actually changed.
+ ViewState::Flags previousViewState = m_viewState;
+ updateViewState(mayHaveChanged);
+ ViewState::Flags changed = m_viewState ^ previousViewState;
- if (mayHaveChanged & ViewState::IsFocused)
- m_process->send(Messages::WebPage::SetFocused(m_pageClient->isViewFocused()), m_pageID);
+ if (changed)
+ m_process->send(Messages::WebPage::SetViewState(m_viewState, wantsReply == WantsReplyOrNot::DoesWantReply), m_pageID);
- // We want to make sure to update the active state while hidden, so if the view is hidden then update the active state
- // early (in case it becomes visible), and if the view was visible then update active state later (in case it hides).
- bool viewWasVisible = m_isVisible;
-
- if (mayHaveChanged & ViewState::WindowIsActive && !viewWasVisible)
- m_process->send(Messages::WebPage::SetActive(m_pageClient->isViewWindowActive()), m_pageID);
+ if (changed & ViewState::IsVisible) {
+ m_process->pageVisibilityChanged(this);
- if (mayHaveChanged & ViewState::IsVisible) {
- bool isVisible = m_pageClient->isViewVisible();
- if (isVisible != m_isVisible) {
- m_isVisible = isVisible;
- m_process->pageVisibilityChanged(this);
- m_process->send(Messages::WebPage::SetViewIsVisible(isVisible), m_pageID);
+ if (!isViewVisible()) {
+ // If we've started the responsiveness timer as part of telling the web process to update the backing store
+ // state, it might not send back a reply (since it won't paint anything if the web page is hidden) so we
+ // stop the unresponsiveness timer here.
+ m_process->responsivenessTimer()->stop();
+ }
- if (!m_isVisible) {
- // If we've started the responsiveness timer as part of telling the web process to update the backing store
- // state, it might not send back a reply (since it won't paint anything if the web page is hidden) so we
- // stop the unresponsiveness timer here.
- m_process->responsivenessTimer()->stop();
- }
-
-#if ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING) && !ENABLE(PAGE_VISIBILITY_API)
- PageVisibilityState visibilityState = m_isVisible ? PageVisibilityStateVisible : PageVisibilityStateHidden;
- m_process->send(Messages::WebPage::SetVisibilityState(visibilityState, false), m_pageID);
+#if ENABLE(PAGE_VISIBILITY_API)
+ m_visibilityState = isViewVisible() ? PageVisibilityStateVisible : PageVisibilityStateHidden;
+ m_process->send(Messages::WebPage::SetVisibilityState(m_visibilityState, false), m_pageID);
+#elif ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
+ PageVisibilityState visibilityState = isViewVisible() ? PageVisibilityStateVisible : PageVisibilityStateHidden;
+ m_process->send(Messages::WebPage::SetVisibilityState(visibilityState, false), m_pageID);
#endif
- }
}
- if (mayHaveChanged & ViewState::WindowIsActive && viewWasVisible)
- m_process->send(Messages::WebPage::SetActive(m_pageClient->isViewWindowActive()), m_pageID);
-
if (mayHaveChanged & ViewState::IsInWindow) {
- bool isInWindow = m_pageClient->isViewInWindow();
- if (m_isInWindow != isInWindow) {
- m_isInWindow = isInWindow;
- m_process->send(Messages::WebPage::SetIsInWindow(isInWindow, wantsReply == WantsReplyOrNot::DoesWantReply), m_pageID);
- }
-
- if (isInWindow) {
+ if (m_viewState & ViewState::IsInWindow) {
LayerHostingMode layerHostingMode = m_pageClient->viewLayerHostingMode();
if (m_layerHostingMode != layerHostingMode) {
m_layerHostingMode = layerHostingMode;
@@ -1033,18 +1033,6 @@
#endif
}
-#if ENABLE(PAGE_VISIBILITY_API)
- PageVisibilityState visibilityState = PageVisibilityStateHidden;
-
- if (m_isVisible)
- visibilityState = PageVisibilityStateVisible;
-
- if (visibilityState != m_visibilityState) {
- m_visibilityState = visibilityState;
- m_process->send(Messages::WebPage::SetVisibilityState(visibilityState, false), m_pageID);
- }
-#endif
-
updateBackingStoreDiscardableState();
}
@@ -3836,10 +3824,7 @@
void WebPageProxy::initializeCreationParameters()
{
m_creationParameters.viewSize = m_pageClient->viewSize();
- m_creationParameters.isActive = m_pageClient->isViewWindowActive();
- m_creationParameters.isFocused = m_pageClient->isViewFocused();
- m_creationParameters.isVisible = m_pageClient->isViewVisible();
- m_creationParameters.isInWindow = m_pageClient->isViewInWindow();
+ m_creationParameters.viewState = m_viewState;
m_creationParameters.drawingAreaType = m_drawingArea->type();
m_creationParameters.store = m_pageGroup->preferences()->store();
m_creationParameters.pageGroupData = m_pageGroup->data();
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (158371 => 158372)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2013-10-31 18:03:41 UTC (rev 158371)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2013-10-31 18:05:25 UTC (rev 158372)
@@ -326,11 +326,11 @@
enum class WantsReplyOrNot { DoesNotWantReply, DoesWantReply };
void viewStateDidChange(ViewState::Flags mayHaveChanged, WantsReplyOrNot = WantsReplyOrNot::DoesNotWantReply);
- bool isInWindow() const { return m_isInWindow; }
+ bool isInWindow() const { return m_viewState & ViewState::IsInWindow; }
void waitForDidUpdateInWindowState();
WebCore::IntSize viewSize() const;
- bool isViewVisible() const { return m_isVisible; }
+ bool isViewVisible() const { return m_viewState & ViewState::IsVisible; }
bool isViewWindowActive() const;
void executeEditCommand(const String& commandName);
@@ -756,6 +756,8 @@
void platformInitialize();
void initializeCreationParameters();
+ void updateViewState(ViewState::Flags flagsToUpdate = ViewState::AllFlags);
+
void resetState();
void resetStateAfterProcessExited();
@@ -1088,12 +1090,8 @@
double m_estimatedProgress;
- // Whether the web page is contained in a top-level window.
- bool m_isInWindow;
+ ViewState::Flags m_viewState;
- // Whether the page is visible; if the backing view is visible and inserted into a window.
- bool m_isVisible;
-
bool m_canGoBack;
bool m_canGoForward;
RefPtr<WebBackForwardList> m_backForwardList;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp (158371 => 158372)
--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp 2013-10-31 18:03:41 UTC (rev 158371)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp 2013-10-31 18:05:25 UTC (rev 158372)
@@ -60,7 +60,7 @@
, m_compositingAccordingToProxyMessages(false)
, m_layerTreeStateIsFrozen(false)
, m_wantsToExitAcceleratedCompositingMode(false)
- , m_isPaintingSuspended(!parameters.isVisible)
+ , m_isPaintingSuspended(!(parameters.viewState & ViewState::IsVisible))
, m_displayTimer(RunLoop::main(), this, &CoordinatedDrawingArea::displayTimerFired)
, m_exitCompositingTimer(RunLoop::main(), this, &CoordinatedDrawingArea::exitAcceleratedCompositingMode)
{
Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp (158371 => 158372)
--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp 2013-10-31 18:03:41 UTC (rev 158371)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp 2013-10-31 18:05:25 UTC (rev 158372)
@@ -57,7 +57,7 @@
, m_compositingAccordingToProxyMessages(false)
, m_layerTreeStateIsFrozen(false)
, m_wantsToExitAcceleratedCompositingMode(false)
- , m_isPaintingSuspended(!parameters.isVisible)
+ , m_isPaintingSuspended(!(parameters.viewState & ViewState::IsVisible))
, m_alwaysUseCompositing(false)
, m_displayTimer(RunLoop::main(), this, &DrawingAreaImpl::displayTimerFired)
, m_exitCompositingTimer(RunLoop::main(), this, &DrawingAreaImpl::exitAcceleratedCompositingMode)
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (158371 => 158372)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2013-10-31 18:03:41 UTC (rev 158371)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2013-10-31 18:05:25 UTC (rev 158372)
@@ -281,6 +281,7 @@
, m_maximumRenderingSuppressionToken(0)
, m_scrollPinningBehavior(DoNotPin)
, m_useThreadedScrolling(false)
+ , m_viewState(parameters.viewState)
{
ASSERT(m_pageID);
// FIXME: This is a non-ideal location for this Setting and
@@ -364,16 +365,17 @@
setMemoryCacheMessagesEnabled(parameters.areMemoryCacheClientCallsEnabled);
- setActive(parameters.isActive);
- setFocused(parameters.isFocused);
+ setActive(parameters.viewState & ViewState::WindowIsActive);
+ setFocused(parameters.viewState & ViewState::IsFocused);
// Page defaults to in-window, but setIsInWindow depends on it being a valid indicator of actually having been put into a window.
- if (!parameters.isInWindow)
+ bool isInWindow = parameters.viewState & ViewState::IsInWindow;
+ if (!isInWindow)
m_page->setIsInWindow(false);
else
WebProcess::shared().pageDidEnterWindow(m_pageID);
- setIsInWindow(parameters.isInWindow);
+ setIsInWindow(isInWindow);
setMinimumLayoutSize(parameters.minimumLayoutSize);
setAutoSizingShouldExpandToViewHeight(parameters.autoSizingShouldExpandToViewHeight);
@@ -1983,7 +1985,7 @@
return true;
}
-void WebPage::setIsInWindow(bool isInWindow, bool wantsDidUpdateViewInWindowState)
+void WebPage::setIsInWindow(bool isInWindow)
{
bool pageWasInWindow = m_page->isInWindow();
@@ -2011,8 +2013,30 @@
if (isInWindow)
layoutIfNeeded();
+}
- if (wantsDidUpdateViewInWindowState)
+void WebPage::setViewState(ViewState::Flags viewState, bool wantsDidUpdateInWindowState)
+{
+ ViewState::Flags changed = m_viewState ^ viewState;
+
+ // We want to make sure to update the active state while hidden, so if the view is hidden then update the active state
+ // early (in case it becomes visible), and if the view was visible then update active state later (in case it hides).
+ if (changed & ViewState::WindowIsVisible)
+ setWindowIsVisible(viewState & ViewState::WindowIsVisible);
+ if (changed & ViewState::IsFocused)
+ setFocused(viewState & ViewState::IsFocused);
+ if (changed & ViewState::WindowIsActive && !(m_viewState & ViewState::IsVisible))
+ setActive(viewState & ViewState::WindowIsActive);
+ if (changed & ViewState::IsVisible)
+ setViewIsVisible(viewState & ViewState::IsVisible);
+ if (changed & ViewState::WindowIsActive && m_viewState & ViewState::IsVisible)
+ setActive(viewState & ViewState::WindowIsActive);
+ if (changed & ViewState::IsInWindow)
+ setIsInWindow(viewState & ViewState::IsInWindow);
+
+ m_viewState = viewState;
+
+ if (wantsDidUpdateInWindowState)
m_sendDidUpdateInWindowStateTimer.startOneShot(0);
}
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (158371 => 158372)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2013-10-31 18:03:41 UTC (rev 158371)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2013-10-31 18:05:25 UTC (rev 158372)
@@ -49,6 +49,7 @@
#include "Plugin.h"
#include "SandboxExtension.h"
#include "ShareableBitmap.h"
+#include "ViewState.h"
#include "WebUndoStep.h"
#include <WebCore/DictationAlternative.h>
#include <WebCore/DragData.h>
@@ -683,7 +684,8 @@
void setWindowIsVisible(bool);
void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&);
void setWindowResizerSize(const WebCore::IntSize&);
- void setIsInWindow(bool isInWindow, bool wantsDidUpdateViewInWindowState = false);
+ void setIsInWindow(bool);
+ void setViewState(ViewState::Flags, bool wantsDidUpdateInWindowState);
void validateCommand(const String&, uint64_t);
void executeEditCommand(const String&);
@@ -991,6 +993,8 @@
WebCore::ScrollPinningBehavior m_scrollPinningBehavior;
bool m_useThreadedScrolling;
+
+ ViewState::Flags m_viewState;
};
} // namespace WebKit
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (158371 => 158372)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2013-10-31 18:03:41 UTC (rev 158371)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2013-10-31 18:05:25 UTC (rev 158372)
@@ -21,11 +21,8 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
messages -> WebPage LegacyReceiver {
- SetActive(bool active)
- SetFocused(bool focused)
- SetViewIsVisible(bool visible)
SetInitialFocus(bool forward, bool isKeyboardEventValid, WebKit::WebKeyboardEvent event)
- SetIsInWindow(bool isInWindow, bool wantsDidUpdateViewInWindowState)
+ SetViewState(unsigned viewState, bool wantsDidUpdateInWindowState)
SetDrawsBackground(bool drawsBackground)
SetDrawsTransparentBackground(bool drawsTransparentBackground)
@@ -245,8 +242,6 @@
CancelComposition()
#endif
- SetWindowIsVisible(bool windowIsVisible)
-
#if PLATFORM(MAC)
# Complex text input support for plug-ins.
SendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, String textInput)
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (158371 => 158372)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2013-10-31 18:03:41 UTC (rev 158371)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2013-10-31 18:05:25 UTC (rev 158372)
@@ -64,7 +64,7 @@
: DrawingArea(DrawingAreaTypeTiledCoreAnimation, webPage)
, m_layerTreeStateIsFrozen(false)
, m_layerFlushScheduler(this)
- , m_isPaintingSuspended(!parameters.isVisible)
+ , m_isPaintingSuspended(!(parameters.viewState & ViewState::IsVisible))
, m_clipsToExposedRect(false)
, m_updateIntrinsicContentSizeTimer(this, &TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeTimerFired)
{