Ensure DRT always logs rAF suspension debugging code
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Jun 2017 23:55:15 +0000 (23:55 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Jun 2017 23:55:15 +0000 (23:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173681

Reviewed by Tim "Mr. T" Horton.

Source/WebCore:

Instead of using a setting to check whether we should log information related to rAF
callbacks being suspended with WK1, we now check whether we're using in DRT to avoid
any potential issue with settings being in the incorrect state when a test is run.

* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::logSuspendCount):
* page/Page.cpp:
(WebCore::Page::suspendScriptedAnimations):
(WebCore::Page::resumeScriptedAnimations):
* page/Settings.in:
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::MacApplication::isDumpRenderTree):

Source/WebKit/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences shouldLogScriptedAnimationControllerSuspensionChange]): Deleted.
(-[WebPreferences setShouldLogScriptedAnimationControllerSuspensionChange:]): Deleted.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):

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

13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/ScriptedAnimationController.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/Settings.in
Source/WebCore/platform/RuntimeApplicationChecks.h
Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebPreferencesPrivate.h
Source/WebKit/mac/WebView/WebView.mm
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm

index 1a53575..fdab71d 100644 (file)
@@ -1,3 +1,24 @@
+2017-06-21  Antoine Quint  <graouts@apple.com>
+
+        Ensure DRT always logs rAF suspension debugging code
+        https://bugs.webkit.org/show_bug.cgi?id=173681
+
+        Reviewed by Tim "Mr. T" Horton.
+
+        Instead of using a setting to check whether we should log information related to rAF
+        callbacks being suspended with WK1, we now check whether we're using in DRT to avoid
+        any potential issue with settings being in the incorrect state when a test is run.
+
+        * dom/ScriptedAnimationController.cpp:
+        (WebCore::ScriptedAnimationController::logSuspendCount):
+        * page/Page.cpp:
+        (WebCore::Page::suspendScriptedAnimations):
+        (WebCore::Page::resumeScriptedAnimations):
+        * page/Settings.in:
+        * platform/RuntimeApplicationChecks.h:
+        * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
+        (WebCore::MacApplication::isDumpRenderTree):
+
 2017-06-21  Chris Dumez  <cdumez@apple.com>
 
         Allow constructing a WTF:Function from a function pointer
index 174cc01..54329cb 100644 (file)
@@ -39,6 +39,7 @@
 #include "MainFrame.h"
 #include "Page.h"
 #include "RequestAnimationFrameCallback.h"
+#include "RuntimeApplicationChecks.h"
 #include "Settings.h"
 #include <algorithm>
 #include <wtf/CurrentTime.h>
@@ -93,7 +94,7 @@ void ScriptedAnimationController::resume()
 
 void ScriptedAnimationController::logSuspendCount()
 {
-    if (!m_document || !m_document->frame() || !m_document->frame()->settings().shouldLogScriptedAnimationControllerSuspensionChange())
+    if (!m_document || !m_document->frame() || MacApplication::isDumpRenderTree())
         return;
 
     WTFLogAlways("\nScriptedAnimationController::m_suspendCount = %d", m_suspendCount);
index 6e0d1dc..3a0db60 100644 (file)
@@ -85,6 +85,7 @@
 #include "RenderView.h"
 #include "RenderWidget.h"
 #include "ResourceUsageOverlay.h"
+#include "RuntimeApplicationChecks.h"
 #include "RuntimeEnabledFeatures.h"
 #include "SVGDocumentExtensions.h"
 #include "SchemeRegistry.h"
@@ -1145,7 +1146,7 @@ void Page::removeActivityStateChangeObserver(ActivityStateChangeObserver& observ
 
 void Page::suspendScriptedAnimations()
 {
-    if (settings().shouldLogScriptedAnimationControllerSuspensionChange()) {
+    if (MacApplication::isDumpRenderTree()) {
         WTFLogAlways("\nPage::suspendScriptedAnimations()");
         WTFReportBacktrace();
     }
@@ -1159,7 +1160,7 @@ void Page::suspendScriptedAnimations()
 
 void Page::resumeScriptedAnimations()
 {
-    if (settings().shouldLogScriptedAnimationControllerSuspensionChange()) {
+    if (MacApplication::isDumpRenderTree()) {
         WTFLogAlways("\nPage::resumeScriptedAnimations()");
         WTFReportBacktrace();
     }
index b5080e2..29f4385 100644 (file)
@@ -299,5 +299,3 @@ subresourceIntegrityEnabled initial=true
 constantPropertiesEnabled initial=false
 
 viewportFitEnabled initial=false
-
-shouldLogScriptedAnimationControllerSuspensionChange initial=false
index ab88e67..19780a6 100644 (file)
@@ -45,6 +45,7 @@ WEBCORE_EXPORT bool isAOLInstantMessenger();
 WEBCORE_EXPORT bool isAdobeInstaller();
 WEBCORE_EXPORT bool isAperture();
 WEBCORE_EXPORT bool isAppleMail();
+bool isDumpRenderTree();
 WEBCORE_EXPORT bool isIBooks();
 WEBCORE_EXPORT bool isITunes();
 WEBCORE_EXPORT bool isMicrosoftMessenger();
index d2e28b7..a8d2202 100644 (file)
@@ -162,6 +162,11 @@ bool MacApplication::isSolidStateNetworksDownloader()
     return isSolidStateNetworksDownloader;
 }
 
+bool MacApplication::isDumpRenderTree()
+{
+    return [[[NSProcessInfo processInfo] processName] isEqualToString:@"DumpRenderTree"];
+}
+
 #endif // PLATFORM(MAC)
 
 #if PLATFORM(IOS)
index 547888b..3be5c6e 100644 (file)
@@ -1,3 +1,19 @@
+2017-06-21  Antoine Quint  <graouts@apple.com>
+
+        Ensure DRT always logs rAF suspension debugging code
+        https://bugs.webkit.org/show_bug.cgi?id=173681
+
+        Reviewed by Tim "Mr. T" Horton.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences shouldLogScriptedAnimationControllerSuspensionChange]): Deleted.
+        (-[WebPreferences setShouldLogScriptedAnimationControllerSuspensionChange:]): Deleted.
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2017-06-21  Daniel Bates  <dabates@apple.com>
 
         Cleanup FrameLoadRequest
index 7da4ab2..08ee13f 100644 (file)
 #define WebKitUserTimingEnabledPreferenceKey @"WebKitUserTimingEnabled"
 #define WebKitResourceTimingEnabledPreferenceKey @"WebKitResourceTimingEnabled"
 #define WebKitMediaContentTypesRequiringHardwareSupportPreferenceKey @"WebKitMediaContentTypesRequiringHardwareSupport"
-#define WebKitShouldLogScriptedAnimationControllerSuspensionChangePreferenceKey @"WebKitShouldLogScriptedAnimationControllerSuspensionChange"
index b498ba0..a6e2357 100644 (file)
@@ -671,7 +671,6 @@ public:
         @NO, WebKitMediaUserGestureInheritsFromDocument,
         @NO, WebKitIsSecureContextAttributeEnabledPreferenceKey,
         (NSString *)Settings::defaultMediaContentTypesRequiringHardwareSupport(), WebKitMediaContentTypesRequiringHardwareSupportPreferenceKey,
-        @NO, WebKitShouldLogScriptedAnimationControllerSuspensionChangePreferenceKey,
         nil];
 
 #if !PLATFORM(IOS)
@@ -3138,16 +3137,6 @@ static NSString *classIBCreatorID = nil;
     [self _setBoolValue:flag forKey:WebKitIsSecureContextAttributeEnabledPreferenceKey];
 }
 
-- (BOOL)shouldLogScriptedAnimationControllerSuspensionChange
-{
-    return [self _boolValueForKey:WebKitShouldLogScriptedAnimationControllerSuspensionChangePreferenceKey];
-}
-
-- (void)setShouldLogScriptedAnimationControllerSuspensionChange:(BOOL)flag
-{
-    [self _setBoolValue:flag forKey:WebKitShouldLogScriptedAnimationControllerSuspensionChangePreferenceKey];
-}
-
 @end
 
 @implementation WebPreferences (WebInternal)
index a97c6cc..ee1695a 100644 (file)
@@ -584,7 +584,4 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification;
 
 @property (nonatomic) NSString *mediaContentTypesRequiringHardwareSupport;
 
-- (void)setShouldLogScriptedAnimationControllerSuspensionChange:(BOOL)flag;
-- (BOOL)shouldLogScriptedAnimationControllerSuspensionChange;
-
 @end
index 7429c10..3a7155d 100644 (file)
@@ -2846,7 +2846,6 @@ static bool needsSelfRetainWhileLoadingQuirk()
 
     settings.setVisualViewportEnabled([preferences visualViewportEnabled]);
     settings.setMediaContentTypesRequiringHardwareSupport([preferences mediaContentTypesRequiringHardwareSupport]);
-    settings.setShouldLogScriptedAnimationControllerSuspensionChange([preferences shouldLogScriptedAnimationControllerSuspensionChange]);
 
     switch ([preferences storageBlockingPolicy]) {
     case WebAllowAllStorage:
index 19342c4..0b2e4d8 100644 (file)
@@ -1,3 +1,13 @@
+2017-06-21  Antoine Quint  <graouts@apple.com>
+
+        Ensure DRT always logs rAF suspension debugging code
+        https://bugs.webkit.org/show_bug.cgi?id=173681
+
+        Reviewed by Tim "Mr. T" Horton.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (resetWebPreferencesToConsistentValues):
+
 2017-06-21  Chris Dumez  <cdumez@apple.com>
 
         Allow constructing a WTF:Function from a function pointer
index a18b250..523f3f3 100644 (file)
@@ -966,8 +966,6 @@ static void resetWebPreferencesToConsistentValues()
     [preferences setResourceTimingEnabled:YES];
     [preferences setUserTimingEnabled:YES];
 
-    [preferences setShouldLogScriptedAnimationControllerSuspensionChange:YES];
-
     [WebPreferences _clearNetworkLoaderSession];
     [WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain];
 }