Title: [218821] trunk/Source/WebKit2
Revision
218821
Author
[email protected]
Date
2017-06-26 14:09:33 -0700 (Mon, 26 Jun 2017)

Log Message

Disable diagnostic logging in ephemeral sessions
https://bugs.webkit.org/show_bug.cgi?id=173849
<rdar://problem/32987341>

Reviewed by Geoffrey Garen.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setDiagnosticLoggingClient):
Construct a dummy logging client if the page's session is ephemeral.

(WebKit::WebPageProxy::logDiagnosticMessage):
(WebKit::WebPageProxy::logDiagnosticMessageWithResult):
(WebKit::WebPageProxy::logDiagnosticMessageWithValue):
(WebKit::WebPageProxy::logDiagnosticMessageWithEnhancedPrivacy):
Slight cleanup to make the code look a bit safer.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (218820 => 218821)


--- trunk/Source/WebKit2/ChangeLog	2017-06-26 20:17:50 UTC (rev 218820)
+++ trunk/Source/WebKit2/ChangeLog	2017-06-26 21:09:33 UTC (rev 218821)
@@ -1,3 +1,21 @@
+2017-06-26  Chris Dumez  <[email protected]>
+
+        Disable diagnostic logging in ephemeral sessions
+        https://bugs.webkit.org/show_bug.cgi?id=173849
+        <rdar://problem/32987341>
+
+        Reviewed by Geoffrey Garen.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::setDiagnosticLoggingClient):
+        Construct a dummy logging client if the page's session is ephemeral.
+
+        (WebKit::WebPageProxy::logDiagnosticMessage):
+        (WebKit::WebPageProxy::logDiagnosticMessageWithResult):
+        (WebKit::WebPageProxy::logDiagnosticMessageWithValue):
+        (WebKit::WebPageProxy::logDiagnosticMessageWithEnhancedPrivacy):
+        Slight cleanup to make the code look a bit safer.
+
 2017-06-26  Zan Dobersek  <[email protected]>
 
         [GCrypt] Properly initialize libgcrypt before using it

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (218820 => 218821)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2017-06-26 20:17:50 UTC (rev 218820)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2017-06-26 21:09:33 UTC (rev 218821)
@@ -562,7 +562,8 @@
 
 void WebPageProxy::setDiagnosticLoggingClient(std::unique_ptr<API::DiagnosticLoggingClient>&& diagnosticLoggingClient)
 {
-    if (!diagnosticLoggingClient) {
+    // Diagnostic logging is disabled for ephemeral sessions for privacy reasons.
+    if (sessionID().isEphemeral() || !diagnosticLoggingClient) {
         m_diagnosticLoggingClient = std::make_unique<API::DiagnosticLoggingClient>();
         return;
     }
@@ -5145,7 +5146,7 @@
     if (!DiagnosticLoggingClient::shouldLogAfterSampling(shouldSample))
         return;
 
-    m_diagnosticLoggingClient->logDiagnosticMessage(this, message, description);
+    diagnosticLoggingClient().logDiagnosticMessage(this, message, description);
 }
 
 void WebPageProxy::logDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result, WebCore::ShouldSample shouldSample)
@@ -5153,7 +5154,7 @@
     if (!DiagnosticLoggingClient::shouldLogAfterSampling(shouldSample))
         return;
 
-    m_diagnosticLoggingClient->logDiagnosticMessageWithResult(this, message, description, static_cast<WebCore::DiagnosticLoggingResultType>(result));
+    diagnosticLoggingClient().logDiagnosticMessageWithResult(this, message, description, static_cast<WebCore::DiagnosticLoggingResultType>(result));
 }
 
 void WebPageProxy::logDiagnosticMessageWithValue(const String& message, const String& description, double value, unsigned significantFigures, ShouldSample shouldSample)
@@ -5161,7 +5162,7 @@
     if (!DiagnosticLoggingClient::shouldLogAfterSampling(shouldSample))
         return;
 
-    m_diagnosticLoggingClient->logDiagnosticMessageWithValue(this, message, description, String::number(value, significantFigures));
+    diagnosticLoggingClient().logDiagnosticMessageWithValue(this, message, description, String::number(value, significantFigures));
 }
 
 void WebPageProxy::logDiagnosticMessageWithEnhancedPrivacy(const String& message, const String& description, ShouldSample shouldSample)
@@ -5169,7 +5170,7 @@
     if (!DiagnosticLoggingClient::shouldLogAfterSampling(shouldSample))
         return;
 
-    m_diagnosticLoggingClient->logDiagnosticMessageWithEnhancedPrivacy(this, message, description);
+    diagnosticLoggingClient().logDiagnosticMessageWithEnhancedPrivacy(this, message, description);
 }
 
 void WebPageProxy::logScrollingEvent(uint32_t eventType, MonotonicTime timestamp, uint64_t data)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to