Changeset 230393 in webkit
- Timestamp:
- Apr 9, 2018 3:52:25 AM (6 years ago)
- Location:
- releases/WebKitGTK/webkit-2.20/Source/WebKit
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.20/Source/WebKit/ChangeLog
r229528 r230393 1 2018-03-03 Brent Fulgham <bfulgham@apple.com> 2 3 Notify the NetworkProcess when a session is servicing an automation client 4 https://bugs.webkit.org/show_bug.cgi?id=183306 5 <rdar://problem/37835783> 6 7 Reviewed by Brian Burg. 8 9 Network loads servicing WebDriver are done through an ephemeral session. While this is great 10 for protecting a developer's machine from sharing state with test runs, it has the unintended 11 effect of blocking certain logging operations. 12 13 We do not log content in ephemeral sessions to protect user privacy. However, ephemeral sessions 14 generated by WebDriver should participate in logging so that proper testing (with logging) can 15 be done. 16 17 This patch signals the NetworkProcess when an ephemeral session (created for automation purposes) 18 is created, so that it can allow logging. 19 20 * NetworkProcess/NetworkProcess.cpp: 21 (WebKit::NetworkProcess::destroySession): Remove controlled-by-automation entry. 22 (WebKit::NetworkProcess::sessionIsControlledByAutomation const): Added. 23 (WebKit::NetworkProcess::setSessionIsControlledByAutomation): Added. 24 * NetworkProcess/NetworkProcess.h: 25 * NetworkProcess/NetworkProcess.messages.in: 26 * NetworkProcess/NetworkResourceLoader.cpp: 27 (WebKit::NetworkResourceLoader::isAlwaysOnLoggingAllowed const): Checks if the relevant session 28 is servicing an automation client, and returns true if it is. 29 * UIProcess/WebPageProxy.cpp: 30 (WebKit::WebPageProxy::WebPageProxy): Signal the network process if this page is being created 31 for an automation client. 32 1 33 2018-03-12 Carlos Garcia Campos <cgarcia@igalia.com> 2 34 -
releases/WebKitGTK/webkit-2.20/Source/WebKit/NetworkProcess/NetworkProcess.cpp
r228621 r230393 315 315 { 316 316 SessionTracker::destroySession(sessionID); 317 m_sessionsControlledByAutomation.remove(sessionID); 317 318 } 318 319 … … 389 390 } 390 391 #endif 392 393 bool NetworkProcess::sessionIsControlledByAutomation(PAL::SessionID sessionID) const 394 { 395 return m_sessionsControlledByAutomation.contains(sessionID); 396 } 397 398 void NetworkProcess::setSessionIsControlledByAutomation(PAL::SessionID sessionID, bool controlled) 399 { 400 if (controlled) 401 m_sessionsControlledByAutomation.add(sessionID); 402 else 403 m_sessionsControlledByAutomation.remove(sessionID); 404 } 391 405 392 406 static void fetchDiskCacheEntries(PAL::SessionID sessionID, OptionSet<WebsiteDataFetchOption> fetchOptions, Function<void (Vector<WebsiteData::Entry>)>&& completionHandler) -
releases/WebKitGTK/webkit-2.20/Source/WebKit/NetworkProcess/NetworkProcess.h
r228621 r230393 35 35 #include <wtf/Forward.h> 36 36 #include <wtf/Function.h> 37 #include <wtf/HashSet.h> 37 38 #include <wtf/MemoryPressureHandler.h> 38 39 #include <wtf/NeverDestroyed.h> … … 152 153 bool shouldLogCookieInformation() const { return m_logCookieInformation; } 153 154 #endif 155 156 void setSessionIsControlledByAutomation(PAL::SessionID, bool); 157 bool sessionIsControlledByAutomation(PAL::SessionID) const; 154 158 155 159 private: … … 259 263 HashMap<uint64_t, WeakPtr<PreconnectTask>> m_waitingPreconnectTasks; 260 264 #endif 265 HashSet<PAL::SessionID> m_sessionsControlledByAutomation; 261 266 262 267 #if PLATFORM(COCOA) -
releases/WebKitGTK/webkit-2.20/Source/WebKit/NetworkProcess/NetworkProcess.messages.in
r228621 r230393 89 89 RemovePrevalentDomains(PAL::SessionID sessionID, Vector<String> domainsWithInteraction); 90 90 #endif 91 92 SetSessionIsControlledByAutomation(PAL::SessionID sessionID, bool controlled); 91 93 } -
releases/WebKitGTK/webkit-2.20/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp
r227991 r230393 702 702 bool NetworkResourceLoader::isAlwaysOnLoggingAllowed() const 703 703 { 704 if (NetworkProcess::singleton().sessionIsControlledByAutomation(sessionID())) 705 return true; 706 704 707 return sessionID().isAlwaysOnLoggingAllowed(); 705 708 } -
releases/WebKitGTK/webkit-2.20/Source/WebKit/UIProcess/WebPageProxy.cpp
r229016 r230393 1264 1264 m_controlledByAutomation = controlled; 1265 1265 1266 if (isValid()) 1267 m_process->send(Messages::WebPage::SetControlledByAutomation(controlled), m_pageID); 1266 if (!isValid()) 1267 return; 1268 1269 m_process->send(Messages::WebPage::SetControlledByAutomation(controlled), m_pageID); 1270 m_process->processPool().sendToNetworkingProcess(Messages::NetworkProcess::SetSessionIsControlledByAutomation(m_websiteDataStore->sessionID(), m_controlledByAutomation)); 1268 1271 } 1269 1272
Note: See TracChangeset
for help on using the changeset viewer.