Title: [228244] trunk/Source/WebKit
Revision
228244
Author
[email protected]
Date
2018-02-07 14:53:35 -0800 (Wed, 07 Feb 2018)

Log Message

Improve NetworkResourceLoader logging to capture redirect cases
https://bugs.webkit.org/show_bug.cgi?id=182573
<rdar://problem/37316714>

Reviewed by Chris Dumez.

Add logging for cookie partitioning or blocking during redirects.

* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (228243 => 228244)


--- trunk/Source/WebKit/ChangeLog	2018-02-07 22:33:10 UTC (rev 228243)
+++ trunk/Source/WebKit/ChangeLog	2018-02-07 22:53:35 UTC (rev 228244)
@@ -1,3 +1,16 @@
+2018-02-07  Brent Fulgham  <[email protected]>
+
+        Improve NetworkResourceLoader logging to capture redirect cases
+        https://bugs.webkit.org/show_bug.cgi?id=182573
+        <rdar://problem/37316714>
+
+        Reviewed by Chris Dumez.
+
+        Add logging for cookie partitioning or blocking during redirects.
+
+        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
+        (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
+
 2018-02-07  John Wilander  <[email protected]>
 
         Restrict Referer to just the origin for third parties in private mode and third parties ITP blocks cookies for in regular mode

Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm (228243 => 228244)


--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm	2018-02-07 22:33:10 UTC (rev 228243)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm	2018-02-07 22:53:35 UTC (rev 228244)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -328,8 +328,13 @@
     bool shouldBlockCookies = false;
 #if HAVE(CFNETWORK_STORAGE_PARTITIONING)
     shouldBlockCookies = m_session->networkStorageSession().shouldBlockCookies(request);
+#if !RELEASE_LOG_DISABLED
+    if (NetworkProcess::singleton().shouldLogCookieInformation())
+        RELEASE_LOG_IF(m_session->sessionID().isAlwaysOnLoggingAllowed(), Network, "%p - NetworkDataTaskCocoa::willPerformHTTPRedirection::logCookieInformation: pageID = %llu, frameID = %llu, taskID = %lu: %s cookies for redirect URL %s", this, m_pageID, m_frameID, (unsigned long)[m_task taskIdentifier], (shouldBlockCookies ? "Blocking" : "Not blocking"), request.url().string().utf8().data());
+#else
     LOG(NetworkSession, "%llu %s cookies for redirect URL %s", [m_task taskIdentifier], (shouldBlockCookies ? "Blocking" : "Not blocking"), request.url().string().utf8().data());
 #endif
+#endif
 
     if (shouldBlockCookies || (m_session->sessionID().isEphemeral() && isThirdPartyRequest(request)))
         request.setExistingHTTPReferrerToOriginString();
@@ -340,7 +345,12 @@
 
     if (!shouldBlockCookies) {
         auto requiredStoragePartition = m_session->networkStorageSession().cookieStoragePartition(request, m_frameID, m_pageID);
+#if !RELEASE_LOG_DISABLED
+        if (NetworkProcess::singleton().shouldLogCookieInformation())
+            RELEASE_LOG_IF(m_session->sessionID().isAlwaysOnLoggingAllowed(), Network, "%p - NetworkDataTaskCocoa::willPerformHTTPRedirection::logCookieInformation: pageID = %llu, frameID = %llu, taskID = %lu: %s cookies for redirect URL %s", this, m_pageID, m_frameID, (unsigned long)[m_task taskIdentifier], (requiredStoragePartition.isEmpty() ? "Not partitioning" : "Partitioning"), request.url().string().utf8().data());
+#else
         LOG(NetworkSession, "%llu %s cookies for redirect URL %s", [m_task taskIdentifier], (requiredStoragePartition.isEmpty() ? "Not partitioning" : "Partitioning"), request.url().string().utf8().data());
+#endif
         applyCookiePartitioningPolicy(requiredStoragePartition, m_task.get()._storagePartitionIdentifier);
     }
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to