Changeset 229343 in webkit
- Timestamp:
- Mar 6, 2018 2:49:21 PM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r229342 r229343 1 2018-03-06 Brent Fulgham <bfulgham@apple.com> 2 3 NetworkDataTask should enable logging for automation clients 4 https://bugs.webkit.org/show_bug.cgi?id=183378 5 <rdar://problem/38189556> 6 7 Reviewed by Brian Burg. 8 9 The NetworkDataTaskCocoa class was only logging if the SessionID object allowed logging. 10 It should also be considering whether the current session is working on behalf of an 11 automation client. If so, it should allow logging. 12 13 * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: 14 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: 15 (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): 16 (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): 17 (WebKit::NetworkDataTaskCocoa::isAlwaysOnLoggingAllowed const): 18 1 19 2018-03-06 Ryan Haddad <ryanhaddad@apple.com> 2 20 -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h
r228239 r229343 1 1 /* 2 * Copyright (C) 2016 Apple Inc. All rights reserved.2 * Copyright (C) 2016-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 84 84 #endif 85 85 bool isThirdPartyRequest(const WebCore::ResourceRequest&); 86 bool isAlwaysOnLoggingAllowed() const; 86 87 87 88 RefPtr<SandboxExtension> m_sandboxExtension; -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm
r228244 r229343 213 213 #if HAVE(CFNETWORK_STORAGE_PARTITIONING) && !RELEASE_LOG_DISABLED 214 214 if (NetworkProcess::singleton().shouldLogCookieInformation()) 215 RELEASE_LOG_IF( m_session->sessionID().isAlwaysOnLoggingAllowed(), Network, "%p - NetworkDataTaskCocoa::logCookieInformation: pageID = %llu, frameID = %llu, taskID = %lu: Blocking cookies for URL %s", this, pageID, frameID, (unsigned long)[m_task taskIdentifier], nsRequest.URL.absoluteString.UTF8String);215 RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), Network, "%p - NetworkDataTaskCocoa::logCookieInformation: pageID = %llu, frameID = %llu, taskID = %lu: Blocking cookies for URL %s", this, pageID, frameID, (unsigned long)[m_task taskIdentifier], nsRequest.URL.absoluteString.UTF8String); 216 216 #else 217 217 LOG(NetworkSession, "%llu Blocking cookies for URL %s", [m_task taskIdentifier], nsRequest.URL.absoluteString.UTF8String); … … 223 223 #if HAVE(CFNETWORK_STORAGE_PARTITIONING) && !RELEASE_LOG_DISABLED 224 224 if (NetworkProcess::singleton().shouldLogCookieInformation()) 225 RELEASE_LOG_IF( m_session->sessionID().isAlwaysOnLoggingAllowed(), Network, "%p - NetworkDataTaskCocoa::logCookieInformation: pageID = %llu, frameID = %llu, taskID = %lu: Partitioning cookies for URL %s", this, pageID, frameID, (unsigned long)[m_task taskIdentifier], nsRequest.URL.absoluteString.UTF8String);225 RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), Network, "%p - NetworkDataTaskCocoa::logCookieInformation: pageID = %llu, frameID = %llu, taskID = %lu: Partitioning cookies for URL %s", this, pageID, frameID, (unsigned long)[m_task taskIdentifier], nsRequest.URL.absoluteString.UTF8String); 226 226 #else 227 227 LOG(NetworkSession, "%llu Partitioning cookies for URL %s", [m_task taskIdentifier], nsRequest.URL.absoluteString.UTF8String); … … 331 331 #if !RELEASE_LOG_DISABLED 332 332 if (NetworkProcess::singleton().shouldLogCookieInformation()) 333 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());333 RELEASE_LOG_IF(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()); 334 334 #else 335 335 LOG(NetworkSession, "%llu %s cookies for redirect URL %s", [m_task taskIdentifier], (shouldBlockCookies ? "Blocking" : "Not blocking"), request.url().string().utf8().data()); … … 348 348 #if !RELEASE_LOG_DISABLED 349 349 if (NetworkProcess::singleton().shouldLogCookieInformation()) 350 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());350 RELEASE_LOG_IF(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()); 351 351 #else 352 352 LOG(NetworkSession, "%llu %s cookies for redirect URL %s", [m_task taskIdentifier], (requiredStoragePartition.isEmpty() ? "Not partitioning" : "Partitioning"), request.url().string().utf8().data()); … … 477 477 } 478 478 479 } 479 bool NetworkDataTaskCocoa::isAlwaysOnLoggingAllowed() const 480 { 481 if (NetworkProcess::singleton().sessionIsControlledByAutomation(m_session->sessionID())) 482 return true; 483 484 return m_session->sessionID().isAlwaysOnLoggingAllowed(); 485 } 486 487 }
Note: See TracChangeset
for help on using the changeset viewer.