Add a WebKit2 logging channel for ActivityState
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Aug 2018 19:06:43 +0000 (19:06 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Aug 2018 19:06:43 +0000 (19:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188411

Reviewed by Tim Horton.
Source/WebCore:

Add logging for ActivityState changes and the entrypoints that affect ActivityState.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/ActivityState.cpp: Added.
(WebCore::activityStateFlagsToString):
* page/ActivityState.h:

Source/WebKit:

Add logging for ActivityState changes and the entrypoints that affect ActivityState.

* Platform/Logging.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::windowDidOrderOffScreen):
(WebKit::WebViewImpl::windowDidOrderOnScreen):
(WebKit::WebViewImpl::windowDidChangeOcclusionState):
(WebKit::WebViewImpl::viewDidMoveToWindow):
(WebKit::WebViewImpl::viewDidHide):
(WebKit::WebViewImpl::viewDidUnhide):
(WebKit::WebViewImpl::activeSpaceDidChange):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::activityStateDidChange):
(WebKit::WebPageProxy::dispatchActivityStateChange):
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::isViewVisible):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setActivityState):

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

Source/WebCore/ChangeLog
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/page/ActivityState.cpp [new file with mode: 0644]
Source/WebCore/page/ActivityState.h
Source/WebKit/ChangeLog
Source/WebKit/Platform/Logging.h
Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/mac/PageClientImplMac.mm
Source/WebKit/WebProcess/WebPage/WebPage.cpp

index 385adbe..0db9414 100644 (file)
@@ -1,3 +1,18 @@
+2018-08-08  Simon Fraser  <simon.fraser@apple.com>
+
+        Add a WebKit2 logging channel for ActivityState
+        https://bugs.webkit.org/show_bug.cgi?id=188411
+
+        Reviewed by Tim Horton.
+
+        Add logging for ActivityState changes and the entrypoints that affect ActivityState.
+        
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * page/ActivityState.cpp: Added.
+        (WebCore::activityStateFlagsToString):
+        * page/ActivityState.h:
+
 2018-08-08  Eric Carlson  <eric.carlson@apple.com>
 
         Add LogArgument template for PlatformMediaSession::RemoteControlCommandType
index 7941575..379275f 100644 (file)
@@ -1349,6 +1349,7 @@ mathml/MathMLUnknownElement.cpp
 
 page/AbstractDOMWindow.cpp
 page/AbstractFrame.cpp
+page/ActivityState.cpp
 page/AutoscrollController.cpp
 page/BarProp.cpp
 page/Base64Utilities.cpp
index 68116d7..8f3a917 100644 (file)
                0F6383DC18615B29003E5DB5 /* ThreadedScrollingTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadedScrollingTree.h; sourceTree = "<group>"; };
                0F6A12BB1A00923700C6DE72 /* DebugPageOverlays.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DebugPageOverlays.cpp; sourceTree = "<group>"; };
                0F6A12BC1A00923700C6DE72 /* DebugPageOverlays.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugPageOverlays.h; sourceTree = "<group>"; };
+               0F70495D211B524200369968 /* ActivityState.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ActivityState.cpp; sourceTree = "<group>"; };
                0F7DF1471E2BF1A60095951B /* WebCoreJSClientData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreJSClientData.cpp; sourceTree = "<group>"; };
                0F850FE21ED7C18300FB77A7 /* PerformanceLoggingClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceLoggingClient.h; sourceTree = "<group>"; };
                0F87166D1C869D83004FF0DE /* LengthPoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LengthPoint.cpp; sourceTree = "<group>"; };
                11EA57FB20FFAFB600311EBB /* SimpleTextRunGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleTextRunGenerator.cpp; sourceTree = "<group>"; };
                11EA57FC20FFAFB700311EBB /* SimpleTextRunGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleTextRunGenerator.h; sourceTree = "<group>"; };
                11FF02D520BA3C810083F25B /* Verification.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Verification.cpp; sourceTree = "<group>"; };
+               12F75A9A86EA03DAF24B7971 /* ISOProtectionSystemSpecificHeaderBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISOProtectionSystemSpecificHeaderBox.h; sourceTree = "<group>"; };
                1400D7A717136EA70077CE05 /* ScriptWrappableInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptWrappableInlines.h; sourceTree = "<group>"; };
                1402645D0AFDC19B005919E2 /* LoggingMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = LoggingMac.mm; sourceTree = "<group>"; };
                1403B90C09EB124500797C7F /* DOMWindow.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMWindow.idl; sourceTree = "<group>"; };
                450CEBEF15073BBE002BB149 /* LabelableElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelableElement.h; sourceTree = "<group>"; };
                4512502015DCE37D002F84E2 /* SpinButtonElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpinButtonElement.cpp; sourceTree = "<group>"; };
                4512502115DCE37D002F84E2 /* SpinButtonElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpinButtonElement.h; sourceTree = "<group>"; };
+               451A49F8F8726BE071518BE2 /* ISOProtectionSystemSpecificHeaderBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ISOProtectionSystemSpecificHeaderBox.cpp; sourceTree = "<group>"; };
                453EB635159C570400001BB7 /* DateTimeFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateTimeFormat.h; sourceTree = "<group>"; };
                45830D4B1679B4F800ACF8C3 /* AutoscrollController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AutoscrollController.cpp; sourceTree = "<group>"; };
                45830D4C1679B4F800ACF8C3 /* AutoscrollController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutoscrollController.h; sourceTree = "<group>"; };
                CD871C621FB52B6500F0B965 /* ISOBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISOBox.h; sourceTree = "<group>"; };
                CD871C631FB52B6600F0B965 /* ISOSchemeInformationBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ISOSchemeInformationBox.cpp; sourceTree = "<group>"; };
                CD871C641FB52B6700F0B965 /* ISOSchemeInformationBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISOSchemeInformationBox.h; sourceTree = "<group>"; };
-               451A49F8F8726BE071518BE2 /* ISOProtectionSystemSpecificHeaderBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ISOProtectionSystemSpecificHeaderBox.cpp; sourceTree = "<group>"; };
-               12F75A9A86EA03DAF24B7971 /* ISOProtectionSystemSpecificHeaderBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISOProtectionSystemSpecificHeaderBox.h; sourceTree = "<group>"; };
                CD871C651FB52B6700F0B965 /* ISOVTTCue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISOVTTCue.h; sourceTree = "<group>"; };
                CD871C661FB52B6800F0B965 /* ISOTrackEncryptionBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISOTrackEncryptionBox.h; sourceTree = "<group>"; };
                CD871C671FB52B6800F0B965 /* ISOOriginalFormatBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ISOOriginalFormatBox.h; sourceTree = "<group>"; };
                                46B9518A207D632800A7D2DD /* AbstractDOMWindow.h */,
                                46B95194207D633000A7D2DD /* AbstractFrame.cpp */,
                                46B9518F207D632B00A7D2DD /* AbstractFrame.h */,
+                               0F70495D211B524200369968 /* ActivityState.cpp */,
                                724EE54E1DC7F25B00A91FFB /* ActivityState.h */,
                                724EE54F1DC7F25B00A91FFB /* ActivityStateChangeObserver.h */,
                                BCF48CE61370D114004E87D6 /* AdjustViewSizeOrNot.h */,
diff --git a/Source/WebCore/page/ActivityState.cpp b/Source/WebCore/page/ActivityState.cpp
new file mode 100644 (file)
index 0000000..609aa1e
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ActivityState.h"
+
+#include <wtf/text/StringBuilder.h>
+
+namespace WebCore {
+
+String activityStateFlagsToString(ActivityState::Flags flags)
+{
+    StringBuilder builder;
+    
+    auto appendCommaIfNecessary = [&]() {
+        if (!builder.isEmpty())
+            builder.append(", ");
+    };
+    
+    if (flags & WebCore::ActivityState::WindowIsActive) {
+        appendCommaIfNecessary();
+        builder.append("active window");
+    }
+
+    if (flags & WebCore::ActivityState::IsFocused) {
+        appendCommaIfNecessary();
+        builder.append("focused");
+    }
+
+    if (flags & WebCore::ActivityState::IsVisible) {
+        appendCommaIfNecessary();
+        builder.append("visible");
+    }
+
+    if (flags & WebCore::ActivityState::IsVisibleOrOccluded) {
+        appendCommaIfNecessary();
+        builder.append("visible or occluded");
+    }
+
+    if (flags & WebCore::ActivityState::IsInWindow) {
+        appendCommaIfNecessary();
+        builder.append("in-window");
+    }
+
+    if (flags & WebCore::ActivityState::IsVisuallyIdle) {
+        appendCommaIfNecessary();
+        builder.append("visually idle");
+    }
+
+    if (flags & WebCore::ActivityState::IsAudible) {
+        appendCommaIfNecessary();
+        builder.append("audible");
+    }
+
+    if (flags & WebCore::ActivityState::IsLoading) {
+        appendCommaIfNecessary();
+        builder.append("loading");
+    }
+
+    if (flags & WebCore::ActivityState::IsCapturingMedia) {
+        appendCommaIfNecessary();
+        builder.append("capturing media");
+    }
+    
+    return builder.toString();
+}
+
+} // namespace WebCore
index 72035dc..dea4032 100644 (file)
 
 #pragma once
 
+namespace WTF {
+class String;
+}
+
 namespace WebCore {
 
 struct ActivityState {
@@ -52,4 +56,7 @@ enum class ActivityStateForCPUSampling {
     VisibleAndActive
 };
 
+// Ideally this would be operator<<(WTF::TextStream&, ActivityState::Flags) but ActivityState::Flags needs to be strongly typed to avoid ambiguous overloads.
+WEBCORE_EXPORT WTF::String activityStateFlagsToString(ActivityState::Flags);
+
 } // namespace WebCore
index a8463f5..1e56415 100644 (file)
@@ -1,3 +1,29 @@
+2018-08-08  Simon Fraser  <simon.fraser@apple.com>
+
+        Add a WebKit2 logging channel for ActivityState
+        https://bugs.webkit.org/show_bug.cgi?id=188411
+
+        Reviewed by Tim Horton.
+        
+        Add logging for ActivityState changes and the entrypoints that affect ActivityState.
+
+        * Platform/Logging.h:
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::windowDidOrderOffScreen):
+        (WebKit::WebViewImpl::windowDidOrderOnScreen):
+        (WebKit::WebViewImpl::windowDidChangeOcclusionState):
+        (WebKit::WebViewImpl::viewDidMoveToWindow):
+        (WebKit::WebViewImpl::viewDidHide):
+        (WebKit::WebViewImpl::viewDidUnhide):
+        (WebKit::WebViewImpl::activeSpaceDidChange):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::activityStateDidChange):
+        (WebKit::WebPageProxy::dispatchActivityStateChange):
+        * UIProcess/mac/PageClientImplMac.mm:
+        (WebKit::PageClientImpl::isViewVisible):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::setActivityState):
+
 2018-08-05  Darin Adler  <darin@apple.com>
 
         [Cocoa] More tweaks and refactoring to prepare for ARC
index b9765d8..da7ca58 100644 (file)
@@ -40,6 +40,7 @@ extern "C" {
 #endif
 
 #define WEBKIT2_LOG_CHANNELS(M) \
+    M(ActivityState) \
     M(BackForward) \
     M(CacheStorage) \
     M(ContextMenu) \
index 35a14ef..180989d 100644 (file)
@@ -1890,11 +1890,13 @@ float WebViewImpl::intrinsicDeviceScaleFactor() const
 
 void WebViewImpl::windowDidOrderOffScreen()
 {
+    LOG(ActivityState, "WebViewImpl %p (page %llu) windowDidOrderOffScreen", this, m_page->pageID());
     m_page->activityStateDidChange(WebCore::ActivityState::IsVisible | WebCore::ActivityState::WindowIsActive);
 }
 
 void WebViewImpl::windowDidOrderOnScreen()
 {
+    LOG(ActivityState, "WebViewImpl %p (page %llu) windowDidOrderOnScreen", this, m_page->pageID());
     m_page->activityStateDidChange(WebCore::ActivityState::IsVisible | WebCore::ActivityState::WindowIsActive);
 }
 
@@ -1962,6 +1964,7 @@ void WebViewImpl::windowDidChangeLayerHosting()
 
 void WebViewImpl::windowDidChangeOcclusionState()
 {
+    LOG(ActivityState, "WebViewImpl %p (page %llu) windowDidChangeOcclusionState", this, m_page->pageID());
     m_page->activityStateDidChange(WebCore::ActivityState::IsVisible);
 }
 
@@ -2055,6 +2058,8 @@ void WebViewImpl::viewDidMoveToWindow()
 {
     NSWindow *window = m_targetWindowForMovePreparation ? m_targetWindowForMovePreparation : [m_view window];
 
+    LOG(ActivityState, "WebViewImpl %p viewDidMoveToWindow %p", this, window);
+
     if (window) {
         windowDidChangeScreen();
 
@@ -2119,16 +2124,19 @@ void WebViewImpl::viewDidChangeBackingProperties()
 
 void WebViewImpl::viewDidHide()
 {
+    LOG(ActivityState, "WebViewImpl %p (page %llu) viewDidHide", this, m_page->pageID());
     m_page->activityStateDidChange(WebCore::ActivityState::IsVisible);
 }
 
 void WebViewImpl::viewDidUnhide()
 {
+    LOG(ActivityState, "WebViewImpl %p (page %llu) viewDidUnhide", this, m_page->pageID());
     m_page->activityStateDidChange(WebCore::ActivityState::IsVisible);
 }
 
 void WebViewImpl::activeSpaceDidChange()
 {
+    LOG(ActivityState, "WebViewImpl %p (page %llu) activeSpaceDidChange", this, m_page->pageID());
     m_page->activityStateDidChange(WebCore::ActivityState::IsVisible);
 }
 
index ee5f25a..7a6f275 100644 (file)
 #include <wtf/NeverDestroyed.h>
 #include <wtf/SystemTracing.h>
 #include <wtf/text/StringView.h>
+#include <wtf/text/TextStream.h>
 
 #if ENABLE(APPLICATION_MANIFEST)
 #include "APIApplicationManifest.h"
@@ -1516,6 +1517,8 @@ void WebPageProxy::updateActivityState(ActivityState::Flags flagsToUpdate)
 
 void WebPageProxy::activityStateDidChange(ActivityState::Flags mayHaveChanged, bool wantsSynchronousReply, ActivityStateChangeDispatchMode dispatchMode)
 {
+    LOG_WITH_STREAM(ActivityState, stream << "WebPageProxy " << pageID() << " activityStateDidChange - mayHaveChanged " <<  activityStateFlagsToString(mayHaveChanged));
+
     m_potentiallyChangedActivityStateFlags |= mayHaveChanged;
     m_activityStateChangeWantsSynchronousReply = m_activityStateChangeWantsSynchronousReply || wantsSynchronousReply;
 
@@ -1563,6 +1566,8 @@ void WebPageProxy::dispatchActivityStateChange()
     if (!isValid())
         return;
 
+    LOG_WITH_STREAM(ActivityState, stream << "WebPageProxy " << pageID() << " dispatchActivityStateChange - potentiallyChangedActivityStateFlags " << activityStateFlagsToString(m_potentiallyChangedActivityStateFlags));
+
     // If the visibility state may have changed, then so may the visually idle & occluded agnostic state.
     if (m_potentiallyChangedActivityStateFlags & ActivityState::IsVisible)
         m_potentiallyChangedActivityStateFlags |= ActivityState::IsVisibleOrOccluded | ActivityState::IsVisuallyIdle;
@@ -1573,6 +1578,9 @@ void WebPageProxy::dispatchActivityStateChange()
     updateActivityState(m_potentiallyChangedActivityStateFlags);
     ActivityState::Flags changed = m_activityState ^ previousActivityState;
 
+    if (changed)
+        LOG_WITH_STREAM(ActivityState, stream << "WebPageProxy " << pageID() << " dispatchActivityStateChange: state changed from " << activityStateFlagsToString(previousActivityState) << " to " << activityStateFlagsToString(m_activityState));
+
     if ((m_potentiallyChangedActivityStateFlags & ActivityState::IsVisible) && isViewVisible())
         viewIsBecomingVisible();
 
index 452f580..4798271 100644 (file)
@@ -33,6 +33,7 @@
 #import "DataReference.h"
 #import "DownloadProxy.h"
 #import "DrawingAreaProxy.h"
+#import "Logging.h"
 #import "NativeWebGestureEvent.h"
 #import "NativeWebKeyboardEvent.h"
 #import "NativeWebMouseEvent.h"
@@ -198,6 +199,13 @@ bool PageClientImpl::isViewVisible()
     NSView *activeView = this->activeView();
     NSWindow *activeViewWindow = activeWindow();
 
+    auto windowIsOccluded = [&]()->bool {
+        return m_impl && m_impl->windowOcclusionDetectionEnabled() && (activeViewWindow.occlusionState & NSWindowOcclusionStateVisible) != NSWindowOcclusionStateVisible;
+    };
+
+    LOG_WITH_STREAM(ActivityState, stream << "PageClientImpl " << this << " isViewVisible(): activeViewWindow " << activeViewWindow
+        << " (window visible " << activeViewWindow.isVisible << ", view hidden " << activeView.isHiddenOrHasHiddenAncestor << ", window occluded " << windowIsOccluded() << ")");
+
     if (!activeViewWindow)
         return false;
 
@@ -207,7 +215,7 @@ bool PageClientImpl::isViewVisible()
     if (activeView.isHiddenOrHasHiddenAncestor)
         return false;
 
-    if (m_impl->windowOcclusionDetectionEnabled() && (activeViewWindow.occlusionState & NSWindowOcclusionStateVisible) != NSWindowOcclusionStateVisible)
+    if (windowIsOccluded())
         return false;
 
     return true;
index 9024dfd..d6b9655 100644 (file)
@@ -2796,6 +2796,8 @@ void WebPage::visibilityDidChange()
 
 void WebPage::setActivityState(ActivityState::Flags activityState, ActivityStateChangeID activityStateChangeID, const Vector<CallbackID>& callbackIDs)
 {
+    LOG_WITH_STREAM(ActivityState, stream << "WebPage " << pageID() << " setActivityState to " << activityStateFlagsToString(activityState));
+
     ActivityState::Flags changed = m_activityState ^ activityState;
     m_activityState = activityState;