Title: [123775] trunk/Source
Revision
123775
Author
jer.no...@apple.com
Date
2012-07-26 11:26:32 -0700 (Thu, 26 Jul 2012)

Log Message

Add setting to enable and disable diagnostic logging.
https://bugs.webkit.org/show_bug.cgi?id=92337

Reviewed by Anders Carlsson.

Source/WebCore:

Add a new entry in Settings, defaulting to false.

* page/Settings.cpp:
(WebCore::Settings::Settings): Default the new setting to false.
* page/Settings.h:
(WebCore::Settings::setDiagnosticLoggingEnabled): Simple accessor.
(WebCore::Settings::diagnosticLoggingEnabled): Ditto.

Source/WebKit/mac:

Add a WebKit WebPreferences API to set set the WebCore diagnosticLoggingEnabled setting.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]): Register the default value to false.
(-[WebPreferences diagnosticLoggingEnabled]): Simple userDefaults accessor.
(-[WebPreferences setDiagnosticLoggingEnabled:]): Ditto.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]): Ensure this preference is propagated to Settings
    whenever the preferences change.

Source/WebKit2:

Add a WebKit2 WKPreferences API to set set the WebCore diagnosticLoggingEnabled setting.

* Shared/WebPreferencesStore.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetDiagnosticLoggingEnabled):
(WKPreferencesGetDiagnosticLoggingEnabled):
* UIProcess/API/C/WKPreferencesPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Ensure this preference is propagated to Settings
    whenever the preferences change.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (123774 => 123775)


--- trunk/Source/WebCore/ChangeLog	2012-07-26 18:18:09 UTC (rev 123774)
+++ trunk/Source/WebCore/ChangeLog	2012-07-26 18:26:32 UTC (rev 123775)
@@ -1,3 +1,18 @@
+2012-07-25  Jer Noble  <jer.no...@apple.com>
+
+        Add setting to enable and disable diagnostic logging.
+        https://bugs.webkit.org/show_bug.cgi?id=92337
+
+        Reviewed by Anders Carlsson.
+
+        Add a new entry in Settings, defaulting to false.
+
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings): Default the new setting to false.
+        * page/Settings.h:
+        (WebCore::Settings::setDiagnosticLoggingEnabled): Simple accessor.
+        (WebCore::Settings::diagnosticLoggingEnabled): Ditto.
+
 2012-07-26  Olivier Blin  <olivier.b...@softathome.com>
 
         Add FastMalloc statistics in window.internals

Modified: trunk/Source/WebCore/page/Settings.cpp (123774 => 123775)


--- trunk/Source/WebCore/page/Settings.cpp	2012-07-26 18:18:09 UTC (rev 123774)
+++ trunk/Source/WebCore/page/Settings.cpp	2012-07-26 18:26:32 UTC (rev 123775)
@@ -281,6 +281,7 @@
     , m_syncXHRInDocumentsEnabled(true)
     , m_cookieEnabled(true)
     , m_windowFocusRestricted(true)
+    , m_diagnosticLoggingEnabled(false)
     , m_loadsImagesAutomaticallyTimer(this, &Settings::loadsImagesAutomaticallyTimerFired)
     , m_incrementalRenderingSuppressionTimeoutInSeconds(defaultIncrementalRenderingSuppressionTimeoutInSeconds)
 {

Modified: trunk/Source/WebCore/page/Settings.h (123774 => 123775)


--- trunk/Source/WebCore/page/Settings.h	2012-07-26 18:18:09 UTC (rev 123774)
+++ trunk/Source/WebCore/page/Settings.h	2012-07-26 18:26:32 UTC (rev 123775)
@@ -603,6 +603,9 @@
         void setCookieEnabled(bool enabled) { m_cookieEnabled = enabled; }
         bool cookieEnabled() const { return m_cookieEnabled; }
 
+        void setDiagnosticLoggingEnabled(bool enabled) { m_diagnosticLoggingEnabled = enabled; }
+        bool diagnosticLoggingEnabled() const { return m_diagnosticLoggingEnabled; }
+
     private:
         explicit Settings(Page*);
 
@@ -776,6 +779,8 @@
 
         bool m_windowFocusRestricted : 1;
 
+        bool m_diagnosticLoggingEnabled : 1;
+
         Timer<Settings> m_loadsImagesAutomaticallyTimer;
         void loadsImagesAutomaticallyTimerFired(Timer<Settings>*);
         

Modified: trunk/Source/WebKit/mac/ChangeLog (123774 => 123775)


--- trunk/Source/WebKit/mac/ChangeLog	2012-07-26 18:18:09 UTC (rev 123774)
+++ trunk/Source/WebKit/mac/ChangeLog	2012-07-26 18:26:32 UTC (rev 123775)
@@ -1,3 +1,22 @@
+2012-07-25  Jer Noble  <jer.no...@apple.com>
+
+        Add setting to enable and disable diagnostic logging.
+        https://bugs.webkit.org/show_bug.cgi?id=92337
+
+        Reviewed by Anders Carlsson.
+
+        Add a WebKit WebPreferences API to set set the WebCore diagnosticLoggingEnabled setting.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]): Register the default value to false.
+        (-[WebPreferences diagnosticLoggingEnabled]): Simple userDefaults accessor.
+        (-[WebPreferences setDiagnosticLoggingEnabled:]): Ditto.
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]): Ensure this preference is propagated to Settings
+            whenever the preferences change.
+
 2012-07-25  Pratik Solanki  <psola...@apple.com>
 
         Remove catchesDelegateExceptions from WebViewData and related accessor methods

Modified: trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (123774 => 123775)


--- trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2012-07-26 18:18:09 UTC (rev 123774)
+++ trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2012-07-26 18:26:32 UTC (rev 123775)
@@ -124,6 +124,7 @@
 #define WebKitRegionBasedColumnsEnabledKey @"WebKitRegionBasedColumnsEnabled"
 #define WebKitShouldRespectImageOrientationKey @"WebKitShouldRespectImageOrientation"
 #define WebKitRequestAnimationFrameEnabledPreferenceKey @"WebKitRequestAnimationFrameEnabled"
+#define WebKitDiagnosticLoggingEnabledKey @"WebKitDiagnosticLoggingEnabled"
 
 // These are private both because callers should be using the cover methods and because the
 // cover methods themselves are private.

Modified: trunk/Source/WebKit/mac/WebView/WebPreferences.mm (123774 => 123775)


--- trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2012-07-26 18:18:09 UTC (rev 123774)
+++ trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2012-07-26 18:26:32 UTC (rev 123775)
@@ -398,6 +398,7 @@
         [NSNumber numberWithBool:NO],   WebKitShouldRespectImageOrientationKey,
         [NSNumber numberWithBool:YES],  WebKitRequestAnimationFrameEnabledPreferenceKey,
         [NSNumber numberWithBool:NO],   WebKitWantsBalancedSetDefersLoadingBehaviorKey,
+        [NSNumber numberWithBool:NO],   WebKitDiagnosticLoggingEnabledKey,
 
         [NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
         [NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheDefaultOriginQuota,
@@ -1728,6 +1729,16 @@
     return [self _floatValueForKey:WebKitIncrementalRenderingSuppressionTimeoutInSecondsKey];
 }
 
+- (BOOL)diagnosticLoggingEnabled
+{
+    return [self _boolValueForKey:WebKitDiagnosticLoggingEnabledKey];
+}
+
+- (void)setDiagnosticLoggingEnabled:(BOOL)enabled
+{
+    [self _setBoolValue:enabled forKey:WebKitDiagnosticLoggingEnabledKey];
+}
+
 @end
 
 @implementation WebPreferences (WebInternal)

Modified: trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (123774 => 123775)


--- trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2012-07-26 18:18:09 UTC (rev 123774)
+++ trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2012-07-26 18:26:32 UTC (rev 123775)
@@ -302,4 +302,7 @@
 - (void)setIncrementalRenderingSuppressionTimeoutInSeconds:(NSTimeInterval)timeout;
 - (NSTimeInterval)incrementalRenderingSuppressionTimeoutInSeconds;
 
+- (BOOL)diagnosticLoggingEnabled;
+- (void)setDiagnosticLoggingEnabled:(BOOL)enabled;
+
 @end

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (123774 => 123775)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2012-07-26 18:18:09 UTC (rev 123774)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2012-07-26 18:26:32 UTC (rev 123775)
@@ -1541,6 +1541,7 @@
     settings->setNeedsIsLoadingInAPISenseQuirk([self _needsIsLoadingInAPISenseQuirk]);
     settings->setRequestAnimationFrameEnabled([preferences requestAnimationFrameEnabled]);
     settings->setNeedsDidFinishLoadOrderQuirk(needsDidFinishLoadOrderQuirk());
+    settings->setDiagnosticLoggingEnabled([preferences diagnosticLoggingEnabled]);
     
     NSTimeInterval timeout = [preferences incrementalRenderingSuppressionTimeoutInSeconds];
     if (timeout > 0)

Modified: trunk/Source/WebKit2/ChangeLog (123774 => 123775)


--- trunk/Source/WebKit2/ChangeLog	2012-07-26 18:18:09 UTC (rev 123774)
+++ trunk/Source/WebKit2/ChangeLog	2012-07-26 18:26:32 UTC (rev 123775)
@@ -1,3 +1,21 @@
+2012-07-25  Jer Noble  <jer.no...@apple.com>
+
+        Add setting to enable and disable diagnostic logging.
+        https://bugs.webkit.org/show_bug.cgi?id=92337
+
+        Reviewed by Anders Carlsson.
+
+        Add a WebKit2 WKPreferences API to set set the WebCore diagnosticLoggingEnabled setting.
+
+        * Shared/WebPreferencesStore.h:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetDiagnosticLoggingEnabled):
+        (WKPreferencesGetDiagnosticLoggingEnabled):
+        * UIProcess/API/C/WKPreferencesPrivate.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences): Ensure this preference is propagated to Settings
+            whenever the preferences change.
+
 2012-07-26  Thiago Marcos P. Santos  <thiago.san...@intel.com>
 
         [EFL][WK2] Regression(r123731): Linking errors due to efreet functions

Modified: trunk/Source/WebKit2/Shared/WebPreferencesStore.h (123774 => 123775)


--- trunk/Source/WebKit2/Shared/WebPreferencesStore.h	2012-07-26 18:18:09 UTC (rev 123774)
+++ trunk/Source/WebKit2/Shared/WebPreferencesStore.h	2012-07-26 18:26:32 UTC (rev 123775)
@@ -113,6 +113,7 @@
     macro(ShouldRespectImageOrientation, shouldRespectImageOrientation, Bool, bool, false) \
     macro(WantsBalancedSetDefersLoadingBehavior, wantsBalancedSetDefersLoadingBehavior, Bool, bool, false) \
     macro(RequestAnimationFrameEnabled, requestAnimationFrameEnabled, Bool, bool, true) \
+    macro(DiagnosticLoggingEnabled, diagnosticLoggingEnabled, Bool, bool, false) \
     \
 
 #define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (123774 => 123775)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2012-07-26 18:18:09 UTC (rev 123774)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2012-07-26 18:26:32 UTC (rev 123775)
@@ -823,3 +823,13 @@
     // are usually always the same (in the UI process), they are not sent to web process, not triggering the reset.
     toImpl(preferencesRef)->forceUpdate();
 }
+
+void WKPreferencesSetDiagnosticLoggingEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+    toImpl(preferencesRef)->setDiagnosticLoggingEnabled(enabled);
+}
+
+bool WKPreferencesGetDiagnosticLoggingEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->diagnosticLoggingEnabled();
+}

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h (123774 => 123775)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h	2012-07-26 18:18:09 UTC (rev 123774)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h	2012-07-26 18:26:32 UTC (rev 123775)
@@ -187,6 +187,10 @@
 WK_EXPORT void WKPreferencesSetRequestAnimationFrameEnabled(WKPreferencesRef, bool);
 WK_EXPORT bool WKPreferencesGetRequestAnimationFrameEnabled(WKPreferencesRef);
 
+// Defaults to false
+WK_EXPORT void WKPreferencesSetDiagnosticLoggingEnabled(WKPreferencesRef preferencesRef, bool enabled);
+WK_EXPORT bool WKPreferencesGetDiagnosticLoggingEnabled(WKPreferencesRef preferencesRef);
+
 WK_EXPORT void WKPreferencesResetTestRunnerOverrides(WKPreferencesRef preferencesRef);
 
 #ifdef __cplusplus

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (123774 => 123775)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-07-26 18:18:09 UTC (rev 123774)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-07-26 18:26:32 UTC (rev 123775)
@@ -2086,6 +2086,8 @@
 
     settings->setShouldRespectImageOrientation(store.getBoolValueForKey(WebPreferencesKey::shouldRespectImageOrientationKey()));
 
+    settings->setDiagnosticLoggingEnabled(store.getBoolValueForKey(WebPreferencesKey::diagnosticLoggingEnabledKey()));
+
     platformPreferencesDidChange(store);
 
     if (m_drawingArea)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to