Changeset 229201 in webkit
- Timestamp:
- Mar 3, 2018 3:27:18 PM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r229195 r229201 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-02 Yusuke Suzuki <utatane.tea@gmail.com> 2 34 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp
r228893 r229201 326 326 { 327 327 SessionTracker::destroySession(sessionID); 328 m_sessionsControlledByAutomation.remove(sessionID); 328 329 } 329 330 … … 400 401 } 401 402 #endif 403 404 bool NetworkProcess::sessionIsControlledByAutomation(PAL::SessionID sessionID) const 405 { 406 return m_sessionsControlledByAutomation.contains(sessionID); 407 } 408 409 void NetworkProcess::setSessionIsControlledByAutomation(PAL::SessionID sessionID, bool controlled) 410 { 411 if (controlled) 412 m_sessionsControlledByAutomation.add(sessionID); 413 else 414 m_sessionsControlledByAutomation.remove(sessionID); 415 } 402 416 403 417 static void fetchDiskCacheEntries(PAL::SessionID sessionID, OptionSet<WebsiteDataFetchOption> fetchOptions, Function<void (Vector<WebsiteData::Entry>)>&& completionHandler) -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.h
r228109 r229201 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) -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in
r228109 r229201 89 89 RemovePrevalentDomains(PAL::SessionID sessionID, Vector<String> domainsWithInteraction); 90 90 #endif 91 92 SetSessionIsControlledByAutomation(PAL::SessionID sessionID, bool controlled); 91 93 } -
trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp
r228231 r229201 707 707 bool NetworkResourceLoader::isAlwaysOnLoggingAllowed() const 708 708 { 709 if (NetworkProcess::singleton().sessionIsControlledByAutomation(sessionID())) 710 return true; 711 709 712 return sessionID().isAlwaysOnLoggingAllowed(); 710 713 } -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r229063 r229201 1282 1282 m_controlledByAutomation = controlled; 1283 1283 1284 if (isValid()) 1285 m_process->send(Messages::WebPage::SetControlledByAutomation(controlled), m_pageID); 1284 if (!isValid()) 1285 return; 1286 1287 m_process->send(Messages::WebPage::SetControlledByAutomation(controlled), m_pageID); 1288 m_process->processPool().sendToNetworkingProcess(Messages::NetworkProcess::SetSessionIsControlledByAutomation(m_websiteDataStore->sessionID(), m_controlledByAutomation)); 1286 1289 } 1287 1290
Note: See TracChangeset
for help on using the changeset viewer.