Inhibit CFNetwork logging in private sessions
authorkrollin@apple.com <krollin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Mar 2019 23:29:13 +0000 (23:29 +0000)
committerkrollin@apple.com <krollin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Mar 2019 23:29:13 +0000 (23:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196268
<rdar://problem/48210793>

Reviewed by Alex Christensen.

Before performing any logging, the NetworkProcess checks to see if
it's performing an operation associated with a private (ephemeral)
browsing session. If so, it skips the logging. However, networking
layers below the NetworkProcess don't know about private browsing, so
they would still perform their own logging. CFNetwork now has a flag
that lets us control that, so set it to False if private browsing.

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::configurationForSessionID):

Source/WTF:

* wtf/Platform.h:

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

Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm

index 026b9cc..85d69ae 100644 (file)
@@ -1,3 +1,20 @@
+2019-03-26  Keith Rollin  <krollin@apple.com>
+
+        Inhibit CFNetwork logging in private sessions
+        https://bugs.webkit.org/show_bug.cgi?id=196268
+        <rdar://problem/48210793>
+
+        Reviewed by Alex Christensen.
+
+        Before performing any logging, the NetworkProcess checks to see if
+        it's performing an operation associated with a private (ephemeral)
+        browsing session. If so, it skips the logging. However, networking
+        layers below the NetworkProcess don't know about private browsing, so
+        they would still perform their own logging. CFNetwork now has a flag
+        that lets us control that, so set it to False if private browsing.
+
+        * wtf/Platform.h:
+
 2019-03-25  Alex Christensen  <achristensen@webkit.org>
 
         Expected shouldn't assume its contained types are copyable
index 36c0f67..b3a2330 100644 (file)
 #if PLATFORM(IOSMAC)
 #define ENABLE_PLATFORM_DRIVEN_TEXT_CHECKING 1
 #endif
+
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 60000) || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 130000)
+#define HAVE_ALLOWS_SENSITIVE_LOGGING 1
+#endif
index a93cec7..743b2ff 100644 (file)
@@ -1,3 +1,21 @@
+2019-03-26  Keith Rollin  <krollin@apple.com>
+
+        Inhibit CFNetwork logging in private sessions
+        https://bugs.webkit.org/show_bug.cgi?id=196268
+        <rdar://problem/48210793>
+
+        Reviewed by Alex Christensen.
+
+        Before performing any logging, the NetworkProcess checks to see if
+        it's performing an operation associated with a private (ephemeral)
+        browsing session. If so, it skips the logging. However, networking
+        layers below the NetworkProcess don't know about private browsing, so
+        they would still perform their own logging. CFNetwork now has a flag
+        that lets us control that, so set it to False if private browsing.
+
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (WebKit::configurationForSessionID):
+
 2019-03-26  Chris Dumez  <cdumez@apple.com>
 
         Add basic layout test coverage for File Picker on iOS
index f5731fe..bf2d046 100644 (file)
@@ -800,6 +800,9 @@ static NSURLSessionConfiguration *configurationForSessionID(const PAL::SessionID
     if (session.isEphemeral()) {
         NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration ephemeralSessionConfiguration];
         configuration._shouldSkipPreferredClientCertificateLookup = YES;
+#if HAVE(ALLOWS_SENSITIVE_LOGGING)
+        configuration._allowsSensitiveLogging = NO;
+#endif
         return configuration;
     }
     return [NSURLSessionConfiguration defaultSessionConfiguration];