Diff
Modified: trunk/Source/WebCore/CMakeLists.txt (217736 => 217737)
--- trunk/Source/WebCore/CMakeLists.txt 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/CMakeLists.txt 2017-06-02 23:06:13 UTC (rev 217737)
@@ -2085,6 +2085,7 @@
page/Performance.cpp
page/PerformanceEntry.cpp
page/PerformanceLogging.cpp
+ page/PerformanceLoggingClient.cpp
page/PerformanceMonitor.cpp
page/PerformanceNavigation.cpp
page/PerformanceObserver.cpp
Modified: trunk/Source/WebCore/ChangeLog (217736 => 217737)
--- trunk/Source/WebCore/ChangeLog 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/ChangeLog 2017-06-02 23:06:13 UTC (rev 217737)
@@ -1,3 +1,66 @@
+2017-06-02 Simon Fraser <simon.fra...@apple.com>
+
+ All scroll peformance logging should happen in the UI process
+ https://bugs.webkit.org/show_bug.cgi?id=172874
+ rdar://problem/24474830
+
+ Reviewed by Tim Horton.
+
+ Printing to stdout from the WebProcess doesn't show up anywhere in non-development builds,
+ so we have to log from the UI process.
+
+ Achieve this by adding a PerformanceLoggingClient to Page which forwards messages to
+ WebPageProxy, which prints them with the same format they had before. Some plumbing through
+ PlatformCALayerClient and GraphicsLayerClient is required to get messages from TileControllers
+ through to something that can get to Page.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * page/Page.cpp:
+ (WebCore::Page::Page):
+ (WebCore::Page::~Page):
+ * page/Page.h:
+ (WebCore::Page::performanceLoggingClient):
+ * page/PageConfiguration.cpp:
+ * page/PageConfiguration.h:
+ * page/PerformanceLoggingClient.cpp: Added.
+ (WebCore::PerformanceLoggingClient::synchronousScrollingReasonsAsString):
+ * page/PerformanceLoggingClient.h: Added.
+ (WebCore::PerformanceLoggingClient::~PerformanceLoggingClient):
+ * page/scrolling/AsyncScrollingCoordinator.cpp:
+ (WebCore::AsyncScrollingCoordinator::reportExposedUnfilledArea):
+ (WebCore::AsyncScrollingCoordinator::reportSynchronousScrollingReasonsChanged):
+ * page/scrolling/AsyncScrollingCoordinator.h:
+ * page/scrolling/ScrollingTree.h:
+ (WebCore::ScrollingTree::reportSynchronousScrollingReasonsChanged):
+ (WebCore::ScrollingTree::reportExposedUnfilledArea):
+ * page/scrolling/ThreadedScrollingTree.cpp:
+ (WebCore::ThreadedScrollingTree::reportSynchronousScrollingReasonsChanged):
+ (WebCore::ThreadedScrollingTree::reportExposedUnfilledArea):
+ * page/scrolling/ThreadedScrollingTree.h:
+ * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
+ * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
+ (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
+ (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
+ (WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea):
+ (WebCore::ScrollingTreeFrameScrollingNodeMac::logExposedUnfilledArea): Deleted.
+ (WebCore::logThreadedScrollingMode): Deleted.
+ * platform/graphics/GraphicsLayerClient.h:
+ (WebCore::GraphicsLayerClient::logFilledVisibleFreshTile):
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ (WebCore::GraphicsLayerCA::platformCALayerLogFilledVisibleFreshTile):
+ * platform/graphics/ca/GraphicsLayerCA.h:
+ * platform/graphics/ca/PlatformCALayerClient.h:
+ (WebCore::PlatformCALayerClient::platformCALayerLogFilledVisibleFreshTile):
+ * platform/graphics/ca/TileController.cpp:
+ (WebCore::TileController::logFilledVisibleFreshTile):
+ * platform/graphics/ca/TileController.h:
+ * platform/graphics/ca/TileGrid.cpp:
+ (WebCore::TileGrid::platformCALayerPaintContents):
+ * platform/graphics/ca/TileGrid.h:
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::logFilledVisibleFreshTile):
+ * rendering/RenderLayerBacking.h:
+
2017-06-02 Eric Carlson <eric.carl...@apple.com>
[MediaStream iOS] Cleanup video muting/unmuting when tab visibility changes
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (217736 => 217737)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-06-02 23:06:13 UTC (rev 217737)
@@ -486,6 +486,7 @@
0F6A12BE1A00923700C6DE72 /* DebugPageOverlays.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6A12BC1A00923700C6DE72 /* DebugPageOverlays.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F7D07331884C56C00B4AF86 /* PlatformTextTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 072847E216EBC5B00043CFA4 /* PlatformTextTrack.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F7DF1481E2BF1B10095951B /* WebCoreJSClientData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F7DF1471E2BF1A60095951B /* WebCoreJSClientData.cpp */; };
+ 0F850FE31ED7C18300FB77A7 /* PerformanceLoggingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F850FE21ED7C18300FB77A7 /* PerformanceLoggingClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F87166F1C869D83004FF0DE /* LengthPoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F87166D1C869D83004FF0DE /* LengthPoint.cpp */; };
0F8716701C869D83004FF0DE /* LengthPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F87166E1C869D83004FF0DE /* LengthPoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F8B45721DC3FBA300443C3F /* IntersectionObserverCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8B45711DC3FBA300443C3F /* IntersectionObserverCallback.h */; };
@@ -556,6 +557,7 @@
0FEA3E88191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FEA3E86191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
0FEF20CE1BD4A24100128E5D /* LengthSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEF20CD1BD4A24100128E5D /* LengthSize.cpp */; };
0FEF20D01BD4A64F00128E5D /* RenderStyleConstants.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEF20CF1BD4A64F00128E5D /* RenderStyleConstants.cpp */; };
+ 0FF2E80D1EE0D430009EABD4 /* PerformanceLoggingClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF2E80C1EE0D430009EABD4 /* PerformanceLoggingClient.cpp */; };
0FF50269102BA9430066F39A /* JSStyleMedia.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF50267102BA9430066F39A /* JSStyleMedia.cpp */; };
0FF5026A102BA9430066F39A /* JSStyleMedia.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF50268102BA9430066F39A /* JSStyleMedia.h */; };
0FF50271102BA96A0066F39A /* StyleMedia.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF5026E102BA9660066F39A /* StyleMedia.cpp */; };
@@ -7917,6 +7919,7 @@
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>"; };
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>"; };
0F87166E1C869D83004FF0DE /* LengthPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LengthPoint.h; sourceTree = "<group>"; };
0F8B456F1DC3FB1000443C3F /* IntersectionObserverCallback.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IntersectionObserverCallback.idl; sourceTree = "<group>"; };
@@ -7990,6 +7993,7 @@
0FEA3E86191B3BD7000F1B55 /* ScrollingTreeFrameScrollingNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingTreeFrameScrollingNode.h; sourceTree = "<group>"; };
0FEF20CD1BD4A24100128E5D /* LengthSize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LengthSize.cpp; sourceTree = "<group>"; };
0FEF20CF1BD4A64F00128E5D /* RenderStyleConstants.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderStyleConstants.cpp; sourceTree = "<group>"; };
+ 0FF2E80C1EE0D430009EABD4 /* PerformanceLoggingClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceLoggingClient.cpp; sourceTree = "<group>"; };
0FF50267102BA9430066F39A /* JSStyleMedia.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStyleMedia.cpp; sourceTree = "<group>"; };
0FF50268102BA9430066F39A /* JSStyleMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStyleMedia.h; sourceTree = "<group>"; };
0FF5026E102BA9660066F39A /* StyleMedia.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleMedia.cpp; sourceTree = "<group>"; };
@@ -19348,6 +19352,8 @@
AD5A0C201DECA0B500707054 /* PerformanceLogging.h */,
37C738E81EDBD2ED003F2B0B /* PerformanceMark.h */,
37C738EA1EDBD381003F2B0B /* PerformanceMeasure.h */,
+ 0F850FE21ED7C18300FB77A7 /* PerformanceLoggingClient.h */,
+ 0FF2E80C1EE0D430009EABD4 /* PerformanceLoggingClient.cpp */,
83FE90251E307C1C003E9199 /* PerformanceMonitor.cpp */,
83FE90261E307C1C003E9199 /* PerformanceMonitor.h */,
8AF4E55211DC5A36000ED3DE /* PerformanceNavigation.cpp */,
@@ -29973,6 +29979,7 @@
9B2D8A7914997CCF00ECEF3E /* UndoStep.h in Headers */,
A863E2011343412000274926 /* UnicodeBidi.h in Headers */,
518864E11BBAF57400E540C9 /* UniqueIDBDatabase.h in Headers */,
+ 0F850FE31ED7C18300FB77A7 /* PerformanceLoggingClient.h in Headers */,
5198F7A51BBDB79300E2CC5F /* UniqueIDBDatabaseConnection.h in Headers */,
5198F7A91BBDD38500E2CC5F /* UniqueIDBDatabaseTransaction.h in Headers */,
E4AFCFA50DAF29A300F5F55C /* UnitBezier.h in Headers */,
@@ -33208,6 +33215,7 @@
FD31603512B0267600C1A359 /* ScriptProcessorNode.cpp in Sources */,
8A413AE11207BBA50082016E /* ScriptRunner.cpp in Sources */,
4127D5370F8AAB1D00E424F5 /* ScriptState.cpp in Sources */,
+ 0FF2E80D1EE0D430009EABD4 /* PerformanceLoggingClient.cpp in Sources */,
BC8AE34E12EA096A00EB3AE6 /* ScrollableArea.cpp in Sources */,
5D925B670F64D4DD00B847F0 /* ScrollAlignment.cpp in Sources */,
CA3BF67C10D99BAE00E6CE53 /* ScrollAnimator.cpp in Sources */,
Modified: trunk/Source/WebCore/page/Page.cpp (217736 => 217737)
--- trunk/Source/WebCore/page/Page.cpp 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/Page.cpp 2017-06-02 23:06:13 UTC (rev 217737)
@@ -70,6 +70,7 @@
#include "PageDebuggable.h"
#include "PageGroup.h"
#include "PageOverlayController.h"
+#include "PerformanceLoggingClient.h"
#include "PerformanceMonitor.h"
#include "PlatformMediaSessionManager.h"
#include "PlugInClient.h"
@@ -210,6 +211,7 @@
, m_plugInClient(pageConfiguration.plugInClient)
, m_validationMessageClient(WTFMove(pageConfiguration.validationMessageClient))
, m_diagnosticLoggingClient(WTFMove(pageConfiguration.diagnosticLoggingClient))
+ , m_performanceLoggingClient(WTFMove(pageConfiguration.performanceLoggingClient))
, m_webGLStateTracker(WTFMove(pageConfiguration.webGLStateTracker))
, m_libWebRTCProvider(WTFMove(pageConfiguration.libWebRTCProvider))
, m_openedByDOM(false)
@@ -307,6 +309,7 @@
m_validationMessageClient = nullptr;
m_diagnosticLoggingClient = nullptr;
+ m_performanceLoggingClient = nullptr;
m_mainFrame->setView(nullptr);
setGroupName(String());
allPages->remove(this);
Modified: trunk/Source/WebCore/page/Page.h (217736 => 217737)
--- trunk/Source/WebCore/page/Page.h 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/Page.h 2017-06-02 23:06:13 UTC (rev 217737)
@@ -109,6 +109,7 @@
class PageConsoleClient;
class PageDebuggable;
class PageGroup;
+class PerformanceLoggingClient;
class PerformanceMonitor;
class PlugInClient;
class PluginData;
@@ -370,6 +371,8 @@
WEBCORE_EXPORT DiagnosticLoggingClient& diagnosticLoggingClient() const;
+ PerformanceLoggingClient* performanceLoggingClient() const { return m_performanceLoggingClient.get(); }
+
// Notifications when the Page starts and stops being presented via a native window.
WEBCORE_EXPORT void setActivityState(ActivityState::Flags);
ActivityState::Flags activityState() const { return m_activityState; }
@@ -669,6 +672,8 @@
PlugInClient* m_plugInClient;
std::unique_ptr<ValidationMessageClient> m_validationMessageClient;
std::unique_ptr<DiagnosticLoggingClient> m_diagnosticLoggingClient;
+ std::unique_ptr<PerformanceLoggingClient> m_performanceLoggingClient;
+
std::unique_ptr<WebGLStateTracker> m_webGLStateTracker;
UniqueRef<LibWebRTCProvider> m_libWebRTCProvider;
Modified: trunk/Source/WebCore/page/PageConfiguration.cpp (217736 => 217737)
--- trunk/Source/WebCore/page/PageConfiguration.cpp 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/PageConfiguration.cpp 2017-06-02 23:06:13 UTC (rev 217737)
@@ -32,6 +32,7 @@
#include "DiagnosticLoggingClient.h"
#include "EditorClient.h"
#include "LibWebRTCProvider.h"
+#include "PerformanceLoggingClient.h"
#include "PluginInfoProvider.h"
#include "SocketProvider.h"
#include "StorageNamespaceProvider.h"
Modified: trunk/Source/WebCore/page/PageConfiguration.h (217736 => 217737)
--- trunk/Source/WebCore/page/PageConfiguration.h 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/PageConfiguration.h 2017-06-02 23:06:13 UTC (rev 217737)
@@ -44,6 +44,7 @@
class InspectorClient;
class LibWebRTCProvider;
class PaymentCoordinatorClient;
+class PerformanceLoggingClient;
class PlugInClient;
class PluginInfoProvider;
class ProgressTrackerClient;
@@ -81,6 +82,7 @@
std::unique_ptr<ValidationMessageClient> validationMessageClient;
FrameLoaderClient* loaderClientForMainFrame { nullptr };
std::unique_ptr<DiagnosticLoggingClient> diagnosticLoggingClient;
+ std::unique_ptr<PerformanceLoggingClient> performanceLoggingClient;
std::unique_ptr<WebGLStateTracker> webGLStateTracker;
RefPtr<ApplicationCacheStorage> applicationCacheStorage;
Added: trunk/Source/WebCore/page/PerformanceLoggingClient.cpp (0 => 217737)
--- trunk/Source/WebCore/page/PerformanceLoggingClient.cpp (rev 0)
+++ trunk/Source/WebCore/page/PerformanceLoggingClient.cpp 2017-06-02 23:06:13 UTC (rev 217737)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2017 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 "PerformanceLoggingClient.h"
+
+#include "ScrollingCoordinator.h"
+#include <wtf/text/StringBuilder.h>
+
+namespace WebCore {
+
+String PerformanceLoggingClient::synchronousScrollingReasonsAsString(SynchronousScrollingReasons synchronousScrollingReasons)
+{
+ if (!synchronousScrollingReasons)
+ return emptyString();
+
+ StringBuilder reasons;
+
+ if (synchronousScrollingReasons & ScrollingCoordinator::ForcedOnMainThread)
+ reasons.appendLiteral("forced,");
+ if (synchronousScrollingReasons & ScrollingCoordinator::HasSlowRepaintObjects)
+ reasons.appendLiteral("slow-repaint objects,");
+ if (synchronousScrollingReasons & ScrollingCoordinator::HasViewportConstrainedObjectsWithoutSupportingFixedLayers)
+ reasons.appendLiteral("viewport-constrained objects,");
+ if (synchronousScrollingReasons & ScrollingCoordinator::HasNonLayerViewportConstrainedObjects)
+ reasons.appendLiteral("non-layer viewport-constrained objects,");
+ if (synchronousScrollingReasons & ScrollingCoordinator::IsImageDocument)
+ reasons.appendLiteral("image document,");
+
+ // Strip the trailing comma.
+ return reasons.toString().left(reasons.length() - 1);
+}
+
+} // namespace WebCore
Added: trunk/Source/WebCore/page/PerformanceLoggingClient.h (0 => 217737)
--- trunk/Source/WebCore/page/PerformanceLoggingClient.h (rev 0)
+++ trunk/Source/WebCore/page/PerformanceLoggingClient.h 2017-06-02 23:06:13 UTC (rev 217737)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+
+#pragma once
+
+#include <wtf/FastMalloc.h>
+#include <wtf/MonotonicTime.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+typedef unsigned SynchronousScrollingReasons;
+
+class PerformanceLoggingClient {
+ WTF_MAKE_FAST_ALLOCATED;
+public:
+ enum class ScrollingEvent {
+ ExposedTilelessArea,
+ FilledTile,
+ SwitchedScrollingMode,
+ };
+ virtual void logScrollingEvent(ScrollingEvent, MonotonicTime, uint64_t) = 0;
+
+ WEBCORE_EXPORT static String synchronousScrollingReasonsAsString(SynchronousScrollingReasons);
+
+ virtual ~PerformanceLoggingClient() { }
+};
+
+} // namespace WebCore
Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (217736 => 217737)
--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp 2017-06-02 23:06:13 UTC (rev 217737)
@@ -37,6 +37,7 @@
#include "Logging.h"
#include "MainFrame.h"
#include "Page.h"
+#include "PerformanceLoggingClient.h"
#include "ScrollAnimator.h"
#include "ScrollingConstraints.h"
#include "ScrollingStateFixedNode.h"
@@ -694,7 +695,19 @@
}
}
#endif
-
+
+void AsyncScrollingCoordinator::reportExposedUnfilledArea(MonotonicTime timestamp, unsigned unfilledArea)
+{
+ if (m_page && m_page->performanceLoggingClient())
+ m_page->performanceLoggingClient()->logScrollingEvent(PerformanceLoggingClient::ScrollingEvent::ExposedTilelessArea, timestamp, unfilledArea);
+}
+
+void AsyncScrollingCoordinator::reportSynchronousScrollingReasonsChanged(MonotonicTime timestamp, SynchronousScrollingReasons reasons)
+{
+ if (m_page && m_page->performanceLoggingClient())
+ m_page->performanceLoggingClient()->logScrollingEvent(PerformanceLoggingClient::ScrollingEvent::SwitchedScrollingMode, timestamp, reasons);
+}
+
} // namespace WebCore
#endif // ENABLE(ASYNC_SCROLLING)
Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h (217736 => 217737)
--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h 2017-06-02 23:06:13 UTC (rev 217737)
@@ -65,6 +65,9 @@
WEBCORE_EXPORT void updateExpectsWheelEventTestTriggerWithFrameView(const FrameView&) override;
+ void reportExposedUnfilledArea(MonotonicTime, unsigned unfilledArea);
+ void reportSynchronousScrollingReasonsChanged(MonotonicTime, SynchronousScrollingReasons);
+
protected:
WEBCORE_EXPORT AsyncScrollingCoordinator(Page*);
Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.h (217736 => 217737)
--- trunk/Source/WebCore/page/scrolling/ScrollingTree.h 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.h 2017-06-02 23:06:13 UTC (rev 217737)
@@ -93,6 +93,9 @@
WEBCORE_EXPORT virtual void currentSnapPointIndicesDidChange(ScrollingNodeID, unsigned horizontal, unsigned vertical) = 0;
+ WEBCORE_EXPORT virtual void reportSynchronousScrollingReasonsChanged(MonotonicTime, SynchronousScrollingReasons) { }
+ WEBCORE_EXPORT virtual void reportExposedUnfilledArea(MonotonicTime, unsigned /* unfilledArea */) { }
+
FloatPoint mainFrameScrollPosition();
#if PLATFORM(IOS)
Modified: trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp (217736 => 217737)
--- trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp 2017-06-02 23:06:13 UTC (rev 217737)
@@ -105,6 +105,20 @@
});
}
+void ThreadedScrollingTree::reportSynchronousScrollingReasonsChanged(MonotonicTime timestamp, SynchronousScrollingReasons reasons)
+{
+ RunLoop::main().dispatch([scrollingCoordinator = m_scrollingCoordinator, timestamp, reasons] {
+ scrollingCoordinator->reportSynchronousScrollingReasonsChanged(timestamp, reasons);
+ });
+}
+
+void ThreadedScrollingTree::reportExposedUnfilledArea(MonotonicTime timestamp, unsigned unfilledArea)
+{
+ RunLoop::main().dispatch([scrollingCoordinator = m_scrollingCoordinator, timestamp, unfilledArea] {
+ scrollingCoordinator->reportExposedUnfilledArea(timestamp, unfilledArea);
+ });
+}
+
void ThreadedScrollingTree::currentSnapPointIndicesDidChange(ScrollingNodeID nodeID, unsigned horizontal, unsigned vertical)
{
if (!m_scrollingCoordinator)
Modified: trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.h (217736 => 217737)
--- trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.h 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.h 2017-06-02 23:06:13 UTC (rev 217737)
@@ -66,6 +66,9 @@
void removeTestDeferralForReason(WheelEventTestTrigger::ScrollableAreaIdentifier, WheelEventTestTrigger::DeferTestTriggerReason) override;
#endif
+ void reportExposedUnfilledArea(MonotonicTime, unsigned unfilledArea) override;
+ void reportSynchronousScrollingReasonsChanged(MonotonicTime, SynchronousScrollingReasons) override;
+
private:
bool isThreadedScrollingTree() const override { return true; }
Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h (217736 => 217737)
--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h 2017-06-02 23:06:13 UTC (rev 217737)
@@ -93,7 +93,7 @@
FloatSize viewportSize() const override;
#endif
- void logExposedUnfilledArea();
+ unsigned exposedUnfilledArea() const;
ScrollController m_scrollController;
Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm (217736 => 217737)
--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm 2017-06-02 23:06:13 UTC (rev 217737)
@@ -44,13 +44,10 @@
#import <QuartzCore/QuartzCore.h>
#import <wtf/CurrentTime.h>
#import <wtf/Deque.h>
-#import <wtf/text/StringBuilder.h>
#import <wtf/text/CString.h>
namespace WebCore {
-static void logThreadedScrollingMode(unsigned synchronousScrollingReasons);
-
Ref<ScrollingTreeFrameScrollingNode> ScrollingTreeFrameScrollingNodeMac::create(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
{
return adoptRef(*new ScrollingTreeFrameScrollingNodeMac(scrollingTree, nodeID));
@@ -149,10 +146,8 @@
logScrollingMode = true;
}
- if (logScrollingMode) {
- if (scrollingTree().scrollingPerformanceLoggingEnabled())
- logThreadedScrollingMode(synchronousScrollingReasons());
- }
+ if (logScrollingMode && scrollingTree().scrollingPerformanceLoggingEnabled())
+ scrollingTree().reportSynchronousScrollingReasonsChanged(MonotonicTime::now(), synchronousScrollingReasons());
#if ENABLE(CSS_SCROLL_SNAP)
if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::HorizontalSnapOffsets) || scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::HorizontalSnapOffsetRanges))
@@ -389,8 +384,13 @@
ScrollingTreeFrameScrollingNode::setScrollPosition(roundedPosition);
- if (scrollingTree().scrollingPerformanceLoggingEnabled())
- logExposedUnfilledArea();
+ if (scrollingTree().scrollingPerformanceLoggingEnabled()) {
+ unsigned unfilledArea = exposedUnfilledArea();
+ if (unfilledArea || m_lastScrollHadUnfilledPixels)
+ scrollingTree().reportExposedUnfilledArea(MonotonicTime::now(), unfilledArea);
+
+ m_lastScrollHadUnfilledPixels = unfilledArea;
+ }
}
void ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints(const FloatPoint& scrollPosition)
@@ -529,7 +529,7 @@
scrollingTree().setMainFramePinState(pinnedToTheLeft, pinnedToTheRight, pinnedToTheTop, pinnedToTheBottom);
}
-void ScrollingTreeFrameScrollingNodeMac::logExposedUnfilledArea()
+unsigned ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea() const
{
Region paintedVisibleTiles;
@@ -555,38 +555,9 @@
FloatPoint scrollPosition = this->scrollPosition();
FloatRect viewPortRect(FloatPoint(), scrollableAreaSize());
- unsigned unfilledArea = TileController::blankPixelCountForTiles(tiles, viewPortRect, IntPoint(-scrollPosition.x(), -scrollPosition.y()));
-
- if (unfilledArea || m_lastScrollHadUnfilledPixels)
- WTFLogAlways("SCROLLING: Exposed tileless area. Time: %f Unfilled Pixels: %u\n", WTF::monotonicallyIncreasingTime(), unfilledArea);
-
- m_lastScrollHadUnfilledPixels = unfilledArea;
+ return TileController::blankPixelCountForTiles(tiles, viewPortRect, IntPoint(-scrollPosition.x(), -scrollPosition.y()));
}
-static void logThreadedScrollingMode(unsigned synchronousScrollingReasons)
-{
- if (synchronousScrollingReasons) {
- StringBuilder reasonsDescription;
-
- if (synchronousScrollingReasons & ScrollingCoordinator::ForcedOnMainThread)
- reasonsDescription.appendLiteral("forced,");
- if (synchronousScrollingReasons & ScrollingCoordinator::HasSlowRepaintObjects)
- reasonsDescription.appendLiteral("slow-repaint objects,");
- if (synchronousScrollingReasons & ScrollingCoordinator::HasViewportConstrainedObjectsWithoutSupportingFixedLayers)
- reasonsDescription.appendLiteral("viewport-constrained objects,");
- if (synchronousScrollingReasons & ScrollingCoordinator::HasNonLayerViewportConstrainedObjects)
- reasonsDescription.appendLiteral("non-layer viewport-constrained objects,");
- if (synchronousScrollingReasons & ScrollingCoordinator::IsImageDocument)
- reasonsDescription.appendLiteral("image document,");
-
- // Strip the trailing comma.
- String reasonsDescriptionTrimmed = reasonsDescription.toString().left(reasonsDescription.length() - 1);
-
- WTFLogAlways("SCROLLING: Switching to main-thread scrolling mode. Time: %f Reason(s): %s\n", WTF::monotonicallyIncreasingTime(), reasonsDescriptionTrimmed.ascii().data());
- } else
- WTFLogAlways("SCROLLING: Switching to threaded scrolling mode. Time: %f\n", WTF::monotonicallyIncreasingTime());
-}
-
#if ENABLE(CSS_SCROLL_SNAP)
FloatPoint ScrollingTreeFrameScrollingNodeMac::scrollOffset() const
{
Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h (217736 => 217737)
--- trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h 2017-06-02 23:06:13 UTC (rev 217737)
@@ -129,6 +129,8 @@
virtual bool needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack(const GraphicsLayer&) const { return false; }
+ virtual void logFilledVisibleFreshTile(unsigned) { };
+
#ifndef NDEBUG
// RenderLayerBacking overrides this to verify that it is not
// currently painting contents. An ASSERT fails, if it is.
Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (217736 => 217737)
--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2017-06-02 23:06:13 UTC (rev 217737)
@@ -1620,6 +1620,11 @@
return client().useGiantTiles();
}
+void GraphicsLayerCA::platformCALayerLogFilledVisibleFreshTile(unsigned blankPixelCount)
+{
+ client().logFilledVisibleFreshTile(blankPixelCount);
+}
+
static PlatformCALayer::LayerType layerTypeForCustomBackdropAppearance(GraphicsLayer::CustomAppearance appearance)
{
return appearance == GraphicsLayer::LightBackdropAppearance ? PlatformCALayer::LayerTypeLightSystemBackdropLayer : PlatformCALayer::LayerTypeDarkSystemBackdropLayer;
Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (217736 => 217737)
--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h 2017-06-02 23:06:13 UTC (rev 217737)
@@ -201,6 +201,7 @@
WEBCORE_EXPORT bool platformCALayerShouldAggressivelyRetainTiles(PlatformCALayer*) const override;
WEBCORE_EXPORT bool platformCALayerShouldTemporarilyRetainTileCohorts(PlatformCALayer*) const override;
WEBCORE_EXPORT bool platformCALayerUseGiantTiles() const override;
+ WEBCORE_EXPORT void platformCALayerLogFilledVisibleFreshTile(unsigned) override;
bool isCommittingChanges() const override { return m_isCommittingChanges; }
bool isUsingDisplayListDrawing(PlatformCALayer*) const override { return m_usesDisplayListDrawing; }
Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h (217736 => 217737)
--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h 2017-06-02 23:06:13 UTC (rev 217737)
@@ -65,6 +65,8 @@
virtual bool isUsingDisplayListDrawing(PlatformCALayer*) const { return false; }
+ virtual void platformCALayerLogFilledVisibleFreshTile(unsigned /* blankPixelCount */) { }
+
protected:
virtual ~PlatformCALayerClient() {}
};
Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.cpp (217736 => 217737)
--- trunk/Source/WebCore/platform/graphics/ca/TileController.cpp 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.cpp 2017-06-02 23:06:13 UTC (rev 217737)
@@ -777,6 +777,11 @@
}
#endif
+void TileController::logFilledVisibleFreshTile(unsigned blankPixelCount)
+{
+ owningGraphicsLayer()->platformCALayerLogFilledVisibleFreshTile(blankPixelCount);
+}
+
} // namespace WebCore
#endif
Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.h (217736 => 217737)
--- trunk/Source/WebCore/platform/graphics/ca/TileController.h 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.h 2017-06-02 23:06:13 UTC (rev 217737)
@@ -23,8 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef TileController_h
-#define TileController_h
+#pragma once
#include "FloatRect.h"
#include "IntRect.h"
@@ -138,6 +137,8 @@
const TileGrid& tileGrid() const { return *m_tileGrid; }
WEBCORE_EXPORT Vector<RefPtr<PlatformCALayer>> containerLayers();
+
+ void logFilledVisibleFreshTile(unsigned blankPixelCount);
private:
TileGrid& tileGrid() { return *m_tileGrid; }
@@ -212,13 +213,12 @@
int m_marginSize { kDefaultTileSize };
+ Scrollability m_scrollability { HorizontallyScrollable | VerticallyScrollable };
+
// m_marginTop and m_marginBottom are the height in pixels of the top and bottom margin tiles. The width
// of those tiles will be equivalent to the width of the other tiles in the grid. m_marginRight and
// m_marginLeft are the width in pixels of the right and left margin tiles, respectively. The height of
// those tiles will be equivalent to the height of the other tiles in the grid.
-
- Scrollability m_scrollability { HorizontallyScrollable | VerticallyScrollable };
-
BoxExtent<bool> m_marginEdges;
bool m_isInWindow { false };
@@ -240,4 +240,3 @@
} // namespace WebCore
-#endif // TileController_h
Modified: trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp (217736 => 217737)
--- trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp 2017-06-02 23:06:13 UTC (rev 217737)
@@ -739,7 +739,7 @@
visiblePart.intersect(m_controller.visibleRect());
if (repaintCount == 1 && !visiblePart.isEmpty())
- WTFLogAlways("SCROLLING: Filled visible fresh tile. Time: %f Unfilled Pixels: %u\n", WTF::monotonicallyIncreasingTime(), blankPixelCount());
+ m_controller.logFilledVisibleFreshTile(blankPixelCount());
}
}
Modified: trunk/Source/WebCore/platform/graphics/ca/TileGrid.h (217736 => 217737)
--- trunk/Source/WebCore/platform/graphics/ca/TileGrid.h 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/platform/graphics/ca/TileGrid.h 2017-06-02 23:06:13 UTC (rev 217737)
@@ -23,8 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef TileGrid_h
-#define TileGrid_h
+#pragma once
#include "IntPointHash.h"
#include "IntRect.h"
@@ -178,4 +177,4 @@
};
}
-#endif
+
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (217736 => 217737)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2017-06-02 23:06:13 UTC (rev 217737)
@@ -47,6 +47,7 @@
#include "Logging.h"
#include "MainFrame.h"
#include "Page.h"
+#include "PerformanceLoggingClient.h"
#include "PluginViewBase.h"
#include "ProgressTracker.h"
#include "RenderFlowThread.h"
@@ -2695,6 +2696,12 @@
return renderer().settings().useGiantTiles();
}
+void RenderLayerBacking::logFilledVisibleFreshTile(unsigned blankPixelCount)
+{
+ if (PerformanceLoggingClient* loggingClient = renderer().page().performanceLoggingClient())
+ loggingClient->logScrollingEvent(PerformanceLoggingClient::ScrollingEvent::FilledTile, MonotonicTime::now(), blankPixelCount);
+}
+
#ifndef NDEBUG
void RenderLayerBacking::verifyNotPainting()
{
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.h (217736 => 217737)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.h 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.h 2017-06-02 23:06:13 UTC (rev 217737)
@@ -216,6 +216,7 @@
bool shouldAggressivelyRetainTiles(const GraphicsLayer*) const override;
bool shouldTemporarilyRetainTileCohorts(const GraphicsLayer*) const override;
bool useGiantTiles() const override;
+ void logFilledVisibleFreshTile(unsigned) override;
bool needsPixelAligment() const override { return !m_isMainFrameRenderViewLayer; }
LayoutSize subpixelOffsetFromRenderer() const { return m_subpixelOffsetFromRenderer; }
Modified: trunk/Source/WebKit2/CMakeLists.txt (217736 => 217737)
--- trunk/Source/WebKit2/CMakeLists.txt 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebKit2/CMakeLists.txt 2017-06-02 23:06:13 UTC (rev 217737)
@@ -554,6 +554,7 @@
WebProcess/WebCoreSupport/WebGeolocationClient.cpp
WebProcess/WebCoreSupport/WebInspectorClient.cpp
WebProcess/WebCoreSupport/WebNotificationClient.cpp
+ WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp
WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
WebProcess/WebCoreSupport/WebPlugInClient.cpp
WebProcess/WebCoreSupport/WebPopupMenu.cpp
Modified: trunk/Source/WebKit2/ChangeLog (217736 => 217737)
--- trunk/Source/WebKit2/ChangeLog 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebKit2/ChangeLog 2017-06-02 23:06:13 UTC (rev 217737)
@@ -1,3 +1,31 @@
+2017-06-02 Simon Fraser <simon.fra...@apple.com>
+
+ All scroll peformance logging should happen in the UI process
+ https://bugs.webkit.org/show_bug.cgi?id=172874
+ rdar://problem/24474830
+
+ Reviewed by Tim Horton.
+
+ Printing to stdout from the WebProcess doesn't show up anywhere in non-development builds,
+ so we have to log from the UI process.
+
+ Achieve this by adding a PerformanceLoggingClient to Page which forwards messages to
+ WebPageProxy, which prints them with the same format they had before. Some plumbing through
+ PlatformCALayerClient and GraphicsLayerClient is required to get messages from TileControllers
+ through to something that can get to Page.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::logScrollingEvent):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+ * WebKit2.xcodeproj/project.pbxproj:
+ * WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp: Added.
+ (WebKit::WebPerformanceLoggingClient::WebPerformanceLoggingClient):
+ (WebKit::WebPerformanceLoggingClient::logScrollingEvent):
+ * WebProcess/WebCoreSupport/WebPerformanceLoggingClient.h: Added.
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::m_cpuLimit):
+
2017-06-02 Chris Dumez <cdu...@apple.com>
REGRESSION (r206386): Xactimate Website Crashes @ com.apple.WebKit: WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant + 255
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (217736 => 217737)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2017-06-02 23:06:13 UTC (rev 217737)
@@ -124,6 +124,7 @@
#include <WebCore/JSDOMExceptionHandling.h>
#include <WebCore/LengthBox.h>
#include <WebCore/MIMETypeRegistry.h>
+#include <WebCore/PerformanceLoggingClient.h>
#include <WebCore/PublicSuffix.h>
#include <WebCore/RenderEmbeddedObject.h>
#include <WebCore/SerializedCryptoKeyWrap.h>
@@ -5211,6 +5212,26 @@
m_diagnosticLoggingClient->logDiagnosticMessageWithEnhancedPrivacy(this, message, description);
}
+void WebPageProxy::logScrollingEvent(uint32_t eventType, MonotonicTime timestamp, uint64_t data)
+{
+ PerformanceLoggingClient::ScrollingEvent event = static_cast<PerformanceLoggingClient::ScrollingEvent>(eventType);
+
+ switch (event) {
+ case PerformanceLoggingClient::ScrollingEvent::ExposedTilelessArea:
+ WTFLogAlways("SCROLLING: Exposed tileless area. Time: %f Unfilled Pixels: %llu\n", timestamp.secondsSinceEpoch().value(), (unsigned long long)data);
+ break;
+ case PerformanceLoggingClient::ScrollingEvent::FilledTile:
+ WTFLogAlways("SCROLLING: Filled visible fresh tile. Time: %f Unfilled Pixels: %llu\n", timestamp.secondsSinceEpoch().value(), (unsigned long long)data);
+ break;
+ case PerformanceLoggingClient::ScrollingEvent::SwitchedScrollingMode:
+ if (data)
+ WTFLogAlways("SCROLLING: Switching to main-thread scrolling mode. Time: %f Reason(s): %s\n", timestamp.secondsSinceEpoch().value(), PerformanceLoggingClient::synchronousScrollingReasonsAsString(data).utf8().data());
+ else
+ WTFLogAlways("SCROLLING: Switching to threaded scrolling mode. Time: %f\n", timestamp.secondsSinceEpoch().value());
+ break;
+ }
+}
+
void WebPageProxy::rectForCharacterRangeCallback(const IntRect& rect, const EditingRange& actualRange, uint64_t callbackID)
{
MESSAGE_CHECK(actualRange.isValid());
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (217736 => 217737)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2017-06-02 23:06:13 UTC (rev 217737)
@@ -82,6 +82,7 @@
#include <memory>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
+#include <wtf/MonotonicTime.h>
#include <wtf/Ref.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
@@ -1108,6 +1109,9 @@
void logDiagnosticMessageWithValue(const String& message, const String& description, double value, unsigned significantFigures, WebCore::ShouldSample);
void logDiagnosticMessageWithEnhancedPrivacy(const String& message, const String& description, WebCore::ShouldSample);
+ // Performance logging.
+ void logScrollingEvent(uint32_t eventType, MonotonicTime, uint64_t);
+
// Form validation messages.
void showValidationMessage(const WebCore::IntRect& anchorClientRect, const String& message);
void hideValidationMessage();
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (217736 => 217737)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in 2017-06-02 23:06:13 UTC (rev 217737)
@@ -230,6 +230,9 @@
LogDiagnosticMessageWithValue(String message, String description, double value, unsigned significantFigures, enum WebCore::ShouldSample shouldSample)
LogDiagnosticMessageWithEnhancedPrivacy(String message, String description, enum WebCore::ShouldSample shouldSample)
+ # Performance logging
+ LogScrollingEvent(uint32_t eventType, MonotonicTime timestamp, uint64_t data)
+
# Editor notifications
EditorStateChanged(struct WebKit::EditorState editorState)
CompositionWasCanceled()
Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (217736 => 217737)
--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2017-06-02 23:06:13 UTC (rev 217737)
@@ -86,6 +86,8 @@
0F5947A8187B517600437857 /* RemoteScrollingCoordinatorMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5947A6187B517600437857 /* RemoteScrollingCoordinatorMessages.h */; };
0F5E200318E77051003EC3E5 /* PlatformCAAnimationRemote.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F5E200118E77051003EC3E5 /* PlatformCAAnimationRemote.mm */; };
0F5E200418E77051003EC3E5 /* PlatformCAAnimationRemote.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5E200218E77051003EC3E5 /* PlatformCAAnimationRemote.h */; };
+ 0F850FE61ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F850FE41ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp */; };
+ 0F850FE71ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F850FE51ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h */; };
0F931C1C18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F931C1A18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h */; };
0F931C1D18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F931C1B18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm */; };
0FB659231208B4DB0044816C /* DrawingAreaInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB659221208B4DB0044816C /* DrawingAreaInfo.h */; };
@@ -2240,6 +2242,8 @@
0F5E200218E77051003EC3E5 /* PlatformCAAnimationRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformCAAnimationRemote.h; sourceTree = "<group>"; };
0F707C771A1FEE8300DA7A45 /* RemoteLayerTreeScrollingPerformanceData.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteLayerTreeScrollingPerformanceData.mm; sourceTree = "<group>"; };
0F707C791A1FEEA300DA7A45 /* RemoteLayerTreeScrollingPerformanceData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerTreeScrollingPerformanceData.h; sourceTree = "<group>"; };
+ 0F850FE41ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPerformanceLoggingClient.cpp; sourceTree = "<group>"; };
+ 0F850FE51ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPerformanceLoggingClient.h; sourceTree = "<group>"; };
0F931C1A18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScrollingTreeOverflowScrollingNodeIOS.h; path = Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h; sourceTree = "<group>"; };
0F931C1B18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ScrollingTreeOverflowScrollingNodeIOS.mm; path = Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm; sourceTree = "<group>"; };
0FB659221208B4DB0044816C /* DrawingAreaInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingAreaInfo.h; sourceTree = "<group>"; };
@@ -6592,6 +6596,8 @@
31099968146C71F50029DEB9 /* WebNotificationClient.h */,
512127C11908239A00DAF35C /* WebPasteboardOverrides.cpp */,
512127C21908239A00DAF35C /* WebPasteboardOverrides.h */,
+ 0F850FE41ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp */,
+ 0F850FE51ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h */,
1A3E736011CC2659007BD539 /* WebPlatformStrategies.cpp */,
1A3E735F11CC2659007BD539 /* WebPlatformStrategies.h */,
31D5929C166E05FF00E6BF02 /* WebPlugInClient.cpp */,
@@ -8603,6 +8609,7 @@
1AA9BAE1184FFAC7003B6BC6 /* WeakObjCPtr.h in Headers */,
CEDA12E3152CD1B300D9E08D /* WebAlternativeTextClient.h in Headers */,
9955A6EC1C7980C200EB6A93 /* WebAutomationSession.h in Headers */,
+ 0F850FE71ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h in Headers */,
99C3AE2D1DADA6AD00AF5C16 /* WebAutomationSessionMacros.h in Headers */,
1C0A19581C90068F00FE0EBB /* WebAutomationSessionMessages.h in Headers */,
1C0A19471C8FF1A800FE0EBB /* WebAutomationSessionProxy.h in Headers */,
@@ -10288,6 +10295,7 @@
BC9BA5041697C45300E44616 /* WebKit2Initialize.cpp in Sources */,
51FB08FF1639DE1A00EC324A /* WebLoaderStrategy.cpp in Sources */,
CD003A5219D49B5D005ABCE0 /* WebMediaKeyStorageManager.cpp in Sources */,
+ 0F850FE61ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp in Sources */,
C98C48A51B6FD4C300145103 /* WebMediaSessionFocusManager.cpp in Sources */,
C9C1833B1B74026A007036A7 /* WebMediaSessionFocusManagerClient.cpp in Sources */,
C9CD43971B4B001900239E33 /* WebMediaSessionMetadata.cpp in Sources */,
Copied: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp (from rev 217736, trunk/Source/WebCore/page/PageConfiguration.cpp) (0 => 217737)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp 2017-06-02 23:06:13 UTC (rev 217737)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2017 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 COMPUTER, INC. ``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 COMPUTER, INC. OR
+ * 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 "WebPerformanceLoggingClient.h"
+
+#include "WebCoreArgumentCoders.h"
+#include "WebPage.h"
+#include "WebPageProxyMessages.h"
+
+namespace WebKit {
+
+using namespace WebCore;
+
+WebPerformanceLoggingClient::WebPerformanceLoggingClient(WebPage& page)
+ : m_page(page)
+{
+}
+
+void WebPerformanceLoggingClient::logScrollingEvent(ScrollingEvent event, MonotonicTime timestamp, uint64_t data)
+{
+ m_page.send(Messages::WebPageProxy::LogScrollingEvent(static_cast<uint32_t>(event), timestamp, data));
+}
+
+} // namespace WebKit
Copied: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPerformanceLoggingClient.h (from rev 217736, trunk/Source/WebCore/page/PageConfiguration.cpp) (0 => 217737)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPerformanceLoggingClient.h (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPerformanceLoggingClient.h 2017-06-02 23:06:13 UTC (rev 217737)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2017 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 COMPUTER, INC. ``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 COMPUTER, INC. OR
+ * 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.
+ */
+
+#pragma once
+
+#include <WebCore/PerformanceLoggingClient.h>
+#include <wtf/Forward.h>
+
+namespace WebKit {
+
+class WebPage;
+
+class WebPerformanceLoggingClient : public WebCore::PerformanceLoggingClient {
+public:
+ WebPerformanceLoggingClient(WebPage&);
+ virtual ~WebPerformanceLoggingClient() = default;
+
+private:
+ void logScrollingEvent(ScrollingEvent, MonotonicTime, uint64_t) override;
+
+ WebPage& m_page;
+};
+
+}
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (217736 => 217737)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2017-06-02 22:20:15 UTC (rev 217736)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2017-06-02 23:06:13 UTC (rev 217737)
@@ -102,6 +102,7 @@
#include "WebPageOverlay.h"
#include "WebPageProxyMessages.h"
#include "WebPaymentCoordinator.h"
+#include "WebPerformanceLoggingClient.h"
#include "WebPlugInClient.h"
#include "WebPluginInfoProvider.h"
#include "WebPopupMenu.h"
@@ -395,6 +396,8 @@
pageConfiguration.loaderClientForMainFrame = new WebFrameLoaderClient;
pageConfiguration.progressTrackerClient = new WebProgressTrackerClient(*this);
pageConfiguration.diagnosticLoggingClient = std::make_unique<WebDiagnosticLoggingClient>(*this);
+ pageConfiguration.performanceLoggingClient = std::make_unique<WebPerformanceLoggingClient>(*this);
+
pageConfiguration.webGLStateTracker = std::make_unique<WebGLStateTracker>([this](bool isUsingHighPerformanceWebGL) {
send(Messages::WebPageProxy::SetIsUsingHighPerformanceWebGL(isUsingHighPerformanceWebGL));
});