Rename ViewState to ActivityState
authorbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Nov 2016 18:05:28 +0000 (18:05 +0000)
committerbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Nov 2016 18:05:28 +0000 (18:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=164254

Reviewed by Andreas Kling.

We plan to add a couple more flags to ViewState that aren't directly related to the view
itself - whether there is an ongoing page load, and whether whether there is audio playback.
This will allow viewState (now activityState) to fully drive throttling decisions.

Renaming this bitfield accordingly.
Source/WebCore:

* Modules/geolocation/GeolocationController.cpp:
(WebCore::GeolocationController::GeolocationController):
(WebCore::GeolocationController::~GeolocationController):
(WebCore::GeolocationController::activityStateDidChange):
(WebCore::GeolocationController::viewStateDidChange): Deleted.
* Modules/geolocation/GeolocationController.h:
* WebCore.xcodeproj/project.pbxproj:
* page/ActivityState.h: Copied from Source/WebCore/page/ViewState.h.
* page/ActivityStateChangeObserver.h: Copied from Source/WebCore/page/ViewStateChangeObserver.h.
(WebCore::ActivityStateChangeObserver::~ActivityStateChangeObserver):
(WebCore::ViewStateChangeObserver::~ViewStateChangeObserver): Deleted.
* page/FocusController.cpp:
(WebCore::FocusController::FocusController):
(WebCore::FocusController::setFocused):
(WebCore::FocusController::setActivityState):
(WebCore::FocusController::setActive):
(WebCore::FocusController::setViewState): Deleted.
* page/FocusController.h:
(WebCore::FocusController::isActive):
(WebCore::FocusController::isFocused):
(WebCore::FocusController::contentIsVisible):
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::setIsInWindow):
(WebCore::Page::addActivityStateChangeObserver):
(WebCore::Page::removeActivityStateChangeObserver):
(WebCore::Page::updateTimerThrottlingState):
(WebCore::Page::setActivityState):
(WebCore::Page::isVisibleAndActive):
(WebCore::Page::setIsVisible):
(WebCore::Page::addViewStateChangeObserver): Deleted.
(WebCore::Page::removeViewStateChangeObserver): Deleted.
(WebCore::Page::setViewState): Deleted.
* page/Page.h:
(WebCore::Page::isVisible):
(WebCore::Page::isInWindow):
* page/PageThrottler.h:
* page/ViewState.h: Removed.
* page/ViewStateChangeObserver.h: Removed.

Source/WebKit2:

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView didMoveToWindow]):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate):
(_WebKitWebViewBasePrivate::updateActivityStateTimerFired):
(webkitWebViewBaseScheduleUpdateActivityState):
(toplevelWindowFocusInEvent):
(toplevelWindowFocusOutEvent):
(toplevelWindowStateEvent):
(webkitWebViewBaseSetToplevelOnScreenWindow):
(webkitWebViewBaseMap):
(webkitWebViewBaseUnmap):
(webkitWebViewBaseSetFocus):
(webkitWebViewBaseIsInWindowActive):
(webkitWebViewBaseIsFocused):
(webkitWebViewBaseIsVisible):
(webkitWebViewBaseIsInWindow):
(_WebKitWebViewBasePrivate::updateViewStateTimerFired): Deleted.
(webkitWebViewBaseScheduleUpdateViewState): Deleted.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::becomeFirstResponder):
(WebKit::WebViewImpl::resignFirstResponder):
(WebKit::WebViewImpl::windowDidOrderOffScreen):
(WebKit::WebViewImpl::windowDidOrderOnScreen):
(WebKit::WebViewImpl::windowDidBecomeKey):
(WebKit::WebViewImpl::windowDidResignKey):
(WebKit::WebViewImpl::windowDidMiniaturize):
(WebKit::WebViewImpl::windowDidDeminiaturize):
(WebKit::WebViewImpl::windowDidChangeOcclusionState):
(WebKit::WebViewImpl::viewDidMoveToWindow):
(WebKit::WebViewImpl::viewDidHide):
(WebKit::WebViewImpl::viewDidUnhide):
(WebKit::WebViewImpl::activeSpaceDidChange):
(WebKit::WebViewImpl::endDeferringViewInWindowChanges):
(WebKit::WebViewImpl::endDeferringViewInWindowChangesSync):
(WebKit::WebViewImpl::prepareForMoveToWindow):
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::waitForDidUpdateActivityState):
(WebKit::DrawingAreaProxy::waitForDidUpdateViewState): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::setSuppressVisibilityUpdates):
(WebKit::WebPageProxy::updateActivityState):
(WebKit::WebPageProxy::activityStateDidChange):
(WebKit::WebPageProxy::dispatchActivityStateChange):
(WebKit::WebPageProxy::updateThrottleState):
(WebKit::WebPageProxy::waitForDidUpdateActivityState):
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
(WebKit::WebPageProxy::updateViewState): Deleted.
(WebKit::WebPageProxy::viewStateDidChange): Deleted.
(WebKit::WebPageProxy::dispatchViewStateChange): Deleted.
(WebKit::WebPageProxy::waitForDidUpdateViewState): Deleted.
(WebKit::WebPageProxy::installViewStateChangeCompletionHandler): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isInWindow):
(WebKit::WebPageProxy::didUpdateActivityState):
(WebKit::WebPageProxy::isViewVisible):
(WebKit::WebPageProxy::didUpdateViewState): Deleted.
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::windowServerConnectionStateChanged):
* UIProcess/efl/WebView.cpp:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _applicationDidEnterBackground]):
(-[WKContentView _applicationWillEnterForeground]):
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView _applicationDidEnterBackground]):
(-[WKPDFView _applicationWillEnterForeground]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
(WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
(WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState): Deleted.
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
(WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateViewState): Deleted.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::activityStateDidChange):
(WebKit::PluginView::viewStateDidChange): Deleted.
* WebProcess/Plugins/PluginView.h:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::activityStateDidChange):
(WebKit::AcceleratedDrawingArea::viewStateDidChange): Deleted.
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::activityStateDidChange):
(WebKit::DrawingArea::viewStateDidChange): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_userInterfaceLayoutDirection):
(WebKit::WebPage::reinitializeWebPage):
(WebKit::WebPage::updateIsInWindow):
(WebKit::WebPage::setActivityState):
(WebKit::WebPage::setViewState): Deleted.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::isVisible):
(WebKit::WebPage::isVisibleOrOccluded):
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
(WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange): Deleted.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
(WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired):
(WebKit::TiledCoreAnimationDrawingArea::viewStateDidChange): Deleted.
(WebKit::TiledCoreAnimationDrawingArea::didUpdateViewStateTimerFired): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208225 268f45cc-cd09-0410-ab3c-d52691b4dbfc

42 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/geolocation/GeolocationController.cpp
Source/WebCore/Modules/geolocation/GeolocationController.h
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/page/ActivityState.h [moved from Source/WebCore/page/ViewState.h with 98% similarity]
Source/WebCore/page/ActivityStateChangeObserver.h [moved from Source/WebCore/page/ViewStateChangeObserver.h with 86% similarity]
Source/WebCore/page/FocusController.cpp
Source/WebCore/page/FocusController.h
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/page/PageThrottler.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPageCreationParameters.cpp
Source/WebKit2/Shared/WebPageCreationParameters.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm
Source/WebKit2/UIProcess/DrawingAreaProxy.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/WebProcessProxy.cpp
Source/WebKit2/UIProcess/efl/WebView.cpp
Source/WebKit2/UIProcess/ios/WKContentView.mm
Source/WebKit2/UIProcess/ios/WKPDFView.mm
Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h
Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm
Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h
Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/Plugins/PluginView.h
Source/WebKit2/WebProcess/WebPage/AcceleratedDrawingArea.cpp
Source/WebKit2/WebProcess/WebPage/AcceleratedDrawingArea.h
Source/WebKit2/WebProcess/WebPage/DrawingArea.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

index 143ad48..b7ae8d2 100644 (file)
@@ -1,3 +1,55 @@
+2016-10-31  Gavin Barraclough  <barraclough@apple.com>
+
+        Rename ViewState to ActivityState
+        https://bugs.webkit.org/show_bug.cgi?id=164254
+
+        Reviewed by Andreas Kling.
+
+        We plan to add a couple more flags to ViewState that aren't directly related to the view
+        itself - whether there is an ongoing page load, and whether whether there is audio playback.
+        This will allow viewState (now activityState) to fully drive throttling decisions.
+
+        Renaming this bitfield accordingly.
+        * Modules/geolocation/GeolocationController.cpp:
+        (WebCore::GeolocationController::GeolocationController):
+        (WebCore::GeolocationController::~GeolocationController):
+        (WebCore::GeolocationController::activityStateDidChange):
+        (WebCore::GeolocationController::viewStateDidChange): Deleted.
+        * Modules/geolocation/GeolocationController.h:
+        * WebCore.xcodeproj/project.pbxproj:
+        * page/ActivityState.h: Copied from Source/WebCore/page/ViewState.h.
+        * page/ActivityStateChangeObserver.h: Copied from Source/WebCore/page/ViewStateChangeObserver.h.
+        (WebCore::ActivityStateChangeObserver::~ActivityStateChangeObserver):
+        (WebCore::ViewStateChangeObserver::~ViewStateChangeObserver): Deleted.
+        * page/FocusController.cpp:
+        (WebCore::FocusController::FocusController):
+        (WebCore::FocusController::setFocused):
+        (WebCore::FocusController::setActivityState):
+        (WebCore::FocusController::setActive):
+        (WebCore::FocusController::setViewState): Deleted.
+        * page/FocusController.h:
+        (WebCore::FocusController::isActive):
+        (WebCore::FocusController::isFocused):
+        (WebCore::FocusController::contentIsVisible):
+        * page/Page.cpp:
+        (WebCore::Page::Page):
+        (WebCore::Page::setIsInWindow):
+        (WebCore::Page::addActivityStateChangeObserver):
+        (WebCore::Page::removeActivityStateChangeObserver):
+        (WebCore::Page::updateTimerThrottlingState):
+        (WebCore::Page::setActivityState):
+        (WebCore::Page::isVisibleAndActive):
+        (WebCore::Page::setIsVisible):
+        (WebCore::Page::addViewStateChangeObserver): Deleted.
+        (WebCore::Page::removeViewStateChangeObserver): Deleted.
+        (WebCore::Page::setViewState): Deleted.
+        * page/Page.h:
+        (WebCore::Page::isVisible):
+        (WebCore::Page::isInWindow):
+        * page/PageThrottler.h:
+        * page/ViewState.h: Removed.
+        * page/ViewStateChangeObserver.h: Removed.
+
 2016-11-01  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r208100.
index 0a10a8f..9e7a085 100644 (file)
@@ -38,14 +38,14 @@ GeolocationController::GeolocationController(Page& page, GeolocationClient& clie
     : m_page(page)
     , m_client(client)
 {
-    m_page.addViewStateChangeObserver(*this);
+    m_page.addActivityStateChangeObserver(*this);
 }
 
 GeolocationController::~GeolocationController()
 {
     ASSERT(m_observers.isEmpty());
 
-    // NOTE: We don't have to remove ourselves from page's ViewStateChangeObserver set, since
+    // NOTE: We don't have to remove ourselves from page's ActivityStateChangeObserver set, since
     // we are supplement of the Page, and our destructor getting called means the page is being
     // torn down.
 
@@ -124,12 +124,12 @@ GeolocationPosition* GeolocationController::lastPosition()
     return m_client.lastPosition();
 }
 
-void GeolocationController::viewStateDidChange(ViewState::Flags oldViewState, ViewState::Flags newViewState)
+void GeolocationController::activityStateDidChange(ActivityState::Flags oldActivityState, ActivityState::Flags newActivityState)
 {
     // Toggle GPS based on page visibility to save battery.
-    ViewState::Flags changed = oldViewState ^ newViewState;
-    if (changed & ViewState::IsVisible && !m_observers.isEmpty()) {
-        if (newViewState & ViewState::IsVisible)
+    ActivityState::Flags changed = oldActivityState ^ newActivityState;
+    if (changed & ActivityState::IsVisible && !m_observers.isEmpty()) {
+        if (newActivityState & ActivityState::IsVisible)
             m_client.startUpdating();
         else
             m_client.stopUpdating();
index b0d6666..113b2ab 100644 (file)
@@ -28,9 +28,9 @@
 
 #if ENABLE(GEOLOCATION)
 
+#include "ActivityStateChangeObserver.h"
 #include "Geolocation.h"
 #include "Page.h"
-#include "ViewStateChangeObserver.h"
 #include <wtf/HashSet.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/RefPtr.h>
@@ -42,7 +42,7 @@ class GeolocationError;
 class GeolocationPosition;
 class Page;
 
-class GeolocationController : public Supplement<Page>, private ViewStateChangeObserver {
+class GeolocationController : public Supplement<Page>, private ActivityStateChangeObserver {
     WTF_MAKE_FAST_ALLOCATED;
     WTF_MAKE_NONCOPYABLE(GeolocationController);
 public:
@@ -69,7 +69,7 @@ private:
     Page& m_page;
     GeolocationClient& m_client;
 
-    void viewStateDidChange(ViewState::Flags oldViewState, ViewState::Flags newViewState) override;
+    void activityStateDidChange(ActivityState::Flags oldActivityState, ActivityState::Flags newActivityState) override;
 
     RefPtr<GeolocationPosition> m_lastPosition;
 
index 2462d4b..2405dac 100644 (file)
                724ED32C1A3A7E5400F5F13C /* EXTBlendMinMax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 724ED3291A3A7E5400F5F13C /* EXTBlendMinMax.cpp */; };
                724ED3311A3A8B2300F5F13C /* JSEXTBlendMinMax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 724ED32F1A3A8B2300F5F13C /* JSEXTBlendMinMax.cpp */; };
                724ED3321A3A8B2300F5F13C /* JSEXTBlendMinMax.h in Headers */ = {isa = PBXBuildFile; fileRef = 724ED3301A3A8B2300F5F13C /* JSEXTBlendMinMax.h */; };
+               724EE5501DC80D7F00A91FFB /* ActivityState.h in Headers */ = {isa = PBXBuildFile; fileRef = 724EE54E1DC7F25B00A91FFB /* ActivityState.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               724EE5511DC80D8400A91FFB /* ActivityStateChangeObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 724EE54F1DC7F25B00A91FFB /* ActivityStateChangeObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
                727AFED41A2EA6AE000442E8 /* EXTsRGB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 727AFED11A2EA6A0000442E8 /* EXTsRGB.cpp */; };
                72E417631A2E8D2F004C562A /* JSEXTsRGB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72E417611A2E8D2F004C562A /* JSEXTsRGB.cpp */; };
                72F1ADA21A3904DC00014E18 /* EXTFragDepth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72F1AD9F1A3904C300014E18 /* EXTFragDepth.cpp */; };
                7CD0BA051B8F79C9005CEBBE /* ActiveDOMCallbackMicrotask.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CD0BA031B8F79C9005CEBBE /* ActiveDOMCallbackMicrotask.h */; };
                7CD494CC1A86EB1D000A87EC /* RenderAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CD494CA1A86EB1D000A87EC /* RenderAttachment.cpp */; };
                7CD494CD1A86EB1D000A87EC /* RenderAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CD494CB1A86EB1D000A87EC /* RenderAttachment.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               7CDEEE1E197610D700E352CD /* ViewStateChangeObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CDEEE1D197610D700E352CD /* ViewStateChangeObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7CE68344192143A800F4D928 /* UserMessageHandlerDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CE68342192143A800F4D928 /* UserMessageHandlerDescriptor.cpp */; };
                7CE68345192143A800F4D928 /* UserMessageHandlerDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE68343192143A800F4D928 /* UserMessageHandlerDescriptor.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7CE683471921821500F4D928 /* UserMessageHandlerDescriptorTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE683461921821500F4D928 /* UserMessageHandlerDescriptorTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
                862F12A018C1DD02005C54AF /* HysteresisActivity.h in Headers */ = {isa = PBXBuildFile; fileRef = 862F129F18C1DCE4005C54AF /* HysteresisActivity.h */; settings = {ATTRIBUTES = (Private, ); }; };
                86512EDE154A2AEF00A90426 /* PerformanceResourceTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86512EDB154A2AEE00A90426 /* PerformanceResourceTiming.cpp */; };
                86512EDF154A2AEF00A90426 /* PerformanceResourceTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 86512EDC154A2AEF00A90426 /* PerformanceResourceTiming.h */; };
-               8678D0BB1878E891003ABDE6 /* ViewState.h in Headers */ = {isa = PBXBuildFile; fileRef = 8678D0BA1878E810003ABDE6 /* ViewState.h */; settings = {ATTRIBUTES = (Private, ); }; };
                868160D418766A0A0021E79D /* UserActivity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 868160D1187669C40021E79D /* UserActivity.cpp */; };
                868160D518766A0E0021E79D /* UserActivityMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 868160D3187669E70021E79D /* UserActivityMac.mm */; };
                868160D618766A130021E79D /* UserActivity.h in Headers */ = {isa = PBXBuildFile; fileRef = 868160D2187669C40021E79D /* UserActivity.h */; settings = {ATTRIBUTES = (Private, ); }; };
                724ED32B1A3A7E5400F5F13C /* EXTBlendMinMax.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EXTBlendMinMax.idl; sourceTree = "<group>"; };
                724ED32F1A3A8B2300F5F13C /* JSEXTBlendMinMax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEXTBlendMinMax.cpp; sourceTree = "<group>"; };
                724ED3301A3A8B2300F5F13C /* JSEXTBlendMinMax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEXTBlendMinMax.h; sourceTree = "<group>"; };
+               724EE54E1DC7F25B00A91FFB /* ActivityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActivityState.h; sourceTree = "<group>"; };
+               724EE54F1DC7F25B00A91FFB /* ActivityStateChangeObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActivityStateChangeObserver.h; sourceTree = "<group>"; };
                727AFED11A2EA6A0000442E8 /* EXTsRGB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EXTsRGB.cpp; sourceTree = "<group>"; };
                727AFED21A2EA6A0000442E8 /* EXTsRGB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EXTsRGB.h; sourceTree = "<group>"; };
                727AFED31A2EA6A0000442E8 /* EXTsRGB.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EXTsRGB.idl; sourceTree = "<group>"; };
                7CD0BA031B8F79C9005CEBBE /* ActiveDOMCallbackMicrotask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActiveDOMCallbackMicrotask.h; sourceTree = "<group>"; };
                7CD494CA1A86EB1D000A87EC /* RenderAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderAttachment.cpp; sourceTree = "<group>"; };
                7CD494CB1A86EB1D000A87EC /* RenderAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderAttachment.h; sourceTree = "<group>"; };
-               7CDEEE1D197610D700E352CD /* ViewStateChangeObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewStateChangeObserver.h; sourceTree = "<group>"; };
                7CE68342192143A800F4D928 /* UserMessageHandlerDescriptor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserMessageHandlerDescriptor.cpp; sourceTree = "<group>"; };
                7CE68343192143A800F4D928 /* UserMessageHandlerDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserMessageHandlerDescriptor.h; sourceTree = "<group>"; };
                7CE683461921821500F4D928 /* UserMessageHandlerDescriptorTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserMessageHandlerDescriptorTypes.h; sourceTree = "<group>"; };
                86512EDB154A2AEE00A90426 /* PerformanceResourceTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceResourceTiming.cpp; sourceTree = "<group>"; };
                86512EDC154A2AEF00A90426 /* PerformanceResourceTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceResourceTiming.h; sourceTree = "<group>"; };
                86512EDD154A2AEF00A90426 /* PerformanceResourceTiming.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PerformanceResourceTiming.idl; sourceTree = "<group>"; };
-               8678D0BA1878E810003ABDE6 /* ViewState.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewState.h; sourceTree = "<group>"; };
                868160D1187669C40021E79D /* UserActivity.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UserActivity.cpp; sourceTree = "<group>"; };
                868160D2187669C40021E79D /* UserActivity.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UserActivity.h; sourceTree = "<group>"; };
                868160D3187669E70021E79D /* UserActivityMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = UserActivityMac.mm; sourceTree = "<group>"; };
                                18A6CD6F0D8F2025001DC3CE /* ios */,
                                93C09A820B064F05005ABD4D /* mac */,
                                1AF62EE114DA22A70041556C /* scrolling */,
+                               724EE54E1DC7F25B00A91FFB /* ActivityState.h */,
+                               724EE54F1DC7F25B00A91FFB /* ActivityStateChangeObserver.h */,
                                BCF48CE61370D114004E87D6 /* AdjustViewSizeOrNot.h */,
                                CEDA12D6152CA1CB00D9E08D /* AlternativeTextClient.h */,
                                45830D4B1679B4F800ACF8C3 /* AutoscrollController.cpp */,
                                F513A3E915FF4841001526DB /* ValidationMessageClient.h */,
                                26F9A83618A046AC00AEB88A /* ViewportConfiguration.cpp */,
                                26F9A83718A046AC00AEB88A /* ViewportConfiguration.h */,
-                               8678D0BA1878E810003ABDE6 /* ViewState.h */,
-                               7CDEEE1D197610D700E352CD /* ViewStateChangeObserver.h */,
                                1AF4CEEB18BC3C1B00BC2D34 /* VisitedLinkStore.cpp */,
                                1ABA7FFF1897341200DCE9D6 /* VisitedLinkStore.h */,
                                BE983D95052A2E0A00892D85 /* WebCoreKeyboardUIMode.h */,
                                C90843D01B18E47D00B68564 /* MediaRemoteControls.h in Headers */,
                                CD8ACA8F1D23971900ECC59E /* MediaRemoteSoftLink.h in Headers */,
                                CD8ACA8B1D23946400ECC59E /* MediaRemoteSPI.h in Headers */,
+                               724EE5511DC80D8400A91FFB /* ActivityStateChangeObserver.h in Headers */,
                                CEEFCD7A19DB31F7003876D7 /* MediaResourceLoader.h in Headers */,
                                1BF9DB3C1D3973AD0026AEB7 /* MediaSample.h in Headers */,
                                1B124D8D1D380B7000ECDFB0 /* MediaSampleAVFObjC.h in Headers */,
                                CEF418CF1179678C009D112C /* ViewportArguments.h in Headers */,
                                26F9A83918A046AC00AEB88A /* ViewportConfiguration.h in Headers */,
                                3FFFF9AE159D9B060020BBD5 /* ViewportStyleResolver.h in Headers */,
-                               8678D0BB1878E891003ABDE6 /* ViewState.h in Headers */,
-                               7CDEEE1E197610D700E352CD /* ViewStateChangeObserver.h in Headers */,
                                93309E20099E64920056E581 /* VisiblePosition.h in Headers */,
                                A883DF280F3D045D00F19BF6 /* VisibleSelection.h in Headers */,
                                93309E1E099E64920056E581 /* VisibleUnits.h in Headers */,
                                B10B6980140C174000BC1C26 /* WebVTTToken.h in Headers */,
                                B10B6982140C174000BC1C26 /* WebVTTTokenizer.h in Headers */,
                                CD8203101395ACE700F956C6 /* WebWindowAnimation.h in Headers */,
+                               724EE5501DC80D7F00A91FFB /* ActivityState.h in Headers */,
                                F55B3DE01251F12D003EF269 /* WeekInputType.h in Headers */,
                                85031B510A44EFC700F992E0 /* WheelEvent.h in Headers */,
                                2EBBC3D81B65988300F5253D /* WheelEventDeltaFilter.h in Headers */,
similarity index 98%
rename from Source/WebCore/page/ViewState.h
rename to Source/WebCore/page/ActivityState.h
index 991b22c..8875e22 100644 (file)
@@ -27,7 +27,7 @@
 
 namespace WebCore {
 
-struct ViewState {
+struct ActivityState {
     enum {
         WindowIsActive = 1 << 0,
         IsFocused = 1 << 1,
 
 #pragma once
 
-#include "ViewState.h"
+#include "ActivityState.h"
 
 namespace WebCore {
 
-class ViewStateChangeObserver {
+class ActivityStateChangeObserver {
 public:
-    virtual ~ViewStateChangeObserver()
+    virtual ~ActivityStateChangeObserver()
     {
     }
     
-    virtual void viewStateDidChange(ViewState::Flags oldViewState, ViewState::Flags newViewState) = 0;
+    virtual void activityStateDidChange(ActivityState::Flags oldActivityState, ActivityState::Flags newActivityState) = 0;
 };
 
 } // namespace WebCore
index 34b7c63..d1cbab6 100644 (file)
@@ -313,10 +313,10 @@ static inline int shadowAdjustedTabIndex(Element& element, KeyboardEvent& event)
     return element.tabIndex();
 }
 
-FocusController::FocusController(Page& page, ViewState::Flags viewState)
+FocusController::FocusController(Page& page, ActivityState::Flags activityState)
     : m_page(page)
     , m_isChangingFocusedFrame(false)
-    , m_viewState(viewState)
+    , m_activityState(activityState)
     , m_focusRepaintTimer(*this, &FocusController::focusRepaintTimerFired)
 {
 }
@@ -359,7 +359,7 @@ Frame& FocusController::focusedOrMainFrame() const
 
 void FocusController::setFocused(bool focused)
 {
-    m_page.setViewState(focused ? m_viewState | ViewState::IsFocused : m_viewState & ~ViewState::IsFocused);
+    m_page.setActivityState(focused ? m_activityState | ActivityState::IsFocused : m_activityState & ~ActivityState::IsFocused);
 }
 
 void FocusController::setFocusedInternal(bool focused)
@@ -825,23 +825,23 @@ bool FocusController::setFocusedElement(Element* element, PassRefPtr<Frame> newF
     return true;
 }
 
-void FocusController::setViewState(ViewState::Flags viewState)
+void FocusController::setActivityState(ActivityState::Flags activityState)
 {
-    ViewState::Flags changed = m_viewState ^ viewState;
-    m_viewState = viewState;
-
-    if (changed & ViewState::IsFocused)
-        setFocusedInternal(viewState & ViewState::IsFocused);
-    if (changed & ViewState::WindowIsActive) {
-        setActiveInternal(viewState & ViewState::WindowIsActive);
-        if (changed & ViewState::IsVisible)
-            setIsVisibleAndActiveInternal(viewState & ViewState::WindowIsActive);
+    ActivityState::Flags changed = m_activityState ^ activityState;
+    m_activityState = activityState;
+
+    if (changed & ActivityState::IsFocused)
+        setFocusedInternal(activityState & ActivityState::IsFocused);
+    if (changed & ActivityState::WindowIsActive) {
+        setActiveInternal(activityState & ActivityState::WindowIsActive);
+        if (changed & ActivityState::IsVisible)
+            setIsVisibleAndActiveInternal(activityState & ActivityState::WindowIsActive);
     }
 }
 
 void FocusController::setActive(bool active)
 {
-    m_page.setViewState(active ? m_viewState | ViewState::WindowIsActive : m_viewState & ~ViewState::WindowIsActive);
+    m_page.setActivityState(active ? m_activityState | ActivityState::WindowIsActive : m_activityState & ~ActivityState::WindowIsActive);
 }
 
 void FocusController::setActiveInternal(bool active)
index 64fd4d0..ecbe396 100644 (file)
 
 #pragma once
 
+#include "ActivityState.h"
 #include "FocusDirection.h"
 #include "LayoutRect.h"
 #include "Timer.h"
-#include "ViewState.h"
 #include <wtf/Forward.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/RefPtr.h>
@@ -51,7 +51,7 @@ class TreeScope;
 class FocusController {
     WTF_MAKE_NONCOPYABLE(FocusController); WTF_MAKE_FAST_ALLOCATED;
 public:
-    explicit FocusController(Page&, ViewState::Flags);
+    explicit FocusController(Page&, ActivityState::Flags);
 
     WEBCORE_EXPORT void setFocusedFrame(PassRefPtr<Frame>);
     Frame* focusedFrame() const { return m_focusedFrame.get(); }
@@ -62,15 +62,15 @@ public:
 
     WEBCORE_EXPORT bool setFocusedElement(Element*, PassRefPtr<Frame>, FocusDirection = FocusDirectionNone);
 
-    void setViewState(ViewState::Flags);
+    void setActivityState(ActivityState::Flags);
 
     WEBCORE_EXPORT void setActive(bool);
-    bool isActive() const { return m_viewState & ViewState::WindowIsActive; }
+    bool isActive() const { return m_activityState & ActivityState::WindowIsActive; }
 
     WEBCORE_EXPORT void setFocused(bool);
-    bool isFocused() const { return m_viewState & ViewState::IsFocused; }
+    bool isFocused() const { return m_activityState & ActivityState::IsFocused; }
 
-    bool contentIsVisible() const { return m_viewState & ViewState::IsVisible; }
+    bool contentIsVisible() const { return m_activityState & ActivityState::IsVisible; }
 
     // These methods are used in WebCore/bindings/objc/DOM.mm.
     WEBCORE_EXPORT Element* nextFocusableElement(Node&);
@@ -119,7 +119,7 @@ private:
     Page& m_page;
     RefPtr<Frame> m_focusedFrame;
     bool m_isChangingFocusedFrame;
-    ViewState::Flags m_viewState;
+    ActivityState::Flags m_activityState;
 
     Timer m_focusRepaintTimer;
     double m_focusSetTime;
index a898092..44d794d 100644 (file)
@@ -20,6 +20,7 @@
 #include "config.h"
 #include "Page.h"
 
+#include "ActivityStateChangeObserver.h"
 #include "AlternativeTextClient.h"
 #include "AnimationController.h"
 #include "ApplicationCacheStorage.h"
@@ -94,7 +95,6 @@
 #include "TextResourceDecoder.h"
 #include "UserContentProvider.h"
 #include "UserInputBridge.h"
-#include "ViewStateChangeObserver.h"
 #include "VisitedLinkState.h"
 #include "VisitedLinkStore.h"
 #include "VoidCallback.h"
@@ -156,7 +156,7 @@ static void networkStateChanged(bool isOnLine)
     }
 }
 
-static const ViewState::Flags PageInitialViewState = ViewState::IsVisible | ViewState::IsInWindow;
+static const ActivityState::Flags PageInitialActivityState = ActivityState::IsVisible | ActivityState::IsInWindow;
 
 Page::Page(PageConfiguration&& pageConfiguration)
     : m_chrome(std::make_unique<Chrome>(*this, *pageConfiguration.chromeClient))
@@ -164,7 +164,7 @@ Page::Page(PageConfiguration&& pageConfiguration)
 #if ENABLE(DRAG_SUPPORT)
     , m_dragController(std::make_unique<DragController>(*this, *pageConfiguration.dragClient))
 #endif
-    , m_focusController(std::make_unique<FocusController>(*this, PageInitialViewState))
+    , m_focusController(std::make_unique<FocusController>(*this, PageInitialActivityState))
 #if ENABLE(CONTEXT_MENUS)
     , m_contextMenuController(std::make_unique<ContextMenuController>(*this, *pageConfiguration.contextMenuClient))
 #endif
@@ -214,7 +214,7 @@ Page::Page(PageConfiguration&& pageConfiguration)
     , m_timerAlignmentIntervalIncreaseTimer(*this, &Page::timerAlignmentIntervalIncreaseTimerFired)
     , m_isEditable(false)
     , m_isPrerender(false)
-    , m_viewState(PageInitialViewState)
+    , m_activityState(PageInitialActivityState)
     , m_requestedLayoutMilestones(0)
     , m_headerHeight(0)
     , m_footerHeight(0)
@@ -1013,7 +1013,7 @@ unsigned Page::pageCount() const
 
 void Page::setIsInWindow(bool isInWindow)
 {
-    setViewState(isInWindow ? m_viewState | ViewState::IsInWindow : m_viewState & ~ViewState::IsInWindow);
+    setActivityState(isInWindow ? m_activityState | ActivityState::IsInWindow : m_activityState & ~ActivityState::IsInWindow);
 }
 
 void Page::setIsInWindowInternal(bool isInWindow)
@@ -1027,14 +1027,14 @@ void Page::setIsInWindowInternal(bool isInWindow)
         resumeAnimatingImages();
 }
 
-void Page::addViewStateChangeObserver(ViewStateChangeObserver& observer)
+void Page::addActivityStateChangeObserver(ActivityStateChangeObserver& observer)
 {
-    m_viewStateChangeObservers.add(&observer);
+    m_activityStateChangeObservers.add(&observer);
 }
 
-void Page::removeViewStateChangeObserver(ViewStateChangeObserver& observer)
+void Page::removeActivityStateChangeObserver(ActivityStateChangeObserver& observer)
 {
-    m_viewStateChangeObservers.remove(&observer);
+    m_activityStateChangeObservers.remove(&observer);
 }
 
 void Page::suspendScriptedAnimations()
@@ -1220,14 +1220,14 @@ void Page::hiddenPageDOMTimerThrottlingStateChanged()
 void Page::updateTimerThrottlingState()
 {
     // Timer throttling disabled if page is visually active, or disabled by setting.
-    if (!m_settings->hiddenPageDOMTimerThrottlingEnabled() || !(m_viewState & ViewState::IsVisuallyIdle)) {
+    if (!m_settings->hiddenPageDOMTimerThrottlingEnabled() || !(m_activityState & ActivityState::IsVisuallyIdle)) {
         setTimerThrottlingState(TimerThrottlingState::Disabled);
         return;
     }
 
     // If the page is visible (but idle), there is any activity (loading, media playing, etc), or per setting,
     // we allow timer throttling, but not increasing timer throttling.
-    if (!m_settings->hiddenPageDOMTimerThrottlingAutoIncreases() || m_viewState & ViewState::IsVisible || m_pageThrottler.activityState()) {
+    if (!m_settings->hiddenPageDOMTimerThrottlingAutoIncreases() || m_activityState & ActivityState::IsVisible || m_pageThrottler.activityState()) {
         setTimerThrottlingState(TimerThrottlingState::Enabled);
         return;
     }
@@ -1438,31 +1438,31 @@ void Page::resumeAnimatingImages()
         view->resumeVisibleImageAnimationsIncludingSubframes();
 }
 
-void Page::setViewState(ViewState::Flags viewState)
+void Page::setActivityState(ActivityState::Flags activityState)
 {
-    ViewState::Flags changed = m_viewState ^ viewState;
+    ActivityState::Flags changed = m_activityState ^ activityState;
     if (!changed)
         return;
 
-    ViewState::Flags oldViewState = m_viewState;
+    ActivityState::Flags oldActivityState = m_activityState;
 
     bool wasVisibleAndActive = isVisibleAndActive();
-    m_viewState = viewState;
+    m_activityState = activityState;
 
-    m_focusController->setViewState(viewState);
+    m_focusController->setActivityState(activityState);
 
-    if (changed & ViewState::IsVisible)
-        setIsVisibleInternal(viewState & ViewState::IsVisible);
-    if (changed & ViewState::IsInWindow)
-        setIsInWindowInternal(viewState & ViewState::IsInWindow);
-    if (changed & ViewState::IsVisuallyIdle)
-        setIsVisuallyIdleInternal(viewState & ViewState::IsVisuallyIdle);
+    if (changed & ActivityState::IsVisible)
+        setIsVisibleInternal(activityState & ActivityState::IsVisible);
+    if (changed & ActivityState::IsInWindow)
+        setIsInWindowInternal(activityState & ActivityState::IsInWindow);
+    if (changed & ActivityState::IsVisuallyIdle)
+        setIsVisuallyIdleInternal(activityState & ActivityState::IsVisuallyIdle);
 
-    if (changed & (ViewState::IsVisible | ViewState::IsVisuallyIdle))
+    if (changed & (ActivityState::IsVisible | ActivityState::IsVisuallyIdle))
         updateTimerThrottlingState();
 
-    for (auto* observer : m_viewStateChangeObservers)
-        observer->viewStateDidChange(oldViewState, m_viewState);
+    for (auto* observer : m_activityStateChangeObservers)
+        observer->activityStateDidChange(oldActivityState, m_activityState);
 
     if (wasVisibleAndActive != isVisibleAndActive())
         PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary();
@@ -1470,15 +1470,15 @@ void Page::setViewState(ViewState::Flags viewState)
 
 bool Page::isVisibleAndActive() const
 {
-    return (m_viewState & ViewState::IsVisible) && (m_viewState & ViewState::WindowIsActive);
+    return (m_activityState & ActivityState::IsVisible) && (m_activityState & ActivityState::WindowIsActive);
 }
 
 void Page::setIsVisible(bool isVisible)
 {
     if (isVisible)
-        setViewState((m_viewState & ~ViewState::IsVisuallyIdle) | ViewState::IsVisible | ViewState::IsVisibleOrOccluded);
+        setActivityState((m_activityState & ~ActivityState::IsVisuallyIdle) | ActivityState::IsVisible | ActivityState::IsVisibleOrOccluded);
     else
-        setViewState((m_viewState & ~(ViewState::IsVisible | ViewState::IsVisibleOrOccluded)) | ViewState::IsVisuallyIdle);
+        setActivityState((m_activityState & ~(ActivityState::IsVisible | ActivityState::IsVisibleOrOccluded)) | ActivityState::IsVisuallyIdle);
 }
 
 void Page::setIsVisibleInternal(bool isVisible)
index 314f216..33ce93b 100644 (file)
@@ -20,6 +20,7 @@
 
 #pragma once
 
+#include "ActivityState.h"
 #include "FindOptions.h"
 #include "FrameLoaderTypes.h"
 #include "LayoutMilestones.h"
@@ -34,7 +35,6 @@
 #include "SessionID.h"
 #include "Supplementable.h"
 #include "UserInterfaceLayoutDirection.h"
-#include "ViewState.h"
 #include "ViewportArguments.h"
 #include "WheelEventTestTrigger.h"
 #include <memory>
@@ -126,7 +126,7 @@ class StorageNamespace;
 class StorageNamespaceProvider;
 class UserContentProvider;
 class ValidationMessageClient;
-class ViewStateChangeObserver;
+class ActivityStateChangeObserver;
 class VisitedLinkStore;
 
 typedef uint64_t LinkHash;
@@ -334,22 +334,22 @@ public:
     WEBCORE_EXPORT DiagnosticLoggingClient& diagnosticLoggingClient() const;
 
     // Notifications when the Page starts and stops being presented via a native window.
-    WEBCORE_EXPORT void setViewState(ViewState::Flags);
+    WEBCORE_EXPORT void setActivityState(ActivityState::Flags);
     bool isVisibleAndActive() const;
     void pageActivityStateChanged() { updateTimerThrottlingState(); }
     WEBCORE_EXPORT void setIsVisible(bool);
     WEBCORE_EXPORT void setIsPrerender();
-    bool isVisible() const { return m_viewState & ViewState::IsVisible; }
+    bool isVisible() const { return m_activityState & ActivityState::IsVisible; }
 
     // Notification that this Page was moved into or out of a native window.
     WEBCORE_EXPORT void setIsInWindow(bool);
-    bool isInWindow() const { return m_viewState & ViewState::IsInWindow; }
+    bool isInWindow() const { return m_activityState & ActivityState::IsInWindow; }
 
     void setIsClosing() { m_isClosing = true; }
     bool isClosing() const { return m_isClosing; }
 
-    void addViewStateChangeObserver(ViewStateChangeObserver&);
-    void removeViewStateChangeObserver(ViewStateChangeObserver&);
+    void addActivityStateChangeObserver(ActivityStateChangeObserver&);
+    void removeActivityStateChangeObserver(ActivityStateChangeObserver&);
 
     WEBCORE_EXPORT void suspendScriptedAnimations();
     WEBCORE_EXPORT void resumeScriptedAnimations();
@@ -666,7 +666,7 @@ private:
 
     bool m_isEditable;
     bool m_isPrerender;
-    ViewState::Flags m_viewState;
+    ActivityState::Flags m_activityState;
     PageActivityState::Flags m_pageActivityState;
 
     LayoutMilestones m_requestedLayoutMilestones;
@@ -711,7 +711,7 @@ private:
     Ref<VisitedLinkStore> m_visitedLinkStore;
     RefPtr<WheelEventTestTrigger> m_testTrigger;
 
-    HashSet<ViewStateChangeObserver*> m_viewStateChangeObservers;
+    HashSet<ActivityStateChangeObserver*> m_activityStateChangeObservers;
 
 #if ENABLE(RESOURCE_USAGE)
     std::unique_ptr<ResourceUsageOverlay> m_resourceUsageOverlay;
index e630c96..3ddeb5c 100644 (file)
 
 #pragma once
 
+#include "ActivityState.h"
 #include "Timer.h"
-
 #include "UserActivity.h"
-#include "ViewState.h"
 #include <wtf/RefCounter.h>
 
 namespace WebCore {
index f77da31..11b1e71 100644 (file)
@@ -1,3 +1,134 @@
+2016-10-31  Gavin Barraclough  <barraclough@apple.com>
+
+        Rename ViewState to ActivityState
+        https://bugs.webkit.org/show_bug.cgi?id=164254
+
+        Reviewed by Andreas Kling.
+
+        We plan to add a couple more flags to ViewState that aren't directly related to the view
+        itself - whether there is an ongoing page load, and whether whether there is audio playback.
+        This will allow viewState (now activityState) to fully drive throttling decisions.
+
+        Renaming this bitfield accordingly.
+
+        * Shared/WebPageCreationParameters.cpp:
+        (WebKit::WebPageCreationParameters::encode):
+        (WebKit::WebPageCreationParameters::decode):
+        * Shared/WebPageCreationParameters.h:
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView didMoveToWindow]):
+        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+        (_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate):
+        (_WebKitWebViewBasePrivate::updateActivityStateTimerFired):
+        (webkitWebViewBaseScheduleUpdateActivityState):
+        (toplevelWindowFocusInEvent):
+        (toplevelWindowFocusOutEvent):
+        (toplevelWindowStateEvent):
+        (webkitWebViewBaseSetToplevelOnScreenWindow):
+        (webkitWebViewBaseMap):
+        (webkitWebViewBaseUnmap):
+        (webkitWebViewBaseSetFocus):
+        (webkitWebViewBaseIsInWindowActive):
+        (webkitWebViewBaseIsFocused):
+        (webkitWebViewBaseIsVisible):
+        (webkitWebViewBaseIsInWindow):
+        (_WebKitWebViewBasePrivate::updateViewStateTimerFired): Deleted.
+        (webkitWebViewBaseScheduleUpdateViewState): Deleted.
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::becomeFirstResponder):
+        (WebKit::WebViewImpl::resignFirstResponder):
+        (WebKit::WebViewImpl::windowDidOrderOffScreen):
+        (WebKit::WebViewImpl::windowDidOrderOnScreen):
+        (WebKit::WebViewImpl::windowDidBecomeKey):
+        (WebKit::WebViewImpl::windowDidResignKey):
+        (WebKit::WebViewImpl::windowDidMiniaturize):
+        (WebKit::WebViewImpl::windowDidDeminiaturize):
+        (WebKit::WebViewImpl::windowDidChangeOcclusionState):
+        (WebKit::WebViewImpl::viewDidMoveToWindow):
+        (WebKit::WebViewImpl::viewDidHide):
+        (WebKit::WebViewImpl::viewDidUnhide):
+        (WebKit::WebViewImpl::activeSpaceDidChange):
+        (WebKit::WebViewImpl::endDeferringViewInWindowChanges):
+        (WebKit::WebViewImpl::endDeferringViewInWindowChangesSync):
+        (WebKit::WebViewImpl::prepareForMoveToWindow):
+        * UIProcess/DrawingAreaProxy.h:
+        (WebKit::DrawingAreaProxy::waitForDidUpdateActivityState):
+        (WebKit::DrawingAreaProxy::waitForDidUpdateViewState): Deleted.
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::WebPageProxy):
+        (WebKit::WebPageProxy::reattachToWebProcess):
+        (WebKit::WebPageProxy::setSuppressVisibilityUpdates):
+        (WebKit::WebPageProxy::updateActivityState):
+        (WebKit::WebPageProxy::activityStateDidChange):
+        (WebKit::WebPageProxy::dispatchActivityStateChange):
+        (WebKit::WebPageProxy::updateThrottleState):
+        (WebKit::WebPageProxy::waitForDidUpdateActivityState):
+        (WebKit::WebPageProxy::creationParameters):
+        (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
+        (WebKit::WebPageProxy::updateViewState): Deleted.
+        (WebKit::WebPageProxy::viewStateDidChange): Deleted.
+        (WebKit::WebPageProxy::dispatchViewStateChange): Deleted.
+        (WebKit::WebPageProxy::waitForDidUpdateViewState): Deleted.
+        (WebKit::WebPageProxy::installViewStateChangeCompletionHandler): Deleted.
+        * UIProcess/WebPageProxy.h:
+        (WebKit::WebPageProxy::isInWindow):
+        (WebKit::WebPageProxy::didUpdateActivityState):
+        (WebKit::WebPageProxy::isViewVisible):
+        (WebKit::WebPageProxy::didUpdateViewState): Deleted.
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::windowServerConnectionStateChanged):
+        * UIProcess/efl/WebView.cpp:
+        * UIProcess/ios/WKContentView.mm:
+        (-[WKContentView _applicationDidEnterBackground]):
+        (-[WKContentView _applicationWillEnterForeground]):
+        * UIProcess/ios/WKPDFView.mm:
+        (-[WKPDFView _applicationDidEnterBackground]):
+        (-[WKPDFView _applicationWillEnterForeground]):
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
+        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
+        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState): Deleted.
+        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
+        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
+        (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
+        (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateViewState): Deleted.
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::activityStateDidChange):
+        (WebKit::PluginView::viewStateDidChange): Deleted.
+        * WebProcess/Plugins/PluginView.h:
+        * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
+        (WebKit::AcceleratedDrawingArea::activityStateDidChange):
+        (WebKit::AcceleratedDrawingArea::viewStateDidChange): Deleted.
+        * WebProcess/WebPage/AcceleratedDrawingArea.h:
+        * WebProcess/WebPage/DrawingArea.h:
+        (WebKit::DrawingArea::activityStateDidChange):
+        (WebKit::DrawingArea::viewStateDidChange): Deleted.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::m_userInterfaceLayoutDirection):
+        (WebKit::WebPage::reinitializeWebPage):
+        (WebKit::WebPage::updateIsInWindow):
+        (WebKit::WebPage::setActivityState):
+        (WebKit::WebPage::setViewState): Deleted.
+        * WebProcess/WebPage/WebPage.h:
+        (WebKit::WebPage::isVisible):
+        (WebKit::WebPage::isVisibleOrOccluded):
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
+        (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange): Deleted.
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
+        (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
+        (WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired):
+        (WebKit::TiledCoreAnimationDrawingArea::viewStateDidChange): Deleted.
+        (WebKit::TiledCoreAnimationDrawingArea::didUpdateViewStateTimerFired): Deleted.
+
 2016-10-31  Jaehun Lim  <ljaehun.lim@samsung.com>
 
         Unreviewed, CMake build fix
index 5b1c80c..f262456 100644 (file)
@@ -33,7 +33,7 @@ namespace WebKit {
 void WebPageCreationParameters::encode(IPC::Encoder& encoder) const
 {
     encoder << viewSize;
-    encoder << viewState;
+    encoder << activityState;
 
     encoder << store;
     encoder.encodeEnum(drawingAreaType);
@@ -94,7 +94,7 @@ bool WebPageCreationParameters::decode(IPC::Decoder& decoder, WebPageCreationPar
 {
     if (!decoder.decode(parameters.viewSize))
         return false;
-    if (!decoder.decode(parameters.viewState))
+    if (!decoder.decode(parameters.activityState))
         return false;
     if (!decoder.decode(parameters.store))
         return false;
index c5befd2..827d7b3 100644 (file)
@@ -32,6 +32,7 @@
 #include "WebCoreArgumentCoders.h"
 #include "WebPageGroupData.h"
 #include "WebPreferencesStore.h"
+#include <WebCore/ActivityState.h>
 #include <WebCore/Color.h>
 #include <WebCore/FloatSize.h>
 #include <WebCore/IntSize.h>
@@ -40,7 +41,6 @@
 #include <WebCore/ScrollTypes.h>
 #include <WebCore/SessionID.h>
 #include <WebCore/UserInterfaceLayoutDirection.h>
-#include <WebCore/ViewState.h>
 #include <wtf/text/WTFString.h>
 
 #if PLATFORM(MAC)
@@ -60,7 +60,7 @@ struct WebPageCreationParameters {
 
     WebCore::IntSize viewSize;
 
-    WebCore::ViewState::Flags viewState;
+    WebCore::ActivityState::Flags activityState;
     
     WebPreferencesStore store;
     DrawingAreaType drawingAreaType;
index fe44317..8b4c188 100644 (file)
@@ -1730,7 +1730,7 @@ static WebCore::FloatPoint constrainContentOffset(WebCore::FloatPoint contentOff
 
 - (void)didMoveToWindow
 {
-    _page->viewStateDidChange(WebCore::ViewState::AllFlags);
+    _page->activityStateDidChange(WebCore::ActivityState::AllFlags);
 }
 
 - (void)setOpaque:(BOOL)opaque
index 1c89a30..04c7e95 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "APIPageConfiguration.h"
 #include "AcceleratedBackingStore.h"
+#include "ActivityState.h"
 #include "DrawingAreaProxyImpl.h"
 #include "InputMethodFilter.h"
 #include "KeyBindingTranslator.h"
@@ -38,7 +39,6 @@
 #include "NativeWebMouseEvent.h"
 #include "NativeWebWheelEvent.h"
 #include "PageClientImpl.h"
-#include "ViewState.h"
 #include "WebEventFactory.h"
 #include "WebFullScreenClientGtk.h"
 #include "WebInspectorProxy.h"
@@ -146,16 +146,16 @@ typedef HashMap<uint32_t, GUniquePtr<GdkEvent>> TouchEventsMap;
 
 struct _WebKitWebViewBasePrivate {
     _WebKitWebViewBasePrivate()
-        : updateViewStateTimer(RunLoop::main(), this, &_WebKitWebViewBasePrivate::updateViewStateTimerFired)
+        : updateActivityStateTimer(RunLoop::main(), this, &_WebKitWebViewBasePrivate::updateActivityStateTimerFired)
     {
     }
 
-    void updateViewStateTimerFired()
+    void updateActivityStateTimerFired()
     {
         if (!pageProxy)
             return;
-        pageProxy->viewStateDidChange(viewStateFlagsToUpdate);
-        viewStateFlagsToUpdate = ViewState::NoFlags;
+        pageProxy->activityStateDidChange(activityStateFlagsToUpdate);
+        activityStateFlagsToUpdate = ActivityState::NoFlags;
     }
 
     WebKitWebViewChildrenMap children;
@@ -185,9 +185,9 @@ struct _WebKitWebViewBasePrivate {
     unsigned long toplevelWindowRealizedID;
 
     // View State.
-    ViewState::Flags viewState;
-    ViewState::Flags viewStateFlagsToUpdate;
-    RunLoop::Timer<WebKitWebViewBasePrivate> updateViewStateTimer;
+    ActivityState::Flags activityState;
+    ActivityState::Flags activityStateFlagsToUpdate;
+    RunLoop::Timer<WebKitWebViewBasePrivate> updateActivityStateTimer;
 
     WebKitWebViewBaseDownloadRequestHandler downloadHandler;
 
@@ -212,14 +212,14 @@ struct _WebKitWebViewBasePrivate {
 
 WEBKIT_DEFINE_TYPE(WebKitWebViewBase, webkit_web_view_base, GTK_TYPE_CONTAINER)
 
-static void webkitWebViewBaseScheduleUpdateViewState(WebKitWebViewBase* webViewBase, ViewState::Flags flagsToUpdate)
+static void webkitWebViewBaseScheduleUpdateActivityState(WebKitWebViewBase* webViewBase, ActivityState::Flags flagsToUpdate)
 {
     WebKitWebViewBasePrivate* priv = webViewBase->priv;
-    priv->viewStateFlagsToUpdate |= flagsToUpdate;
-    if (priv->updateViewStateTimer.isActive())
+    priv->activityStateFlagsToUpdate |= flagsToUpdate;
+    if (priv->updateActivityStateTimer.isActive())
         return;
 
-    priv->updateViewStateTimer.startOneShot(0);
+    priv->updateActivityStateTimer.startOneShot(0);
 }
 
 static gboolean toplevelWindowFocusInEvent(GtkWidget* widget, GdkEventFocus*, WebKitWebViewBase* webViewBase)
@@ -229,11 +229,11 @@ static gboolean toplevelWindowFocusInEvent(GtkWidget* widget, GdkEventFocus*, We
         return FALSE;
 
     WebKitWebViewBasePrivate* priv = webViewBase->priv;
-    if (priv->viewState & ViewState::WindowIsActive)
+    if (priv->activityState & ActivityState::WindowIsActive)
         return FALSE;
 
-    priv->viewState |= ViewState::WindowIsActive;
-    webkitWebViewBaseScheduleUpdateViewState(webViewBase, ViewState::WindowIsActive);
+    priv->activityState |= ActivityState::WindowIsActive;
+    webkitWebViewBaseScheduleUpdateActivityState(webViewBase, ActivityState::WindowIsActive);
 
     return FALSE;
 }
@@ -241,11 +241,11 @@ static gboolean toplevelWindowFocusInEvent(GtkWidget* widget, GdkEventFocus*, We
 static gboolean toplevelWindowFocusOutEvent(GtkWidget*, GdkEventFocus*, WebKitWebViewBase* webViewBase)
 {
     WebKitWebViewBasePrivate* priv = webViewBase->priv;
-    if (!(priv->viewState & ViewState::WindowIsActive))
+    if (!(priv->activityState & ActivityState::WindowIsActive))
         return FALSE;
 
-    priv->viewState &= ~ViewState::WindowIsActive;
-    webkitWebViewBaseScheduleUpdateViewState(webViewBase, ViewState::WindowIsActive);
+    priv->activityState &= ~ActivityState::WindowIsActive;
+    webkitWebViewBaseScheduleUpdateActivityState(webViewBase, ActivityState::WindowIsActive);
 
     return FALSE;
 }
@@ -257,14 +257,14 @@ static gboolean toplevelWindowStateEvent(GtkWidget*, GdkEventWindowState* event,
         return FALSE;
 
     bool visible = !(event->new_window_state & GDK_WINDOW_STATE_ICONIFIED);
-    if ((visible && priv->viewState & ViewState::IsVisible) || (!visible && !(priv->viewState & ViewState::IsVisible)))
+    if ((visible && priv->activityState & ActivityState::IsVisible) || (!visible && !(priv->activityState & ActivityState::IsVisible)))
         return FALSE;
 
     if (visible)
-        priv->viewState |= ViewState::IsVisible;
+        priv->activityState |= ActivityState::IsVisible;
     else
-        priv->viewState &= ~ViewState::IsVisible;
-    webkitWebViewBaseScheduleUpdateViewState(webViewBase, ViewState::IsVisible);
+        priv->activityState &= ~ActivityState::IsVisible;
+    webkitWebViewBaseScheduleUpdateActivityState(webViewBase, ActivityState::IsVisible);
 
     return FALSE;
 }
@@ -306,17 +306,17 @@ static void webkitWebViewBaseSetToplevelOnScreenWindow(WebKitWebViewBase* webVie
     priv->toplevelOnScreenWindow = window;
 
     if (!priv->toplevelOnScreenWindow) {
-        ViewState::Flags flagsToUpdate = 0;
-        if (priv->viewState & ViewState::IsInWindow) {
-            priv->viewState &= ~ViewState::IsInWindow;
-            flagsToUpdate |= ViewState::IsInWindow;
+        ActivityState::Flags flagsToUpdate = 0;
+        if (priv->activityState & ActivityState::IsInWindow) {
+            priv->activityState &= ~ActivityState::IsInWindow;
+            flagsToUpdate |= ActivityState::IsInWindow;
         }
-        if (priv->viewState & ViewState::WindowIsActive) {
-            priv->viewState &= ~ViewState::WindowIsActive;
-            flagsToUpdate |= ViewState::IsInWindow;
+        if (priv->activityState & ActivityState::WindowIsActive) {
+            priv->activityState &= ~ActivityState::WindowIsActive;
+            flagsToUpdate |= ActivityState::IsInWindow;
         }
         if (flagsToUpdate)
-            webkitWebViewBaseScheduleUpdateViewState(webViewBase, flagsToUpdate);
+            webkitWebViewBaseScheduleUpdateActivityState(webViewBase, flagsToUpdate);
 
         return;
     }
@@ -631,20 +631,20 @@ static void webkitWebViewBaseMap(GtkWidget* widget)
 
     WebKitWebViewBase* webViewBase = WEBKIT_WEB_VIEW_BASE(widget);
     WebKitWebViewBasePrivate* priv = webViewBase->priv;
-    ViewState::Flags flagsToUpdate = 0;
-    if (!(priv->viewState & ViewState::IsVisible))
-        flagsToUpdate |= ViewState::IsVisible;
+    ActivityState::Flags flagsToUpdate = 0;
+    if (!(priv->activityState & ActivityState::IsVisible))
+        flagsToUpdate |= ActivityState::IsVisible;
     if (priv->toplevelOnScreenWindow) {
-        if (!(priv->viewState & ViewState::IsInWindow))
-            flagsToUpdate |= ViewState::IsInWindow;
-        if (gtk_window_is_active(GTK_WINDOW(priv->toplevelOnScreenWindow)) && !(priv->viewState & ViewState::WindowIsActive))
-            flagsToUpdate |= ViewState::WindowIsActive;
+        if (!(priv->activityState & ActivityState::IsInWindow))
+            flagsToUpdate |= ActivityState::IsInWindow;
+        if (gtk_window_is_active(GTK_WINDOW(priv->toplevelOnScreenWindow)) && !(priv->activityState & ActivityState::WindowIsActive))
+            flagsToUpdate |= ActivityState::WindowIsActive;
     }
     if (!flagsToUpdate)
         return;
 
-    priv->viewState |= flagsToUpdate;
-    webkitWebViewBaseScheduleUpdateViewState(webViewBase, flagsToUpdate);
+    priv->activityState |= flagsToUpdate;
+    webkitWebViewBaseScheduleUpdateActivityState(webViewBase, flagsToUpdate);
 }
 
 static void webkitWebViewBaseUnmap(GtkWidget* widget)
@@ -653,11 +653,11 @@ static void webkitWebViewBaseUnmap(GtkWidget* widget)
 
     WebKitWebViewBase* webViewBase = WEBKIT_WEB_VIEW_BASE(widget);
     WebKitWebViewBasePrivate* priv = webViewBase->priv;
-    if (!(priv->viewState & ViewState::IsVisible))
+    if (!(priv->activityState & ActivityState::IsVisible))
         return;
 
-    priv->viewState &= ~ViewState::IsVisible;
-    webkitWebViewBaseScheduleUpdateViewState(webViewBase, ViewState::IsVisible);
+    priv->activityState &= ~ActivityState::IsVisible;
+    webkitWebViewBaseScheduleUpdateActivityState(webViewBase, ActivityState::IsVisible);
 }
 
 static gboolean webkitWebViewBaseFocusInEvent(GtkWidget* widget, GdkEventFocus* event)
@@ -1379,46 +1379,46 @@ GdkEvent* webkitWebViewBaseTakeContextMenuEvent(WebKitWebViewBase* webkitWebView
 void webkitWebViewBaseSetFocus(WebKitWebViewBase* webViewBase, bool focused)
 {
     WebKitWebViewBasePrivate* priv = webViewBase->priv;
-    if ((focused && priv->viewState & ViewState::IsFocused) || (!focused && !(priv->viewState & ViewState::IsFocused)))
+    if ((focused && priv->activityState & ActivityState::IsFocused) || (!focused && !(priv->activityState & ActivityState::IsFocused)))
         return;
 
-    ViewState::Flags flagsToUpdate = ViewState::IsFocused;
+    ActivityState::Flags flagsToUpdate = ActivityState::IsFocused;
     if (focused) {
-        priv->viewState |= ViewState::IsFocused;
+        priv->activityState |= ActivityState::IsFocused;
 
         // If the view has received the focus and the window is not active
         // mark the current window as active now. This can happen if the
         // toplevel window is a GTK_WINDOW_POPUP and the focus has been
         // set programatically like WebKitTestRunner does, because POPUP
         // can't be focused.
-        if (!(priv->viewState & ViewState::WindowIsActive)) {
-            priv->viewState |= ViewState::WindowIsActive;
-            flagsToUpdate |= ViewState::WindowIsActive;
+        if (!(priv->activityState & ActivityState::WindowIsActive)) {
+            priv->activityState |= ActivityState::WindowIsActive;
+            flagsToUpdate |= ActivityState::WindowIsActive;
         }
     } else
-        priv->viewState &= ~ViewState::IsFocused;
+        priv->activityState &= ~ActivityState::IsFocused;
 
-    webkitWebViewBaseScheduleUpdateViewState(webViewBase, flagsToUpdate);
+    webkitWebViewBaseScheduleUpdateActivityState(webViewBase, flagsToUpdate);
 }
 
 bool webkitWebViewBaseIsInWindowActive(WebKitWebViewBase* webViewBase)
 {
-    return webViewBase->priv->viewState & ViewState::WindowIsActive;
+    return webViewBase->priv->activityState & ActivityState::WindowIsActive;
 }
 
 bool webkitWebViewBaseIsFocused(WebKitWebViewBase* webViewBase)
 {
-    return webViewBase->priv->viewState & ViewState::IsFocused;
+    return webViewBase->priv->activityState & ActivityState::IsFocused;
 }
 
 bool webkitWebViewBaseIsVisible(WebKitWebViewBase* webViewBase)
 {
-    return webViewBase->priv->viewState & ViewState::IsVisible;
+    return webViewBase->priv->activityState & ActivityState::IsVisible;
 }
 
 bool webkitWebViewBaseIsInWindow(WebKitWebViewBase* webViewBase)
 {
-    return webViewBase->priv->viewState & ViewState::IsInWindow;
+    return webViewBase->priv->activityState & ActivityState::IsInWindow;
 }
 
 void webkitWebViewBaseSetDownloadRequestHandler(WebKitWebViewBase* webViewBase, WebKitWebViewBaseDownloadRequestHandler downloadHandler)
index b25b5c5..32e639c 100644 (file)
@@ -66,6 +66,7 @@
 #import "_WKThumbnailViewInternal.h"
 #import <HIToolbox/CarbonEventsCore.h>
 #import <WebCore/AXObjectCache.h>
+#import <WebCore/ActivityState.h>
 #import <WebCore/ColorMac.h>
 #import <WebCore/CoreGraphicsSPI.h>
 #import <WebCore/DataDetectorsSPI.h>
@@ -84,7 +85,6 @@
 #import <WebCore/SoftLinking.h>
 #import <WebCore/TextAlternativeWithRange.h>
 #import <WebCore/TextUndoInsertionMarkupMac.h>
-#import <WebCore/ViewState.h>
 #import <WebCore/WebActionDisablingCALayerDelegate.h>
 #import <WebCore/WebCoreCALayerExtras.h>
 #import <WebCore/WebCoreFullScreenPlaceholderView.h>
@@ -609,7 +609,7 @@ bool WebViewImpl::becomeFirstResponder()
     m_inBecomeFirstResponder = true;
 
     updateSecureInputState();
-    m_page->viewStateDidChange(WebCore::ViewState::IsFocused);
+    m_page->activityStateDidChange(WebCore::ActivityState::IsFocused);
     // Restore the selection in the editable region if resigning first responder cleared selection.
     m_page->restoreSelectionInFocusedEditableElement();
 
@@ -656,7 +656,7 @@ bool WebViewImpl::resignFirstResponder()
     if (!m_page->maintainsInactiveSelection())
         m_page->clearSelection();
 
-    m_page->viewStateDidChange(WebCore::ViewState::IsFocused);
+    m_page->activityStateDidChange(WebCore::ActivityState::IsFocused);
     
     m_inResignFirstResponder = false;
     
@@ -1051,12 +1051,12 @@ float WebViewImpl::intrinsicDeviceScaleFactor() const
 
 void WebViewImpl::windowDidOrderOffScreen()
 {
-    m_page->viewStateDidChange(WebCore::ViewState::IsVisible | WebCore::ViewState::WindowIsActive);
+    m_page->activityStateDidChange(WebCore::ActivityState::IsVisible | WebCore::ActivityState::WindowIsActive);
 }
 
 void WebViewImpl::windowDidOrderOnScreen()
 {
-    m_page->viewStateDidChange(WebCore::ViewState::IsVisible | WebCore::ViewState::WindowIsActive);
+    m_page->activityStateDidChange(WebCore::ActivityState::IsVisible | WebCore::ActivityState::WindowIsActive);
 }
 
 void WebViewImpl::windowDidBecomeKey(NSWindow *keyWindow)
@@ -1066,7 +1066,7 @@ void WebViewImpl::windowDidBecomeKey(NSWindow *keyWindow)
         UIGamepadProvider::singleton().viewBecameActive(m_page.get());
 #endif
         updateSecureInputState();
-        m_page->viewStateDidChange(WebCore::ViewState::WindowIsActive);
+        m_page->activityStateDidChange(WebCore::ActivityState::WindowIsActive);
     }
 }
 
@@ -1077,18 +1077,18 @@ void WebViewImpl::windowDidResignKey(NSWindow *formerKeyWindow)
         UIGamepadProvider::singleton().viewBecameInactive(m_page.get());
 #endif
         updateSecureInputState();
-        m_page->viewStateDidChange(WebCore::ViewState::WindowIsActive);
+        m_page->activityStateDidChange(WebCore::ActivityState::WindowIsActive);
     }
 }
 
 void WebViewImpl::windowDidMiniaturize()
 {
-    m_page->viewStateDidChange(WebCore::ViewState::IsVisible);
+    m_page->activityStateDidChange(WebCore::ActivityState::IsVisible);
 }
 
 void WebViewImpl::windowDidDeminiaturize()
 {
-    m_page->viewStateDidChange(WebCore::ViewState::IsVisible);
+    m_page->activityStateDidChange(WebCore::ActivityState::IsVisible);
 }
 
 void WebViewImpl::windowDidMove()
@@ -1123,7 +1123,7 @@ void WebViewImpl::windowDidChangeLayerHosting()
 
 void WebViewImpl::windowDidChangeOcclusionState()
 {
-    m_page->viewStateDidChange(WebCore::ViewState::IsVisible);
+    m_page->activityStateDidChange(WebCore::ActivityState::IsVisible);
 }
 
 bool WebViewImpl::mightBeginDragWhileInactive()
@@ -1214,12 +1214,12 @@ void WebViewImpl::viewDidMoveToWindow()
     if (window) {
         windowDidChangeScreen();
 
-        WebCore::ViewState::Flags viewStateChanges = WebCore::ViewState::WindowIsActive | WebCore::ViewState::IsVisible;
+        WebCore::ActivityState::Flags activityStateChanges = WebCore::ActivityState::WindowIsActive | WebCore::ActivityState::IsVisible;
         if (m_shouldDeferViewInWindowChanges)
             m_viewInWindowChangeWasDeferred = true;
         else
-            viewStateChanges |= WebCore::ViewState::IsInWindow;
-        m_page->viewStateDidChange(viewStateChanges);
+            activityStateChanges |= WebCore::ActivityState::IsInWindow;
+        m_page->activityStateDidChange(activityStateChanges);
 
         updateWindowAndViewFrames();
 
@@ -1243,12 +1243,12 @@ void WebViewImpl::viewDidMoveToWindow()
         if (m_immediateActionGestureRecognizer && ![[m_view gestureRecognizers] containsObject:m_immediateActionGestureRecognizer.get()] && !m_ignoresNonWheelEvents && m_allowsLinkPreview)
             [m_view addGestureRecognizer:m_immediateActionGestureRecognizer.get()];
     } else {
-        WebCore::ViewState::Flags viewStateChanges = WebCore::ViewState::WindowIsActive | WebCore::ViewState::IsVisible;
+        WebCore::ActivityState::Flags activityStateChanges = WebCore::ActivityState::WindowIsActive | WebCore::ActivityState::IsVisible;
         if (m_shouldDeferViewInWindowChanges)
             m_viewInWindowChangeWasDeferred = true;
         else
-            viewStateChanges |= WebCore::ViewState::IsInWindow;
-        m_page->viewStateDidChange(viewStateChanges);
+            activityStateChanges |= WebCore::ActivityState::IsInWindow;
+        m_page->activityStateDidChange(activityStateChanges);
 
         [NSEvent removeMonitor:m_flagsChangedEventMonitor];
         m_flagsChangedEventMonitor = nil;
@@ -1278,17 +1278,17 @@ void WebViewImpl::viewDidChangeBackingProperties()
 
 void WebViewImpl::viewDidHide()
 {
-    m_page->viewStateDidChange(WebCore::ViewState::IsVisible);
+    m_page->activityStateDidChange(WebCore::ActivityState::IsVisible);
 }
 
 void WebViewImpl::viewDidUnhide()
 {
-    m_page->viewStateDidChange(WebCore::ViewState::IsVisible);
+    m_page->activityStateDidChange(WebCore::ActivityState::IsVisible);
 }
 
 void WebViewImpl::activeSpaceDidChange()
 {
-    m_page->viewStateDidChange(WebCore::ViewState::IsVisible);
+    m_page->activityStateDidChange(WebCore::ActivityState::IsVisible);
 }
 
 NSView *WebViewImpl::hitTest(CGPoint point)
@@ -1383,7 +1383,7 @@ void WebViewImpl::endDeferringViewInWindowChanges()
 
     if (m_viewInWindowChangeWasDeferred) {
         dispatchSetTopContentInset();
-        m_page->viewStateDidChange(WebCore::ViewState::IsInWindow);
+        m_page->activityStateDidChange(WebCore::ActivityState::IsInWindow);
         m_viewInWindowChangeWasDeferred = false;
     }
 }
@@ -1399,7 +1399,7 @@ void WebViewImpl::endDeferringViewInWindowChangesSync()
 
     if (m_viewInWindowChangeWasDeferred) {
         dispatchSetTopContentInset();
-        m_page->viewStateDidChange(WebCore::ViewState::IsInWindow);
+        m_page->activityStateDidChange(WebCore::ActivityState::IsInWindow);
         m_viewInWindowChangeWasDeferred = false;
     }
 }
@@ -1414,7 +1414,7 @@ void WebViewImpl::prepareForMoveToWindow(NSWindow *targetWindow, std::function<v
     m_shouldDeferViewInWindowChanges = false;
 
     auto weakThis = createWeakPtr();
-    m_page->installViewStateChangeCompletionHandler([weakThis, completionHandler]() {
+    m_page->installActivityStateChangeCompletionHandler([weakThis, completionHandler]() {
         completionHandler();
 
         if (!weakThis)
@@ -1425,7 +1425,7 @@ void WebViewImpl::prepareForMoveToWindow(NSWindow *targetWindow, std::function<v
     });
 
     dispatchSetTopContentInset();
-    m_page->viewStateDidChange(WebCore::ViewState::IsInWindow, false, WebPageProxy::ViewStateChangeDispatchMode::Immediate);
+    m_page->activityStateDidChange(WebCore::ActivityState::IsInWindow, false, WebPageProxy::ActivityStateChangeDispatchMode::Immediate);
     m_viewInWindowChangeWasDeferred = false;
 }
 
index f4659be..32609f1 100644 (file)
@@ -89,7 +89,7 @@ public:
 
     virtual void updateDebugIndicator() { }
 
-    virtual void waitForDidUpdateViewState() { }
+    virtual void waitForDidUpdateActivityState() { }
     
     virtual void dispatchAfterEnsuringDrawing(std::function<void (CallbackBase::Error)>) { ASSERT_NOT_REACHED(); }
 
index 2e3a78f..1949a00 100644 (file)
@@ -357,7 +357,7 @@ WebPageProxy::WebPageProxy(PageClient& pageClient, WebProcessProxy& process, uin
     , m_geolocationPermissionRequestManager(*this)
     , m_notificationPermissionRequestManager(*this)
     , m_userMediaPermissionRequestManager(*this)
-    , m_viewState(ViewState::NoFlags)
+    , m_activityState(ActivityState::NoFlags)
     , m_viewWasEverInWindow(false)
 #if PLATFORM(IOS)
     , m_alwaysRunsAtForegroundPriority(m_configuration->alwaysRunsAtForegroundPriority())
@@ -449,26 +449,26 @@ WebPageProxy::WebPageProxy(PageClient& pageClient, WebProcessProxy& process, uin
     , m_autoSizingShouldExpandToViewHeight(false)
     , m_mediaVolume(1)
     , m_mayStartMediaWhenInWindow(true)
-    , m_waitingForDidUpdateViewState(false)
+    , m_waitingForDidUpdateActivityState(false)
 #if PLATFORM(COCOA)
     , m_scrollPerformanceDataCollectionEnabled(false)
 #endif
     , m_scrollPinningBehavior(DoNotPin)
     , m_navigationID(0)
     , m_configurationPreferenceValues(m_configuration->preferenceValues())
-    , m_potentiallyChangedViewStateFlags(ViewState::NoFlags)
-    , m_viewStateChangeWantsSynchronousReply(false)
+    , m_potentiallyChangedActivityStateFlags(ActivityState::NoFlags)
+    , m_activityStateChangeWantsSynchronousReply(false)
     , m_weakPtrFactory(this)
 {
     m_webProcessLifetimeTracker.addObserver(m_visitedLinkStore);
     m_webProcessLifetimeTracker.addObserver(m_websiteDataStore);
 
-    updateViewState();
+    updateActivityState();
     updateThrottleState();
     updateHiddenPageThrottlingAutoIncreases();
     
 #if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
-    m_layerHostingMode = m_viewState & ViewState::IsInWindow ? m_pageClient.viewLayerHostingMode() : LayerHostingMode::OutOfProcess;
+    m_layerHostingMode = m_activityState & ActivityState::IsInWindow ? m_pageClient.viewLayerHostingMode() : LayerHostingMode::OutOfProcess;
 #endif
 
     platformInitialize();
@@ -506,9 +506,9 @@ WebPageProxy::WebPageProxy(PageClient& pageClient, WebProcessProxy& process, uin
     }
 
 #if PLATFORM(COCOA)
-    const CFIndex viewStateChangeRunLoopOrder = (CFIndex)RunLoopObserver::WellKnownRunLoopOrders::CoreAnimationCommit - 1;
-    m_viewStateChangeDispatcher = std::make_unique<RunLoopObserver>(viewStateChangeRunLoopOrder, [this] {
-        this->dispatchViewStateChange();
+    const CFIndex activityStateChangeRunLoopOrder = (CFIndex)RunLoopObserver::WellKnownRunLoopOrders::CoreAnimationCommit - 1;
+    m_activityStateChangeDispatcher = std::make_unique<RunLoopObserver>(activityStateChangeRunLoopOrder, [this] {
+        this->dispatchActivityStateChange();
     });
 #endif
 }
@@ -720,7 +720,7 @@ void WebPageProxy::reattachToWebProcess()
     m_process->addExistingWebPage(this, m_pageID);
     m_process->addMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_pageID, *this);
 
-    updateViewState();
+    updateActivityState();
     updateThrottleState();
 
     m_inspector = WebInspectorProxy::create(this);
@@ -1442,48 +1442,48 @@ void WebPageProxy::setSuppressVisibilityUpdates(bool flag)
 
     if (!m_suppressVisibilityUpdates) {
 #if PLATFORM(COCOA)
-        m_viewStateChangeDispatcher->schedule();
+        m_activityStateChangeDispatcher->schedule();
 #else
-        dispatchViewStateChange();
+        dispatchActivityStateChange();
 #endif
     }
 }
 
-void WebPageProxy::updateViewState(ViewState::Flags flagsToUpdate)
+void WebPageProxy::updateActivityState(ActivityState::Flags flagsToUpdate)
 {
-    m_viewState &= ~flagsToUpdate;
-    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::IsVisibleOrOccluded && m_pageClient.isViewVisibleOrOccluded())
-        m_viewState |= ViewState::IsVisibleOrOccluded;
-    if (flagsToUpdate & ViewState::IsInWindow && m_pageClient.isViewInWindow())
-        m_viewState |= ViewState::IsInWindow;
-    if (flagsToUpdate & ViewState::IsVisuallyIdle && m_pageClient.isVisuallyIdle())
-        m_viewState |= ViewState::IsVisuallyIdle;
+    m_activityState &= ~flagsToUpdate;
+    if (flagsToUpdate & ActivityState::IsFocused && m_pageClient.isViewFocused())
+        m_activityState |= ActivityState::IsFocused;
+    if (flagsToUpdate & ActivityState::WindowIsActive && m_pageClient.isViewWindowActive())
+        m_activityState |= ActivityState::WindowIsActive;
+    if (flagsToUpdate & ActivityState::IsVisible && m_pageClient.isViewVisible())
+        m_activityState |= ActivityState::IsVisible;
+    if (flagsToUpdate & ActivityState::IsVisibleOrOccluded && m_pageClient.isViewVisibleOrOccluded())
+        m_activityState |= ActivityState::IsVisibleOrOccluded;
+    if (flagsToUpdate & ActivityState::IsInWindow && m_pageClient.isViewInWindow())
+        m_activityState |= ActivityState::IsInWindow;
+    if (flagsToUpdate & ActivityState::IsVisuallyIdle && m_pageClient.isVisuallyIdle())
+        m_activityState |= ActivityState::IsVisuallyIdle;
 }
 
-void WebPageProxy::viewStateDidChange(ViewState::Flags mayHaveChanged, bool wantsSynchronousReply, ViewStateChangeDispatchMode dispatchMode)
+void WebPageProxy::activityStateDidChange(ActivityState::Flags mayHaveChanged, bool wantsSynchronousReply, ActivityStateChangeDispatchMode dispatchMode)
 {
-    m_potentiallyChangedViewStateFlags |= mayHaveChanged;
-    m_viewStateChangeWantsSynchronousReply = m_viewStateChangeWantsSynchronousReply || wantsSynchronousReply;
+    m_potentiallyChangedActivityStateFlags |= mayHaveChanged;
+    m_activityStateChangeWantsSynchronousReply = m_activityStateChangeWantsSynchronousReply || wantsSynchronousReply;
 
-    if (m_suppressVisibilityUpdates && dispatchMode != ViewStateChangeDispatchMode::Immediate)
+    if (m_suppressVisibilityUpdates && dispatchMode != ActivityStateChangeDispatchMode::Immediate)
         return;
 
 #if PLATFORM(COCOA)
-    bool isNewlyInWindow = !isInWindow() && (mayHaveChanged & ViewState::IsInWindow) && m_pageClient.isViewInWindow();
-    if (dispatchMode == ViewStateChangeDispatchMode::Immediate || isNewlyInWindow) {
-        dispatchViewStateChange();
+    bool isNewlyInWindow = !isInWindow() && (mayHaveChanged & ActivityState::IsInWindow) && m_pageClient.isViewInWindow();
+    if (dispatchMode == ActivityStateChangeDispatchMode::Immediate || isNewlyInWindow) {
+        dispatchActivityStateChange();
         return;
     }
-    m_viewStateChangeDispatcher->schedule();
+    m_activityStateChangeDispatcher->schedule();
 #else
     UNUSED_PARAM(dispatchMode);
-    dispatchViewStateChange();
+    dispatchActivityStateChange();
 #endif
 }
 
@@ -1510,54 +1510,54 @@ void WebPageProxy::viewDidEnterWindow()
     }
 }
 
-void WebPageProxy::dispatchViewStateChange()
+void WebPageProxy::dispatchActivityStateChange()
 {
 #if PLATFORM(COCOA)
-    m_viewStateChangeDispatcher->invalidate();
+    m_activityStateChangeDispatcher->invalidate();
 #endif
 
     if (!isValid())
         return;
 
     // If the visibility state may have changed, then so may the visually idle & occluded agnostic state.
-    if (m_potentiallyChangedViewStateFlags & ViewState::IsVisible)
-        m_potentiallyChangedViewStateFlags |= ViewState::IsVisibleOrOccluded | ViewState::IsVisuallyIdle;
+    if (m_potentiallyChangedActivityStateFlags & ActivityState::IsVisible)
+        m_potentiallyChangedActivityStateFlags |= ActivityState::IsVisibleOrOccluded | ActivityState::IsVisuallyIdle;
 
     // 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(m_potentiallyChangedViewStateFlags);
-    ViewState::Flags changed = m_viewState ^ previousViewState;
+    ActivityState::Flags previousActivityState = m_activityState;
+    updateActivityState(m_potentiallyChangedActivityStateFlags);
+    ActivityState::Flags changed = m_activityState ^ previousActivityState;
 
-    bool isNowInWindow = (changed & ViewState::IsInWindow) && isInWindow();
+    bool isNowInWindow = (changed & ActivityState::IsInWindow) && isInWindow();
     // We always want to wait for the Web process to reply if we've been in-window before and are coming back in-window.
     if (m_viewWasEverInWindow && isNowInWindow && m_drawingArea->hasVisibleContent() && m_waitsForPaintAfterViewDidMoveToWindow)
-        m_viewStateChangeWantsSynchronousReply = true;
+        m_activityStateChangeWantsSynchronousReply = true;
 
     // Don't wait synchronously if the view state is not visible. (This matters in particular on iOS, where a hidden page may be suspended.)
-    if (!(m_viewState & ViewState::IsVisible))
-        m_viewStateChangeWantsSynchronousReply = false;
+    if (!(m_activityState & ActivityState::IsVisible))
+        m_activityStateChangeWantsSynchronousReply = false;
 
-    if (changed || m_viewStateChangeWantsSynchronousReply || !m_nextViewStateChangeCallbacks.isEmpty())
-        m_process->send(Messages::WebPage::SetViewState(m_viewState, m_viewStateChangeWantsSynchronousReply, m_nextViewStateChangeCallbacks), m_pageID);
+    if (changed || m_activityStateChangeWantsSynchronousReply || !m_nextActivityStateChangeCallbacks.isEmpty())
+        m_process->send(Messages::WebPage::SetActivityState(m_activityState, m_activityStateChangeWantsSynchronousReply, m_nextActivityStateChangeCallbacks), m_pageID);
 
-    m_nextViewStateChangeCallbacks.clear();
+    m_nextActivityStateChangeCallbacks.clear();
 
-    // This must happen after the SetViewState message is sent, to ensure the page visibility event can fire.
+    // This must happen after the SetActivityState message is sent, to ensure the page visibility event can fire.
     updateThrottleState();
 
     // 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.
-    if ((changed & ViewState::IsVisible) && !isViewVisible())
+    if ((changed & ActivityState::IsVisible) && !isViewVisible())
         m_process->responsivenessTimer().stop();
 
 #if ENABLE(POINTER_LOCK)
-    if ((changed & ViewState::IsVisible) && !isViewVisible())
+    if ((changed & ActivityState::IsVisible) && !isViewVisible())
         requestPointerUnlock();
 #endif
 
-    if (changed & ViewState::IsInWindow) {
+    if (changed & ActivityState::IsInWindow) {
         if (isInWindow())
             viewDidEnterWindow();
         else
@@ -1566,11 +1566,11 @@ void WebPageProxy::dispatchViewStateChange()
 
     updateBackingStoreDiscardableState();
 
-    if (m_viewStateChangeWantsSynchronousReply)
-        waitForDidUpdateViewState();
+    if (m_activityStateChangeWantsSynchronousReply)
+        waitForDidUpdateActivityState();
 
-    m_potentiallyChangedViewStateFlags = ViewState::NoFlags;
-    m_viewStateChangeWantsSynchronousReply = false;
+    m_potentiallyChangedActivityStateFlags = ActivityState::NoFlags;
+    m_activityStateChangeWantsSynchronousReply = false;
     m_viewWasEverInWindow |= isNowInWindow;
 }
 
@@ -1592,13 +1592,13 @@ void WebPageProxy::updateThrottleState()
     // We should suppress if the page is not active, is visually idle, and supression is enabled.
     bool isLoading = m_pageLoadState.isLoading();
     bool isPlayingAudio = m_mediaState & MediaProducer::IsPlayingAudio && !(m_mutedState & MediaProducer::AudioIsMuted);
-    bool pageShouldBeSuppressed = !isLoading && !isPlayingAudio && processSuppressionEnabled && (m_viewState & ViewState::IsVisuallyIdle);
+    bool pageShouldBeSuppressed = !isLoading && !isPlayingAudio && processSuppressionEnabled && (m_activityState & ActivityState::IsVisuallyIdle);
     if (m_pageSuppressed != pageShouldBeSuppressed) {
         m_pageSuppressed = pageShouldBeSuppressed;
         m_process->send(Messages::WebPage::SetPageSuppressed(m_pageSuppressed), m_pageID);
     }
 
-    if (m_viewState & ViewState::IsVisuallyIdle)
+    if (m_activityState & ActivityState::IsVisuallyIdle)
         m_pageIsUserObservableCount = nullptr;
     else if (!m_pageIsUserObservableCount)
         m_pageIsUserObservableCount = m_process->processPool().userObservablePageCount();
@@ -1640,7 +1640,7 @@ void WebPageProxy::layerHostingModeDidChange()
     m_process->send(Messages::WebPage::SetLayerHostingMode(layerHostingMode), m_pageID);
 }
 
-void WebPageProxy::waitForDidUpdateViewState()
+void WebPageProxy::waitForDidUpdateActivityState()
 {
     if (!isValid())
         return;
@@ -1649,11 +1649,11 @@ void WebPageProxy::waitForDidUpdateViewState()
         return;
 
     // If we have previously timed out with no response from the WebProcess, don't block the UIProcess again until it starts responding.
-    if (m_waitingForDidUpdateViewState)
+    if (m_waitingForDidUpdateActivityState)
         return;
 
 #if PLATFORM(IOS)
-    // Hail Mary check. Should not be possible (dispatchViewStateChange should force async if not visible,
+    // Hail Mary check. Should not be possible (dispatchActivityStateChange should force async if not visible,
     // and if visible we should be holding an assertion) - but we should never block on a suspended process.
     if (!m_activityToken) {
         ASSERT_NOT_REACHED();
@@ -1661,9 +1661,9 @@ void WebPageProxy::waitForDidUpdateViewState()
     }
 #endif
 
-    m_waitingForDidUpdateViewState = true;
+    m_waitingForDidUpdateActivityState = true;
 
-    m_drawingArea->waitForDidUpdateViewState();
+    m_drawingArea->waitForDidUpdateActivityState();
 }
 
 IntSize WebPageProxy::viewSize() const
@@ -5463,7 +5463,7 @@ WebPageCreationParameters WebPageProxy::creationParameters()
     WebPageCreationParameters parameters;
 
     parameters.viewSize = m_pageClient.viewSize();
-    parameters.viewState = m_viewState;
+    parameters.activityState = m_activityState;
     parameters.drawingAreaType = m_drawingArea->type();
     parameters.store = preferencesStore();
     parameters.pageGroupData = m_pageGroup->data();
@@ -6474,7 +6474,7 @@ void* WebPageProxy::immediateActionAnimationControllerForHitTestResult(RefPtr<AP
     return m_pageClient.immediateActionAnimationControllerForHitTestResult(hitTestResult, type, userData);
 }
 
-void WebPageProxy::installViewStateChangeCompletionHandler(void (^completionHandler)())
+void WebPageProxy::installActivityStateChangeCompletionHandler(void (^completionHandler)())
 {
     if (!isValid()) {
         completionHandler();
@@ -6487,7 +6487,7 @@ void WebPageProxy::installViewStateChangeCompletionHandler(void (^completionHand
         Block_release(copiedCompletionHandler);
     }, m_process->throttler().backgroundActivityToken());
     uint64_t callbackID = m_callbacks.put(WTFMove(voidCallback));
-    m_nextViewStateChangeCallbacks.append(callbackID);
+    m_nextActivityStateChangeCallbacks.append(callbackID);
 }
 
 void WebPageProxy::handleAcceptedCandidate(WebCore::TextCheckingResult acceptedCandidate)
index 4d9afaa..513a76d 100644 (file)
@@ -60,6 +60,7 @@
 #include "WebPageProxyMessages.h"
 #include "WebPopupMenuProxy.h"
 #include "WebProcessLifetimeTracker.h"
+#include <WebCore/ActivityState.h>
 #include <WebCore/Color.h>
 #include <WebCore/DragActions.h>
 #include <WebCore/EventTrackingRegions.h>
@@ -73,7 +74,6 @@
 #include <WebCore/TextChecking.h>
 #include <WebCore/TextGranularity.h>
 #include <WebCore/UserInterfaceLayoutDirection.h>
-#include <WebCore/ViewState.h>
 #include <WebCore/VisibleSelection.h>
 #include <memory>
 #include <wtf/HashMap.h>
@@ -428,16 +428,16 @@ public:
     void setDelegatesScrolling(bool delegatesScrolling) { m_delegatesScrolling = delegatesScrolling; }
     bool delegatesScrolling() const { return m_delegatesScrolling; }
 
-    enum class ViewStateChangeDispatchMode { Deferrable, Immediate };
-    void viewStateDidChange(WebCore::ViewState::Flags mayHaveChanged, bool wantsSynchronousReply = false, ViewStateChangeDispatchMode = ViewStateChangeDispatchMode::Deferrable);
-    bool isInWindow() const { return m_viewState & WebCore::ViewState::IsInWindow; }
-    void waitForDidUpdateViewState();
-    void didUpdateViewState() { m_waitingForDidUpdateViewState = false; }
+    enum class ActivityStateChangeDispatchMode { Deferrable, Immediate };
+    void activityStateDidChange(WebCore::ActivityState::Flags mayHaveChanged, bool wantsSynchronousReply = false, ActivityStateChangeDispatchMode = ActivityStateChangeDispatchMode::Deferrable);
+    bool isInWindow() const { return m_activityState & WebCore::ActivityState::IsInWindow; }
+    void waitForDidUpdateActivityState();
+    void didUpdateActivityState() { m_waitingForDidUpdateActivityState = false; }
 
     void layerHostingModeDidChange();
 
     WebCore::IntSize viewSize() const;
-    bool isViewVisible() const { return m_viewState & WebCore::ViewState::IsVisible; }
+    bool isViewVisible() const { return m_activityState & WebCore::ActivityState::IsVisible; }
     bool isViewWindowActive() const;
 
     void addMIMETypeWithCustomContentProvider(const String& mimeType);
@@ -1066,7 +1066,7 @@ public:
 
     void* immediateActionAnimationControllerForHitTestResult(RefPtr<API::HitTestResult>, uint64_t, RefPtr<API::Object>);
 
-    void installViewStateChangeCompletionHandler(void(^completionHandler)());
+    void installActivityStateChangeCompletionHandler(void(^completionHandler)());
 
     void handleAcceptedCandidate(WebCore::TextCheckingResult);
     void didHandleAcceptedCandidate();
@@ -1148,7 +1148,7 @@ private:
     WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&);
     void platformInitialize();
 
-    void updateViewState(WebCore::ViewState::Flags flagsToUpdate = WebCore::ViewState::AllFlags);
+    void updateActivityState(WebCore::ActivityState::Flags flagsToUpdate = WebCore::ActivityState::AllFlags);
     void updateThrottleState();
     void updateHiddenPageThrottlingAutoIncreases();
 
@@ -1533,7 +1533,7 @@ private:
 
     WebPreferencesStore preferencesStore() const;
 
-    void dispatchViewStateChange();
+    void dispatchActivityStateChange();
     void viewDidLeaveWindow();
     void viewDidEnterWindow();
 
@@ -1658,7 +1658,7 @@ private:
 
     UserMediaPermissionRequestManagerProxy m_userMediaPermissionRequestManager;
 
-    WebCore::ViewState::Flags m_viewState;
+    WebCore::ActivityState::Flags m_activityState;
     bool m_viewWasEverInWindow;
 #if PLATFORM(IOS)
     bool m_allowsMediaDocumentInlinePlayback { false };
@@ -1860,14 +1860,14 @@ private:
     WebCore::MediaProducer::MutedStateFlags m_mutedState { WebCore::MediaProducer::NoneMuted };
     bool m_mayStartMediaWhenInWindow;
 
-    bool m_waitingForDidUpdateViewState;
+    bool m_waitingForDidUpdateActivityState;
 
     bool m_shouldScaleViewToFitDocument { false };
     bool m_suppressAutomaticNavigationSnapshotting { false };
 
 #if PLATFORM(COCOA)
     HashMap<String, String> m_temporaryPDFFiles;
-    std::unique_ptr<WebCore::RunLoopObserver> m_viewStateChangeDispatcher;
+    std::unique_ptr<WebCore::RunLoopObserver> m_activityStateChangeDispatcher;
 
     std::unique_ptr<RemoteLayerTreeScrollingPerformanceData> m_scrollingPerformanceData;
     bool m_scrollPerformanceDataCollectionEnabled;
@@ -1882,9 +1882,9 @@ private:
     uint64_t m_navigationID;
 
     WebPreferencesStore::ValueMap m_configurationPreferenceValues;
-    WebCore::ViewState::Flags m_potentiallyChangedViewStateFlags;
-    bool m_viewStateChangeWantsSynchronousReply;
-    Vector<uint64_t> m_nextViewStateChangeCallbacks;
+    WebCore::ActivityState::Flags m_potentiallyChangedActivityStateFlags;
+    bool m_activityStateChangeWantsSynchronousReply;
+    Vector<uint64_t> m_nextActivityStateChangeCallbacks;
 
     WebCore::MediaProducer::MediaStateFlags m_mediaState { WebCore::MediaProducer::IsNotPlaying };
 
index bff5f96..470a80a 100644 (file)
@@ -407,7 +407,7 @@ messages -> WebPageProxy {
     FindPlugin(String mimeType, uint32_t processType, String urlString, String frameURLString, String pageURLString, bool allowOnlyApplicationPlugins) -> (uint64_t pluginProcessToken, String newMIMEType, uint32_t pluginLoadPolicy, String unavailabilityDescription)
 #endif
 
-    DidUpdateViewState()
+    DidUpdateActivityState()
 
     DidSaveToPageCache()
 
index b01a4eb..fd0754d 100644 (file)
@@ -715,7 +715,7 @@ void WebProcessProxy::releasePageCache()
 void WebProcessProxy::windowServerConnectionStateChanged()
 {
     for (const auto& page : m_pageMap.values())
-        page->viewStateDidChange(ViewState::IsVisuallyIdle);
+        page->activityStateDidChange(ActivityState::IsVisuallyIdle);
 }
 
 void WebProcessProxy::fetchWebsiteData(SessionID sessionID, OptionSet<WebsiteDataType> dataTypes, Function<void (WebsiteData)> completionHandler)
index d7f7b47..9f89f3e 100644 (file)
@@ -30,6 +30,7 @@
 #if USE(COORDINATED_GRAPHICS)
 #include "APIPageConfiguration.h"
 #include "AcceleratedDrawingAreaProxy.h"
+#include "ActivityState.h"
 #include "CoordinatedGraphicsScene.h"
 #include "CoordinatedLayerTreeHostProxy.h"
 #include "DownloadManagerEfl.h"
@@ -38,7 +39,6 @@
 #include "InputMethodContextEfl.h"
 #include "NativeWebMouseEvent.h"
 #include "NotImplemented.h"
-#include "ViewState.h"
 #include "WebBackForwardList.h"
 #include "WebBackForwardListItem.h"
 #include "WebContextMenuProxyEfl.h"
index 1e89cb9..10eaedc 100644 (file)
@@ -602,7 +602,7 @@ static void storeAccessibilityRemoteConnectionInformation(id element, pid_t pid,
 - (void)_applicationDidEnterBackground
 {
     _page->applicationDidEnterBackground();
-    _page->viewStateDidChange(ViewState::AllFlags & ~ViewState::IsInWindow);
+    _page->activityStateDidChange(ActivityState::AllFlags & ~ActivityState::IsInWindow);
 }
 
 - (void)_applicationDidCreateWindowContext
@@ -619,7 +619,7 @@ static void storeAccessibilityRemoteConnectionInformation(id element, pid_t pid,
 - (void)_applicationWillEnterForeground
 {
     _page->applicationWillEnterForeground();
-    _page->viewStateDidChange(ViewState::AllFlags & ~ViewState::IsInWindow, true, WebPageProxy::ViewStateChangeDispatchMode::Immediate);
+    _page->activityStateDidChange(ActivityState::AllFlags & ~ActivityState::IsInWindow, true, WebPageProxy::ActivityStateChangeDispatchMode::Immediate);
 }
 
 - (void)_applicationDidBecomeActive:(NSNotification*)notification
index 1eaed8c..dcac69f 100644 (file)
@@ -878,7 +878,7 @@ static NSStringCompareOptions stringCompareOptions(_WKFindOptions options)
 - (void)_applicationDidEnterBackground
 {
     _webView->_page->applicationDidEnterBackground();
-    _webView->_page->viewStateDidChange(ViewState::AllFlags & ~ViewState::IsInWindow);
+    _webView->_page->activityStateDidChange(ActivityState::AllFlags & ~ActivityState::IsInWindow);
 }
 
 - (void)_applicationDidCreateWindowContext
@@ -895,7 +895,7 @@ static NSStringCompareOptions stringCompareOptions(_WKFindOptions options)
     _webView->_page->applicationWillEnterForeground();
     if (auto drawingArea = _webView->_page->drawingArea())
         drawingArea->hideContentUntilAnyUpdate();
-    _webView->_page->viewStateDidChange(ViewState::AllFlags & ~ViewState::IsInWindow, true, WebPageProxy::ViewStateChangeDispatchMode::Immediate);
+    _webView->_page->activityStateDidChange(ActivityState::AllFlags & ~ActivityState::IsInWindow, true, WebPageProxy::ActivityStateChangeDispatchMode::Immediate);
 }
 
 @end
index 62bd24c..b25f54a 100644 (file)
@@ -303,7 +303,7 @@ void WebPageProxy::synchronizeDynamicViewportUpdate()
     // If m_dynamicViewportSizeUpdateWaitingForTarget is false, we are waiting for the next valid frame with the hope it is the one for the new target.
     // If m_dynamicViewportSizeUpdateWaitingForTarget is still true, this is a desperate attempt to get the valid frame before finishing the animation.
     if (m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit)
-        m_drawingArea->waitForDidUpdateViewState();
+        m_drawingArea->waitForDidUpdateActivityState();
 
     m_dynamicViewportSizeUpdateWaitingForTarget = false;
     m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit = false;
index 0063c08..f161e48 100644 (file)
@@ -73,7 +73,7 @@ private:
     void updateDebugIndicatorPosition();
     void initializeDebugIndicator();
 
-    void waitForDidUpdateViewState() override;
+    void waitForDidUpdateActivityState() override;
     void hideContentUntilPendingUpdate() override;
     void hideContentUntilAnyUpdate() override;
     bool hasVisibleContent() const override;
index 25e1acf..5654bf8 100644 (file)
@@ -418,18 +418,18 @@ void RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay(double)
 
     m_lastVisibleTransactionID = m_transactionIDForPendingCACommit;
 
-    m_webPageProxy.didUpdateViewState();
+    m_webPageProxy.didUpdateActivityState();
 }
 
-void RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState()
+void RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState()
 {
     // We must send the didUpdate message before blocking on the next commit, otherwise
     // we can be guaranteed that the next commit won't come until after the waitForAndDispatchImmediately times out.
     if (m_didUpdateMessageState != DoesNotNeedDidUpdate)
         didRefreshDisplay(monotonicallyIncreasingTime());
 
-    static std::chrono::milliseconds viewStateUpdateTimeout = [] {
-        if (id value = [[NSUserDefaults standardUserDefaults] objectForKey:@"WebKitOverrideViewStateUpdateTimeout"])
+    static std::chrono::milliseconds activityStateUpdateTimeout = [] {
+        if (id value = [[NSUserDefaults standardUserDefaults] objectForKey:@"WebKitOverrideActivityStateUpdateTimeout"])
             return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::duration<double>([value doubleValue]));
 
 #if PLATFORM(IOS)
@@ -438,7 +438,7 @@ void RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState()
         return std::chrono::milliseconds(250);
 #endif
     }();
-    m_webPageProxy.process().connection()->waitForAndDispatchImmediately<Messages::RemoteLayerTreeDrawingAreaProxy::CommitLayerTree>(m_webPageProxy.pageID(), viewStateUpdateTimeout, IPC::WaitForOption::InterruptWaitingIfSyncMessageArrives);
+    m_webPageProxy.process().connection()->waitForAndDispatchImmediately<Messages::RemoteLayerTreeDrawingAreaProxy::CommitLayerTree>(m_webPageProxy.pageID(), activityStateUpdateTimeout, IPC::WaitForOption::InterruptWaitingIfSyncMessageArrives);
 }
 
 void RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing(std::function<void (CallbackBase::Error)> callbackFunction)
index 9ceeedc..3d5aef1 100644 (file)
@@ -52,7 +52,7 @@ private:
     void adjustTransientZoom(double scale, WebCore::FloatPoint origin) override;
     void commitTransientZoom(double scale, WebCore::FloatPoint origin) override;
 
-    void waitForDidUpdateViewState() override;
+    void waitForDidUpdateActivityState() override;
     void dispatchAfterEnsuringDrawing(std::function<void (CallbackBase::Error)>) override;
 
     void willSendUpdateGeometry() override;
index 657b97d..5593167 100644 (file)
@@ -131,10 +131,10 @@ void TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry()
         sendUpdateGeometry();
 }
 
-void TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateViewState()
+void TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState()
 {
-    auto viewStateUpdateTimeout = std::chrono::milliseconds(250);
-    m_webPageProxy.process().connection()->waitForAndDispatchImmediately<Messages::WebPageProxy::DidUpdateViewState>(m_webPageProxy.pageID(), viewStateUpdateTimeout, IPC::WaitForOption::InterruptWaitingIfSyncMessageArrives);
+    auto activityStateUpdateTimeout = std::chrono::milliseconds(250);
+    m_webPageProxy.process().connection()->waitForAndDispatchImmediately<Messages::WebPageProxy::DidUpdateActivityState>(m_webPageProxy.pageID(), activityStateUpdateTimeout, IPC::WaitForOption::InterruptWaitingIfSyncMessageArrives);
 }
 
 void TiledCoreAnimationDrawingAreaProxy::intrinsicContentSizeDidChange(const IntSize& newIntrinsicContentSize)
index 4504342..7ce161f 100644 (file)
@@ -535,14 +535,14 @@ void PluginView::webPageDestroyed()
     m_webPage = 0;
 }
 
-void PluginView::viewStateDidChange(ViewState::Flags changed)
+void PluginView::activityStateDidChange(ActivityState::Flags changed)
 {
     if (!m_plugin || !m_isInitialized)
         return;
 
-    if (changed & ViewState::IsVisibleOrOccluded)
+    if (changed & ActivityState::IsVisibleOrOccluded)
         m_plugin->windowVisibilityChanged(m_webPage->isVisibleOrOccluded());
-    if (changed & ViewState::WindowIsActive)
+    if (changed & ActivityState::WindowIsActive)
         m_plugin->windowFocusChanged(m_webPage->windowIsFocused());
 }
 
index 3068f05..4327ec4 100644 (file)
@@ -31,6 +31,7 @@
 #include "Plugin.h"
 #include "PluginController.h"
 #include "WebFrame.h"
+#include <WebCore/ActivityState.h>
 #include <WebCore/FindOptions.h>
 #include <WebCore/Image.h>
 #include <WebCore/MediaCanStartListener.h>
@@ -39,7 +40,6 @@
 #include <WebCore/ResourceError.h>
 #include <WebCore/ResourceResponse.h>
 #include <WebCore/Timer.h>
-#include <WebCore/ViewState.h>
 #include <memory>
 #include <wtf/Deque.h>
 #include <wtf/RunLoop.h>
@@ -77,7 +77,7 @@ public:
     void manualLoadDidFinishLoading();
     void manualLoadDidFail(const WebCore::ResourceError&);
 
-    void viewStateDidChange(WebCore::ViewState::Flags changed);
+    void activityStateDidChange(WebCore::ActivityState::Flags changed);
     void setLayerHostingMode(LayerHostingMode);
 
 #if PLATFORM(COCOA)
index 1326c10..b878fbc 100644 (file)
@@ -369,9 +369,9 @@ void AcceleratedDrawingArea::destroyNativeSurfaceHandleForCompositing(bool& hand
 }
 #endif
 
-void AcceleratedDrawingArea::viewStateDidChange(ViewState::Flags changed, bool, const Vector<uint64_t>&)
+void AcceleratedDrawingArea::activityStateDidChange(ActivityState::Flags changed, bool, const Vector<uint64_t>&)
 {
-    if (changed & ViewState::IsVisible) {
+    if (changed & ActivityState::IsVisible) {
         if (m_webPage.isVisible())
             resumePainting();
         else
index 6a0ffcb..c84ee38 100644 (file)
@@ -68,7 +68,7 @@ protected:
     void destroyNativeSurfaceHandleForCompositing(bool&) override;
 #endif
 
-    void viewStateDidChange(WebCore::ViewState::Flags, bool /* wantsDidUpdateViewState */, const Vector<uint64_t>& /* callbackIDs */) override;
+    void activityStateDidChange(WebCore::ActivityState::Flags, bool /* wantsDidUpdateActivityState */, const Vector<uint64_t>& /* callbackIDs */) override;
     void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) override;
 
     void layerHostDidFlushLayers() override;
index abeda34..783adec 100644 (file)
 #include "DrawingAreaInfo.h"
 #include "LayerTreeContext.h"
 #include "MessageReceiver.h"
+#include <WebCore/ActivityState.h>
 #include <WebCore/FloatRect.h>
 #include <WebCore/IntRect.h>
 #include <WebCore/LayerFlushThrottleState.h>
 #include <WebCore/LayoutMilestones.h>
 #include <WebCore/PlatformScreen.h>
-#include <WebCore/ViewState.h>
 #include <functional>
 #include <wtf/Forward.h>
 #include <wtf/Noncopyable.h>
@@ -120,7 +120,7 @@ public:
 
     virtual void dispatchAfterEnsuringUpdatedScrollPosition(std::function<void ()>);
 
-    virtual void viewStateDidChange(WebCore::ViewState::Flags, bool /* wantsDidUpdateViewState */, const Vector<uint64_t>& /* callbackIDs */) { }
+    virtual void activityStateDidChange(WebCore::ActivityState::Flags, bool /* wantsDidUpdateActivityState */, const Vector<uint64_t>& /* callbackIDs */) { }
     virtual void setLayerHostingMode(LayerHostingMode) { }
 
     virtual bool markLayersVolatileImmediatelyIfPossible() { return true; }
index 95a7a98..22bfded 100644 (file)
@@ -376,7 +376,7 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
     , m_maximumRenderingSuppressionToken(0)
     , m_scrollPinningBehavior(DoNotPin)
     , m_useAsyncScrolling(false)
-    , m_viewState(parameters.viewState)
+    , m_activityState(parameters.activityState)
     , m_userActivity("Process suppression disabled for page.")
     , m_userActivityHysteresis([this](HysteresisState) { updateUserActivity(); })
     , m_pendingNavigationID(0)
@@ -493,7 +493,7 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
     setPaginationLineGridEnabled(parameters.paginationLineGridEnabled);
     
     // If the page is created off-screen, its visibilityState should be prerender.
-    m_page->setViewState(m_viewState);
+    m_page->setActivityState(m_activityState);
     if (!isVisible())
         m_page->setIsPrerender();
     setPageSuppressed(false);
@@ -575,8 +575,8 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
 
 void WebPage::reinitializeWebPage(const WebPageCreationParameters& parameters)
 {
-    if (m_viewState != parameters.viewState)
-        setViewState(parameters.viewState, false, Vector<uint64_t>());
+    if (m_activityState != parameters.activityState)
+        setActivityState(parameters.activityState, false, Vector<uint64_t>());
     if (m_layerHostingMode != parameters.layerHostingMode)
         setLayerHostingMode(parameters.layerHostingMode);
 }
@@ -2567,7 +2567,7 @@ void WebPage::setCanStartMediaTimerFired()
 
 void WebPage::updateIsInWindow(bool isInitialState)
 {
-    bool isInWindow = m_viewState & WebCore::ViewState::IsInWindow;
+    bool isInWindow = m_activityState & WebCore::ActivityState::IsInWindow;
 
     if (!isInWindow) {
         m_setCanStartMediaTimer.stop();
@@ -2590,18 +2590,18 @@ void WebPage::updateIsInWindow(bool isInitialState)
         layoutIfNeeded();
 }
 
-void WebPage::setViewState(ViewState::Flags viewState, bool wantsDidUpdateViewState, const Vector<uint64_t>& callbackIDs)
+void WebPage::setActivityState(ActivityState::Flags activityState, bool wantsDidUpdateActivityState, const Vector<uint64_t>& callbackIDs)
 {
-    ViewState::Flags changed = m_viewState ^ viewState;
-    m_viewState = viewState;
+    ActivityState::Flags changed = m_activityState ^ activityState;
+    m_activityState = activityState;
 
-    m_page->setViewState(viewState);
+    m_page->setActivityState(activityState);
     for (auto* pluginView : m_pluginViews)
-        pluginView->viewStateDidChange(changed);
+        pluginView->activityStateDidChange(changed);
 
-    m_drawingArea->viewStateDidChange(changed, wantsDidUpdateViewState, callbackIDs);
+    m_drawingArea->activityStateDidChange(changed, wantsDidUpdateActivityState, callbackIDs);
 
-    if (changed & ViewState::IsInWindow)
+    if (changed & ActivityState::IsInWindow)
         updateIsInWindow();
 }
 
index 74a2625..e36ab5f 100644 (file)
@@ -48,6 +48,7 @@
 #include "ShareableBitmap.h"
 #include "UserData.h"
 #include "UserMediaPermissionRequestManager.h"
+#include <WebCore/ActivityState.h>
 #include <WebCore/DictationAlternative.h>
 #include <WebCore/DictionaryPopupInfo.h>
 #include <WebCore/DragData.h>
@@ -68,7 +69,6 @@
 #include <WebCore/UserContentTypes.h>
 #include <WebCore/UserInterfaceLayoutDirection.h>
 #include <WebCore/UserScriptTypes.h>
-#include <WebCore/ViewState.h>
 #include <WebCore/ViewportConfiguration.h>
 #include <WebCore/WebCoreKeyboardUIMode.h>
 #include <memory>
@@ -436,8 +436,8 @@ public:
     void addPluginView(PluginView*);
     void removePluginView(PluginView*);
 
-    bool isVisible() const { return m_viewState & WebCore::ViewState::IsVisible; }
-    bool isVisibleOrOccluded() const { return m_viewState & WebCore::ViewState::IsVisibleOrOccluded; }
+    bool isVisible() const { return m_activityState & WebCore::ActivityState::IsVisible; }
+    bool isVisibleOrOccluded() const { return m_activityState & WebCore::ActivityState::IsVisibleOrOccluded; }
 
     LayerHostingMode layerHostingMode() const { return m_layerHostingMode; }
     void setLayerHostingMode(LayerHostingMode);
@@ -1041,7 +1041,7 @@ private:
     void tryRestoreScrollPosition();
     void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&, uint64_t callbackID);
     void updateIsInWindow(bool isInitialState = false);
-    void setViewState(WebCore::ViewState::Flags, bool wantsDidUpdateViewState, const Vector<uint64_t>& callbackIDs);
+    void setActivityState(WebCore::ActivityState::Flags, bool wantsDidUpdateActivityState, const Vector<uint64_t>& callbackIDs);
     void validateCommand(const String&, uint64_t);
     void executeEditCommand(const String&, const String&);
     void setEditable(bool);
@@ -1485,7 +1485,7 @@ private:
 
     bool m_useAsyncScrolling;
 
-    WebCore::ViewState::Flags m_viewState;
+    WebCore::ActivityState::Flags m_activityState;
 
     UserActivity m_userActivity;
     WebCore::HysteresisActivity m_userActivityHysteresis;
index 5a3eb19..a31c646 100644 (file)
@@ -22,7 +22,7 @@
 
 messages -> WebPage LegacyReceiver {
     SetInitialFocus(bool forward, bool isKeyboardEventValid, WebKit::WebKeyboardEvent event, uint64_t callbackID)
-    SetViewState(unsigned viewState, bool wantsDidUpdateViewState, Vector<uint64_t> callbackIDs)
+    SetActivityState(unsigned activityState, bool wantsDidUpdateActivityState, Vector<uint64_t> callbackIDs)
     SetLayerHostingMode(enum WebKit::LayerHostingMode layerHostingMode)
     SetPageSuppressed(bool pageSuppressed)
 
index 7877931..f3465d2 100644 (file)
@@ -102,7 +102,7 @@ private:
 
     void mainFrameContentSizeChanged(const WebCore::IntSize&) override;
 
-    void viewStateDidChange(WebCore::ViewState::Flags changed, bool wantsDidUpdateViewState, const Vector<uint64_t>& callbackIDs) override;
+    void activityStateDidChange(WebCore::ActivityState::Flags changed, bool wantsDidUpdateActivityState, const Vector<uint64_t>& callbackIDs) override;
 
     bool adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags) override;
 
index 7702f26..41e2be4 100644 (file)
@@ -497,11 +497,11 @@ void RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush()
     m_connection->sendMessage(WTFMove(m_commitEncoder), { });
 }
 
-void RemoteLayerTreeDrawingArea::viewStateDidChange(ViewState::Flags, bool wantsDidUpdateViewState, const Vector<uint64_t>&)
+void RemoteLayerTreeDrawingArea::activityStateDidChange(ActivityState::Flags, bool wantsDidUpdateActivityState, const Vector<uint64_t>&)
 {
     // FIXME: Should we suspend painting while not visible, like TiledCoreAnimationDrawingArea? Probably.
 
-    if (wantsDidUpdateViewState)
+    if (wantsDidUpdateActivityState)
         scheduleCompositingLayerFlushImmediately();
 }
 
index 5131ef0..aa220fc 100644 (file)
@@ -81,8 +81,8 @@ private:
 
     bool shouldUseTiledBackingForFrameView(const WebCore::FrameView*) override;
 
-    void viewStateDidChange(WebCore::ViewState::Flags changed, bool wantsDidUpdateViewState, const Vector<uint64_t>&) override;
-    void didUpdateViewStateTimerFired();
+    void activityStateDidChange(WebCore::ActivityState::Flags changed, bool wantsDidUpdateActivityState, const Vector<uint64_t>&) override;
+    void didUpdateActivityStateTimerFired();
 
     void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) override;
 
@@ -146,9 +146,9 @@ private:
 
     WebCore::TransformationMatrix m_transform;
 
-    RunLoop::Timer<TiledCoreAnimationDrawingArea> m_sendDidUpdateViewStateTimer;
-    Vector<uint64_t> m_nextViewStateChangeCallbackIDs;
-    bool m_wantsDidUpdateViewState;
+    RunLoop::Timer<TiledCoreAnimationDrawingArea> m_sendDidUpdateActivityStateTimer;
+    Vector<uint64_t> m_nextActivityStateChangeCallbackIDs;
+    bool m_wantsDidUpdateActivityState;
 
     WebCore::GraphicsLayer* m_viewOverlayRootLayer;
 
index ad0adb2..c838581 100644 (file)
@@ -77,10 +77,10 @@ TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea(WebPage& webPage, c
     : DrawingArea(DrawingAreaTypeTiledCoreAnimation, webPage)
     , m_layerTreeStateIsFrozen(false)
     , m_layerFlushScheduler(this)
-    , m_isPaintingSuspended(!(parameters.viewState & ViewState::IsVisible))
+    , m_isPaintingSuspended(!(parameters.activityState & ActivityState::IsVisible))
     , m_transientZoomScale(1)
-    , m_sendDidUpdateViewStateTimer(RunLoop::main(), this, &TiledCoreAnimationDrawingArea::didUpdateViewStateTimerFired)
-    , m_wantsDidUpdateViewState(false)
+    , m_sendDidUpdateActivityStateTimer(RunLoop::main(), this, &TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired)
+    , m_wantsDidUpdateActivityState(false)
     , m_viewOverlayRootLayer(nullptr)
 {
     m_webPage.corePage()->settings().setForceCompositingMode(true);
@@ -447,34 +447,34 @@ bool TiledCoreAnimationDrawingArea::flushLayers()
     }
 }
 
-void TiledCoreAnimationDrawingArea::viewStateDidChange(ViewState::Flags changed, bool wantsDidUpdateViewState, const Vector<uint64_t>& nextViewStateChangeCallbackIDs)
+void TiledCoreAnimationDrawingArea::activityStateDidChange(ActivityState::Flags changed, bool wantsDidUpdateActivityState, const Vector<uint64_t>& nextActivityStateChangeCallbackIDs)
 {
-    m_nextViewStateChangeCallbackIDs.appendVector(nextViewStateChangeCallbackIDs);
-    m_wantsDidUpdateViewState |= wantsDidUpdateViewState;
+    m_nextActivityStateChangeCallbackIDs.appendVector(nextActivityStateChangeCallbackIDs);
+    m_wantsDidUpdateActivityState |= wantsDidUpdateActivityState;
 
-    if (changed & ViewState::IsVisible) {
+    if (changed & ActivityState::IsVisible) {
         if (m_webPage.isVisible())
             resumePainting();
         else
             suspendPainting();
     }
 
-    if (m_wantsDidUpdateViewState || !m_nextViewStateChangeCallbackIDs.isEmpty())
-        m_sendDidUpdateViewStateTimer.startOneShot(0);
+    if (m_wantsDidUpdateActivityState || !m_nextActivityStateChangeCallbackIDs.isEmpty())
+        m_sendDidUpdateActivityStateTimer.startOneShot(0);
 }
 
-void TiledCoreAnimationDrawingArea::didUpdateViewStateTimerFired()
+void TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired()
 {
     [CATransaction flush];
 
-    if (m_wantsDidUpdateViewState)
-        m_webPage.send(Messages::WebPageProxy::DidUpdateViewState());
+    if (m_wantsDidUpdateActivityState)
+        m_webPage.send(Messages::WebPageProxy::DidUpdateActivityState());
 
-    for (uint64_t callbackID : m_nextViewStateChangeCallbackIDs)
+    for (uint64_t callbackID : m_nextActivityStateChangeCallbackIDs)
         m_webPage.send(Messages::WebPageProxy::VoidCallback(callbackID));
 
-    m_nextViewStateChangeCallbackIDs.clear();
-    m_wantsDidUpdateViewState = false;
+    m_nextActivityStateChangeCallbackIDs.clear();
+    m_wantsDidUpdateActivityState = false;
 }
 
 void TiledCoreAnimationDrawingArea::suspendPainting()