Changeset 261288 in webkit
- Timestamp:
- May 7, 2020 8:01:31 AM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r261284 r261288 1 2020-05-07 Chris Dumez <cdumez@apple.com> 2 3 [iOS] AuxiliaryProcessProxy::sendWithAsyncReply() should prevent auxiliary process suspension while processing the IPC 4 https://bugs.webkit.org/show_bug.cgi?id=209928 5 6 Reviewed by Youenn Fablet. 7 8 AuxiliaryProcessProxy::sendWithAsyncReply() should prevent auxiliary process suspension 9 on iOS while processing the IPC. If the process is suspended either before or during 10 the IPC, this could result in hangs. This is a speculative fix for the flaky timeouts 11 we see on many tests on iOS only. We know that missing activities with 12 sendWithAsyncReply has caused test timeouts in the past (Bug 211421). 13 14 * UIProcess/AuxiliaryProcessProxy.cpp: 15 (WebKit::AuxiliaryProcessProxy::sendMessage): 16 * UIProcess/AuxiliaryProcessProxy.h: 17 (WebKit::AuxiliaryProcessProxy::sendWithAsyncReply): 18 * UIProcess/GPU/GPUProcessProxy.cpp: 19 (WebKit::GPUProcessProxy::getGPUProcessConnection): 20 * UIProcess/GPU/GPUProcessProxy.h: 21 * UIProcess/Network/NetworkProcessProxy.cpp: 22 (WebKit::NetworkProcessProxy::getNetworkProcessConnection): 23 (WebKit::NetworkProcessProxy::setUseITPDatabase): 24 (WebKit::NetworkProcessProxy::resetCacheMaxAgeCapForPrevalentResources): 25 (WebKit::NetworkProcessProxy::resetParametersToDefaultValues): 26 (WebKit::NetworkProcessProxy::scheduleClearInMemoryAndPersistent): 27 (WebKit::NetworkProcessProxy::resetCrossSiteLoadsWithLinkDecorationForTesting): 28 (WebKit::NetworkProcessProxy::setAppBoundDomainsForResourceLoadStatistics): 29 (WebKit::NetworkProcessProxy::setShouldDowngradeReferrerForTesting): 30 (WebKit::NetworkProcessProxy::setThirdPartyCookieBlockingMode): 31 (WebKit::NetworkProcessProxy::setShouldEnbleSameSiteStrictEnforcementForTesting): 32 (WebKit::NetworkProcessProxy::setFirstPartyWebsiteDataRemovalModeForTesting): 33 (WebKit::NetworkProcessProxy::sendPrepareToSuspend): 34 * UIProcess/Network/NetworkProcessProxy.h: 35 * UIProcess/Plugins/PluginProcessProxy.cpp: 36 (WebKit::PluginProcessProxy::PluginProcessProxy): 37 * UIProcess/Plugins/PluginProcessProxy.h: 38 * UIProcess/ProcessThrottler.h: 39 (WebKit::ProcessThrottler::Activity::Activity): 40 (WebKit::ProcessThrottler::Activity::isQuietActivity const): 41 (WebKit::ProcessThrottler::Activity::invalidate): 42 * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: 43 (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest): 44 * UIProcess/WebBackForwardCacheEntry.cpp: 45 (WebKit::WebBackForwardCacheEntry::~WebBackForwardCacheEntry): 46 * UIProcess/WebCookieManagerProxy.cpp: 47 (WebKit::WebCookieManagerProxy::getHostnamesWithCookies): 48 (WebKit::WebCookieManagerProxy::deleteCookie): 49 (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince): 50 (WebKit::WebCookieManagerProxy::setCookies): 51 (WebKit::WebCookieManagerProxy::getAllCookies): 52 (WebKit::WebCookieManagerProxy::getCookies): 53 (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy): 54 (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy): 55 * UIProcess/WebPageProxy.cpp: 56 (WebKit::WebPageProxy::getProcessDisplayName): 57 * UIProcess/WebProcessProxy.cpp: 58 (WebKit::WebProcessProxy::setThirdPartyCookieBlockingMode): 59 (WebKit::WebProcessProxy::fetchWebsiteData): 60 (WebKit::WebProcessProxy::deleteWebsiteData): 61 (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): 62 (WebKit::WebProcessProxy::sendPrepareToSuspend): 63 (WebKit::WebProcessProxy::activePagesDomainsForTesting): 64 (WebKit::WebProcessProxy::establishServiceWorkerContext): 65 * UIProcess/WebProcessProxy.h: 66 * UIProcess/ios/WebPageProxyIOS.mm: 67 (WebKit::WebPageProxy::insertTextPlaceholder): 68 (WebKit::WebPageProxy::removeTextPlaceholder): 69 (WebKit::WebPageProxy::requestAutocorrectionData): 70 (WebKit::WebPageProxy::requestEvasionRectsAboveSelection): 71 (WebKit::WebPageProxy::updateSelectionWithDelta): 72 (WebKit::WebPageProxy::requestDocumentEditingContext): 73 (WebKit::WebPageProxy::insertDroppedImagePlaceholders): 74 1 75 2020-05-07 Carlos Garcia Campos <cgarcia@igalia.com> 2 76 -
trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp
r261254 r261288 151 151 } 152 152 153 bool AuxiliaryProcessProxy::sendMessage(std::unique_ptr<IPC::Encoder> encoder, OptionSet<IPC::SendOption> sendOptions, Optional<std::pair<CompletionHandler<void(IPC::Decoder*)>, uint64_t>>&& asyncReplyInfo) 154 { 153 bool AuxiliaryProcessProxy::sendMessage(std::unique_ptr<IPC::Encoder> encoder, OptionSet<IPC::SendOption> sendOptions, Optional<std::pair<CompletionHandler<void(IPC::Decoder*)>, uint64_t>>&& asyncReplyInfo, ShouldStartProcessThrottlerActivity shouldStartProcessThrottlerActivity) 154 { 155 if (asyncReplyInfo && canSendMessage() && shouldStartProcessThrottlerActivity == ShouldStartProcessThrottlerActivity::Yes) { 156 auto completionHandler = std::exchange(asyncReplyInfo->first, nullptr); 157 asyncReplyInfo->first = [activity = throttler().backgroundActivity(ASCIILiteral::null()), completionHandler = WTFMove(completionHandler)](IPC::Decoder* decoder) mutable { 158 completionHandler(decoder); 159 }; 160 } 161 155 162 switch (state()) { 156 163 case State::Launching: -
trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h
r261254 r261288 37 37 namespace WebKit { 38 38 39 class ProcessThrottler; 40 39 41 class AuxiliaryProcessProxy : ProcessLauncher::Client, public IPC::Connection::Client { 40 42 WTF_MAKE_NONCOPYABLE(AuxiliaryProcessProxy); … … 49 51 void terminate(); 50 52 53 virtual ProcessThrottler& throttler() = 0; 54 51 55 template<typename T> bool send(T&& message, uint64_t destinationID, OptionSet<IPC::SendOption> sendOptions = { }); 52 56 template<typename T> bool sendSync(T&& message, typename T::Reply&&, uint64_t destinationID, Seconds timeout = 1_s, OptionSet<IPC::SendSyncOption> sendSyncOptions = { }); 53 template<typename T, typename C> void sendWithAsyncReply(T&&, C&&, uint64_t destinationID = 0, OptionSet<IPC::SendOption> = { }); 57 58 enum class ShouldStartProcessThrottlerActivity : bool { No, Yes }; 59 template<typename T, typename C> void sendWithAsyncReply(T&&, C&&, uint64_t destinationID = 0, OptionSet<IPC::SendOption> = { }, ShouldStartProcessThrottlerActivity = ShouldStartProcessThrottlerActivity::Yes); 54 60 55 61 template<typename T, typename U> … … 105 111 106 112 bool canSendMessage() const { return state() != State::Terminated;} 107 bool sendMessage(std::unique_ptr<IPC::Encoder>, OptionSet<IPC::SendOption>, Optional<std::pair<CompletionHandler<void(IPC::Decoder*)>, uint64_t>>&& asyncReplyInfo = WTF::nullopt );113 bool sendMessage(std::unique_ptr<IPC::Encoder>, OptionSet<IPC::SendOption>, Optional<std::pair<CompletionHandler<void(IPC::Decoder*)>, uint64_t>>&& asyncReplyInfo = WTF::nullopt, ShouldStartProcessThrottlerActivity = ShouldStartProcessThrottlerActivity::Yes); 108 114 109 115 void shutDownProcess(); … … 171 177 172 178 template<typename T, typename C> 173 void AuxiliaryProcessProxy::sendWithAsyncReply(T&& message, C&& completionHandler, uint64_t destinationID, OptionSet<IPC::SendOption> sendOptions )179 void AuxiliaryProcessProxy::sendWithAsyncReply(T&& message, C&& completionHandler, uint64_t destinationID, OptionSet<IPC::SendOption> sendOptions, ShouldStartProcessThrottlerActivity shouldStartProcessThrottlerActivity) 174 180 { 175 181 COMPILE_ASSERT(!T::isSync, AsyncMessageExpected); … … 184 190 else 185 191 T::cancelReply(WTFMove(completionHandler)); 186 }, listenerID }} );192 }, listenerID }}, shouldStartProcessThrottlerActivity); 187 193 } 188 194 -
trunk/Source/WebKit/UIProcess/GPU/GPUProcessProxy.cpp
r261278 r261288 184 184 185 185 RELEASE_LOG(ProcessSuspension, "%p - GPUProcessProxy is taking a background assertion because a web process is requesting a connection", this); 186 sendWithAsyncReply(Messages::GPUProcess::CreateGPUConnectionToWebProcess { webProcessProxy.coreProcessIdentifier(), webProcessProxy.sessionID() }, [this, weakThis = makeWeakPtr(*this), reply = WTFMove(reply) , activity = throttler().backgroundActivity("GPUProcessProxy::getGPUProcessConnection"_s)](auto&& connectionIdentifier) mutable {186 sendWithAsyncReply(Messages::GPUProcess::CreateGPUConnectionToWebProcess { webProcessProxy.coreProcessIdentifier(), webProcessProxy.sessionID() }, [this, weakThis = makeWeakPtr(*this), reply = WTFMove(reply)](auto&& connectionIdentifier) mutable { 187 187 if (!weakThis) { 188 188 RELEASE_LOG_ERROR(Process, "GPUProcessProxy::getGPUProcessConnection: GPUProcessProxy deallocated during connection establishment"); -
trunk/Source/WebKit/UIProcess/GPU/GPUProcessProxy.h
r261254 r261288 58 58 void getGPUProcessConnection(WebProcessProxy&, Messages::WebProcessProxy::GetGPUProcessConnectionDelayedReply&&); 59 59 60 ProcessThrottler& throttler() { return m_throttler; }60 ProcessThrottler& throttler() final { return m_throttler; } 61 61 void updateProcessAssertion(); 62 62 -
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
r261278 r261288 129 129 { 130 130 RELEASE_LOG(ProcessSuspension, "%p - NetworkProcessProxy is taking a background assertion because a web process is requesting a connection", this); 131 sendWithAsyncReply(Messages::NetworkProcess::CreateNetworkConnectionToWebProcess { webProcessProxy.coreProcessIdentifier(), webProcessProxy.sessionID() }, [this, weakThis = makeWeakPtr(*this), reply = WTFMove(reply) , activity = throttler().backgroundActivity("NetworkProcessProxy::getNetworkProcessConnection"_s)](auto&& connectionIdentifier, auto cookieAcceptPolicy) mutable {131 sendWithAsyncReply(Messages::NetworkProcess::CreateNetworkConnectionToWebProcess { webProcessProxy.coreProcessIdentifier(), webProcessProxy.sessionID() }, [this, weakThis = makeWeakPtr(*this), reply = WTFMove(reply)](auto&& connectionIdentifier, auto cookieAcceptPolicy) mutable { 132 132 if (!weakThis) { 133 133 RELEASE_LOG_ERROR(Process, "NetworkProcessProxy::getNetworkProcessConnection: NetworkProcessProxy deallocated during connection establishment"); … … 851 851 void NetworkProcessProxy::setUseITPDatabase(PAL::SessionID sessionID, bool value, CompletionHandler<void()>&& completionHandler) 852 852 { 853 sendWithAsyncReply(Messages::NetworkProcess::SetUseITPDatabase(sessionID, value), [ activity = throttler().backgroundActivity("NetworkProcessProxy::setUseITPDatabase"_s),completionHandler = WTFMove(completionHandler)]() mutable {853 sendWithAsyncReply(Messages::NetworkProcess::SetUseITPDatabase(sessionID, value), [completionHandler = WTFMove(completionHandler)]() mutable { 854 854 completionHandler(); 855 855 }); … … 984 984 } 985 985 986 sendWithAsyncReply(Messages::NetworkProcess::ResetCacheMaxAgeCapForPrevalentResources(sessionID), [ activity = throttler().backgroundActivity("NetworkProcessProxy::resetCacheMaxAgeCapForPrevalentResources"_s),completionHandler = WTFMove(completionHandler)]() mutable {986 sendWithAsyncReply(Messages::NetworkProcess::ResetCacheMaxAgeCapForPrevalentResources(sessionID), [completionHandler = WTFMove(completionHandler)]() mutable { 987 987 completionHandler(); 988 988 }); … … 996 996 } 997 997 998 sendWithAsyncReply(Messages::NetworkProcess::ResetParametersToDefaultValues(sessionID), [ activity = throttler().backgroundActivity("NetworkProcessProxy::resetParametersToDefaultValues"_s),completionHandler = WTFMove(completionHandler)]() mutable {998 sendWithAsyncReply(Messages::NetworkProcess::ResetParametersToDefaultValues(sessionID), [completionHandler = WTFMove(completionHandler)]() mutable { 999 999 completionHandler(); 1000 1000 }); … … 1018 1018 } 1019 1019 1020 sendWithAsyncReply(Messages::NetworkProcess::ScheduleClearInMemoryAndPersistent(sessionID, { }, shouldGrandfather), [ activity = throttler().backgroundActivity("NetworkProcessProxy::scheduleClearInMemoryAndPersistent"_s),completionHandler = WTFMove(completionHandler)]() mutable {1020 sendWithAsyncReply(Messages::NetworkProcess::ScheduleClearInMemoryAndPersistent(sessionID, { }, shouldGrandfather), [completionHandler = WTFMove(completionHandler)]() mutable { 1021 1021 completionHandler(); 1022 1022 }); … … 1098 1098 } 1099 1099 1100 sendWithAsyncReply(Messages::NetworkProcess::ResetCrossSiteLoadsWithLinkDecorationForTesting(sessionID), [ activity = throttler().backgroundActivity("NetworkProcessProxy::resetCrossSiteLoadsWithLinkDecorationForTesting"_s),completionHandler = WTFMove(completionHandler)]() mutable {1100 sendWithAsyncReply(Messages::NetworkProcess::ResetCrossSiteLoadsWithLinkDecorationForTesting(sessionID), [completionHandler = WTFMove(completionHandler)]() mutable { 1101 1101 completionHandler(); 1102 1102 }); … … 1140 1140 void NetworkProcessProxy::setAppBoundDomainsForResourceLoadStatistics(PAL::SessionID sessionID, const HashSet<RegistrableDomain>& appBoundDomains, CompletionHandler<void()>&& completionHandler) 1141 1141 { 1142 sendWithAsyncReply(Messages::NetworkProcess::SetAppBoundDomainsForResourceLoadStatistics(sessionID, appBoundDomains), [ activity = throttler().backgroundActivity("NetworkProcessProxy::setAppBoundDomainsForResourceLoadStatistics"_s),completionHandler = WTFMove(completionHandler)]() mutable {1142 sendWithAsyncReply(Messages::NetworkProcess::SetAppBoundDomainsForResourceLoadStatistics(sessionID, appBoundDomains), [completionHandler = WTFMove(completionHandler)]() mutable { 1143 1143 completionHandler(); 1144 1144 }); … … 1152 1152 } 1153 1153 1154 sendWithAsyncReply(Messages::NetworkProcess::SetShouldDowngradeReferrerForTesting(enabled), [ activity = throttler().backgroundActivity("NetworkProcessProxy::setShouldDowngradeReferrerForTesting"_s),completionHandler = WTFMove(completionHandler)]() mutable {1154 sendWithAsyncReply(Messages::NetworkProcess::SetShouldDowngradeReferrerForTesting(enabled), [completionHandler = WTFMove(completionHandler)]() mutable { 1155 1155 completionHandler(); 1156 1156 }); … … 1159 1159 void NetworkProcessProxy::setThirdPartyCookieBlockingMode(PAL::SessionID sessionID, ThirdPartyCookieBlockingMode blockingMode, CompletionHandler<void()>&& completionHandler) 1160 1160 { 1161 sendWithAsyncReply(Messages::NetworkProcess::SetThirdPartyCookieBlockingMode(sessionID, blockingMode), [ activity = throttler().backgroundActivity("NetworkProcessProxy::setThirdPartyCookieBlockingMode"_s),completionHandler = WTFMove(completionHandler)]() mutable {1161 sendWithAsyncReply(Messages::NetworkProcess::SetThirdPartyCookieBlockingMode(sessionID, blockingMode), [completionHandler = WTFMove(completionHandler)]() mutable { 1162 1162 completionHandler(); 1163 1163 }); … … 1166 1166 void NetworkProcessProxy::setShouldEnbleSameSiteStrictEnforcementForTesting(PAL::SessionID sessionID, WebCore::SameSiteStrictEnforcementEnabled enabled, CompletionHandler<void()>&& completionHandler) 1167 1167 { 1168 sendWithAsyncReply(Messages::NetworkProcess::SetShouldEnbleSameSiteStrictEnforcementForTesting(sessionID, enabled), [activity = throttler().backgroundActivity("NetworkProcessProxy::setShouldEnbleSameSiteStrictEnforcementForTesting"_s), completionHandler = WTFMove(completionHandler)]() mutable { 1169 completionHandler(); 1170 }); 1168 sendWithAsyncReply(Messages::NetworkProcess::SetShouldEnbleSameSiteStrictEnforcementForTesting(sessionID, enabled), WTFMove(completionHandler)); 1171 1169 } 1172 1170 … … 1178 1176 } 1179 1177 1180 sendWithAsyncReply(Messages::NetworkProcess::SetFirstPartyWebsiteDataRemovalModeForTesting(sessionID, mode), [activity = throttler().backgroundActivity("NetworkProcessProxy::setFirstPartyWebsiteDataRemovalModeForTesting"_s), completionHandler = WTFMove(completionHandler)]() mutable { 1181 completionHandler(); 1182 }); 1178 sendWithAsyncReply(Messages::NetworkProcess::SetFirstPartyWebsiteDataRemovalModeForTesting(sessionID, mode), WTFMove(completionHandler)); 1183 1179 } 1184 1180 … … 1210 1206 void NetworkProcessProxy::sendPrepareToSuspend(IsSuspensionImminent isSuspensionImminent, CompletionHandler<void()>&& completionHandler) 1211 1207 { 1212 sendWithAsyncReply(Messages::NetworkProcess::PrepareToSuspend(isSuspensionImminent == IsSuspensionImminent::Yes), WTFMove(completionHandler) );1208 sendWithAsyncReply(Messages::NetworkProcess::PrepareToSuspend(isSuspensionImminent == IsSuspensionImminent::Yes), WTFMove(completionHandler), 0, { }, ShouldStartProcessThrottlerActivity::No); 1213 1209 } 1214 1210 -
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h
r261254 r261288 194 194 void terminateUnresponsiveServiceWorkerProcesses(WebCore::ProcessIdentifier); 195 195 196 ProcessThrottler& throttler() { return m_throttler; }196 ProcessThrottler& throttler() final { return m_throttler; } 197 197 void updateProcessAssertion(); 198 198 -
trunk/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.cpp
r261254 r261288 63 63 64 64 PluginProcessProxy::PluginProcessProxy(PluginProcessManager* PluginProcessManager, const PluginProcessAttributes& pluginProcessAttributes, uint64_t pluginProcessToken) 65 : m_pluginProcessManager(PluginProcessManager) 65 : m_throttler(*this, false) 66 , m_pluginProcessManager(PluginProcessManager) 66 67 , m_pluginProcessAttributes(pluginProcessAttributes) 67 68 , m_pluginProcessToken(pluginProcessToken) -
trunk/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.h
r261254 r261288 34 34 #include "PluginProcessAttributes.h" 35 35 #include "ProcessLauncher.h" 36 #include "ProcessThrottler.h" 37 #include "ProcessThrottlerClient.h" 36 38 #include "WebProcessProxyMessagesReplies.h" 37 39 #include <wtf/Deque.h> … … 62 64 #endif 63 65 64 class PluginProcessProxy final : public AuxiliaryProcessProxy, public ThreadSafeRefCounted<PluginProcessProxy> {66 class PluginProcessProxy final : public AuxiliaryProcessProxy, public ThreadSafeRefCounted<PluginProcessProxy>, private ProcessThrottlerClient { 65 67 public: 66 68 static Ref<PluginProcessProxy> create(PluginProcessManager*, const PluginProcessAttributes&, uint64_t pluginProcessToken); … … 88 90 #endif 89 91 92 ProcessThrottler& throttler() final { return m_throttler; } 93 90 94 private: 91 95 PluginProcessProxy(PluginProcessManager*, const PluginProcessAttributes&, uint64_t pluginProcessToken); … … 99 103 100 104 void pluginProcessCrashedOrFailedToLaunch(); 105 106 // ProcessThrottlerClient 107 void sendPrepareToSuspend(IsSuspensionImminent, CompletionHandler<void()>&& completionHandler) final { completionHandler(); } 108 void sendProcessDidResume() final { } 109 ASCIILiteral clientName() const final { return "PluginProcess"_s; } 101 110 102 111 // IPC::Connection::Client … … 137 146 138 147 void platformInitializePluginProcess(PluginProcessCreationParameters& parameters); 148 149 ProcessThrottler m_throttler; 139 150 140 151 // The plug-in host process manager. -
trunk/Source/WebKit/UIProcess/ProcessThrottler.h
r261034 r261288 66 66 { 67 67 throttler.addActivity(*this); 68 PROCESSTHROTTLER_ACTIVITY_RELEASE_LOG("Activity: Starting %" PUBLIC_LOG_STRING " activity / '%" PUBLIC_LOG_STRING "'", 69 type == ActivityType::Foreground ? "foreground" : "background", m_name.characters()); 68 if (!isQuietActivity()) { 69 PROCESSTHROTTLER_ACTIVITY_RELEASE_LOG("Activity: Starting %" PUBLIC_LOG_STRING " activity / '%" PUBLIC_LOG_STRING "'", 70 type == ActivityType::Foreground ? "foreground" : "background", m_name.characters()); 71 } 70 72 } 71 73 … … 81 83 friend class ProcessThrottler; 82 84 85 bool isQuietActivity() const { return !m_name.characters(); } 86 83 87 void invalidate() 84 88 { 85 89 ASSERT(isValid()); 86 PROCESSTHROTTLER_ACTIVITY_RELEASE_LOG("invalidate: Ending %" PUBLIC_LOG_STRING " activity / '%" PUBLIC_LOG_STRING "'", 87 type == ActivityType::Foreground ? "foreground" : "background", m_name.characters()); 90 if (!isQuietActivity()) { 91 PROCESSTHROTTLER_ACTIVITY_RELEASE_LOG("invalidate: Ending %" PUBLIC_LOG_STRING " activity / '%" PUBLIC_LOG_STRING "'", 92 type == ActivityType::Foreground ? "foreground" : "background", m_name.characters()); 93 } 88 94 m_throttler->removeActivity(*this); 89 95 m_throttler = nullptr; -
trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp
r258322 r261288 261 261 #endif 262 262 263 m_page. process().connection()->sendWithAsyncReply(Messages::WebPage::UserMediaAccessWasGranted { request.userMediaID(), request.audioDevice(), request.videoDevice(), request.deviceIdentifierHashSalt(), handle }, [this, weakThis = WTFMove(weakThis)] {263 m_page.sendWithAsyncReply(Messages::WebPage::UserMediaAccessWasGranted { request.userMediaID(), request.audioDevice(), request.videoDevice(), request.deviceIdentifierHashSalt(), handle }, [this, weakThis = WTFMove(weakThis)] { 264 264 if (!weakThis) 265 265 return; 266 266 if (!--m_hasPendingCapture) 267 267 UserMediaProcessManager::singleton().revokeSandboxExtensionsIfNeeded(page().process()); 268 } , m_page.webPageID());268 }); 269 269 270 270 processNextUserMediaRequestIfNeeded(); -
trunk/Source/WebKit/UIProcess/WebBackForwardCacheEntry.cpp
r251778 r261288 51 51 if (m_backForwardItemID && !m_suspendedPage) { 52 52 auto& process = this->process(); 53 process.sendWithAsyncReply(Messages::WebProcess::ClearCachedPage(m_backForwardItemID), [ activity = process.throttler().backgroundActivity("Clearing back/forward cache entry"_s)] { });53 process.sendWithAsyncReply(Messages::WebProcess::ClearCachedPage(m_backForwardItemID), [] { }); 54 54 } 55 55 } -
trunk/Source/WebKit/UIProcess/WebCookieManagerProxy.cpp
r251778 r261288 103 103 { 104 104 auto& networkProcess = processPool()->ensureNetworkProcess(); 105 networkProcess.sendWithAsyncReply(Messages::WebCookieManager::GetHostnamesWithCookies(sessionID), [callbackFunction = WTFMove(callbackFunction), activity = networkProcess.throttler().backgroundActivity("WebCookieManagerProxy::getHostnamesWithCookies"_s)](Vector<String>&& hostnames) mutable { 106 callbackFunction(WTFMove(hostnames)); 107 }); 105 networkProcess.sendWithAsyncReply(Messages::WebCookieManager::GetHostnamesWithCookies(sessionID), WTFMove(callbackFunction)); 108 106 } 109 107 … … 121 119 { 122 120 auto& networkProcess = processPool()->ensureNetworkProcess(); 123 networkProcess.sendWithAsyncReply(Messages::WebCookieManager::DeleteCookie(sessionID, cookie), [callbackFunction = WTFMove(callbackFunction) , activity = networkProcess.throttler().backgroundActivity("WebCookieManagerProxy::deleteCookie"_s)]() mutable {121 networkProcess.sendWithAsyncReply(Messages::WebCookieManager::DeleteCookie(sessionID, cookie), [callbackFunction = WTFMove(callbackFunction)]() mutable { 124 122 callbackFunction(); 125 123 }); … … 129 127 { 130 128 auto& networkProcess = processPool()->ensureNetworkProcess(); 131 networkProcess.sendWithAsyncReply(Messages::WebCookieManager::DeleteAllCookiesModifiedSince(sessionID, time), [callbackFunction = WTFMove(callbackFunction), activity = networkProcess.throttler().backgroundActivity("WebCookieManagerProxy::deleteAllCookiesModifiedSince"_s)]() mutable { 132 callbackFunction(); 133 }); 129 networkProcess.sendWithAsyncReply(Messages::WebCookieManager::DeleteAllCookiesModifiedSince(sessionID, time), WTFMove(callbackFunction)); 134 130 } 135 131 … … 137 133 { 138 134 auto& networkProcess = processPool()->ensureNetworkProcess(); 139 networkProcess.sendWithAsyncReply(Messages::WebCookieManager::SetCookie(sessionID, cookies), [callbackFunction = WTFMove(callbackFunction), activity = networkProcess.throttler().backgroundActivity("WebCookieManagerProxy::setCookies"_s)]() mutable { 140 callbackFunction(); 141 }); 135 networkProcess.sendWithAsyncReply(Messages::WebCookieManager::SetCookie(sessionID, cookies), WTFMove(callbackFunction)); 142 136 } 143 137 … … 145 139 { 146 140 auto& networkProcess = processPool()->ensureNetworkProcess(); 147 networkProcess.sendWithAsyncReply(Messages::WebCookieManager::SetCookies(sessionID, cookies, url, mainDocumentURL), [callbackFunction = WTFMove(callbackFunction), activity = networkProcess.throttler().backgroundActivity("WebCookieManagerProxy::setCookies"_s)]() mutable { 148 callbackFunction(); 149 }); 141 networkProcess.sendWithAsyncReply(Messages::WebCookieManager::SetCookies(sessionID, cookies, url, mainDocumentURL), WTFMove(callbackFunction)); 150 142 } 151 143 … … 153 145 { 154 146 auto& networkProcess = processPool()->ensureNetworkProcess(); 155 networkProcess.sendWithAsyncReply(Messages::WebCookieManager::GetAllCookies(sessionID), [callbackFunction = WTFMove(callbackFunction), activity = networkProcess.throttler().backgroundActivity("WebCookieManagerProxy::getAllCookies"_s)](Vector<Cookie>&& cookies) mutable { 156 callbackFunction(WTFMove(cookies)); 157 }); 147 networkProcess.sendWithAsyncReply(Messages::WebCookieManager::GetAllCookies(sessionID), WTFMove(callbackFunction)); 158 148 } 159 149 … … 161 151 { 162 152 auto& networkProcess = processPool()->ensureNetworkProcess(); 163 networkProcess.sendWithAsyncReply(Messages::WebCookieManager::GetCookies(sessionID, url), [callbackFunction = WTFMove(callbackFunction), activity = networkProcess.throttler().backgroundActivity("WebCookieManagerProxy::getCookies"_s)](Vector<Cookie>&& cookies) mutable { 164 callbackFunction(WTFMove(cookies)); 165 }); 153 networkProcess.sendWithAsyncReply(Messages::WebCookieManager::GetCookies(sessionID, url), WTFMove(callbackFunction)); 166 154 } 167 155 … … 233 221 234 222 auto& networkProcess = processPool()->ensureNetworkProcess(); 235 networkProcess.sendWithAsyncReply(Messages::WebCookieManager::SetHTTPCookieAcceptPolicy(policy), [callbackFunction = WTFMove(callbackFunction), activity = networkProcess.throttler().backgroundActivity("WebCookieManagerProxy::setHTTPCookieAcceptPolicy"_s)]() mutable { 236 callbackFunction(); 237 }); 223 networkProcess.sendWithAsyncReply(Messages::WebCookieManager::SetHTTPCookieAcceptPolicy(policy), WTFMove(callbackFunction)); 238 224 } 239 225 … … 241 227 { 242 228 auto& networkProcess = processPool()->ensureNetworkProcess(); 243 networkProcess.sendWithAsyncReply(Messages::WebCookieManager::GetHTTPCookieAcceptPolicy(), [callbackFunction = WTFMove(callbackFunction), activity = networkProcess.throttler().backgroundActivity("WebCookieManagerProxy::getHTTPCookieAcceptPolicy"_s)](HTTPCookieAcceptPolicy policy) mutable { 244 callbackFunction(policy); 245 }); 229 networkProcess.sendWithAsyncReply(Messages::WebCookieManager::GetHTTPCookieAcceptPolicy(), WTFMove(callbackFunction)); 246 230 } 247 231 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r261252 r261288 10141 10141 void WebPageProxy::getProcessDisplayName(CompletionHandler<void(String&&)>&& completionHandler) 10142 10142 { 10143 m_process->connection()->sendWithAsyncReply(Messages::WebPage::GetProcessDisplayName(), WTFMove(completionHandler), m_webPageID);10143 sendWithAsyncReply(Messages::WebPage::GetProcessDisplayName(), WTFMove(completionHandler)); 10144 10144 } 10145 10145 -
trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp
r261254 r261288 461 461 void WebProcessProxy::setThirdPartyCookieBlockingMode(ThirdPartyCookieBlockingMode thirdPartyCookieBlockingMode, CompletionHandler<void()>&& completionHandler) 462 462 { 463 sendWithAsyncReply(Messages::WebProcess::SetThirdPartyCookieBlockingMode(thirdPartyCookieBlockingMode), [activity = throttler().backgroundActivity("WebProcessProxy::setThirdPartyCookieBlockingMode"_s), completionHandler = WTFMove(completionHandler)]() mutable { 464 completionHandler(); 465 }); 463 sendWithAsyncReply(Messages::WebProcess::SetThirdPartyCookieBlockingMode(thirdPartyCookieBlockingMode), WTFMove(completionHandler)); 466 464 } 467 465 #endif … … 1107 1105 ASSERT_UNUSED(sessionID, sessionID == this->sessionID()); 1108 1106 1109 auto activity = throttler().backgroundActivity("WebProcessProxy::fetchWebsiteData"_s);1110 1107 RELEASE_LOG_IF(isReleaseLoggingAllowed(), ProcessSuspension, "%p - WebProcessProxy is taking a background assertion because the Web process is fetching Website data", this); 1111 1108 1112 connection()->sendWithAsyncReply(Messages::WebProcess::FetchWebsiteData(dataTypes), [this, protectedThis = makeRef(*this), activity = WTFMove(activity), completionHandler = WTFMove(completionHandler)] (auto reply) mutable {1109 sendWithAsyncReply(Messages::WebProcess::FetchWebsiteData(dataTypes), [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] (auto reply) mutable { 1113 1110 #if RELEASE_LOG_DISABLED 1114 1111 UNUSED_PARAM(this); … … 1124 1121 ASSERT_UNUSED(sessionID, sessionID == this->sessionID()); 1125 1122 1126 auto activity = throttler().backgroundActivity("WebProcessProxy::deleteWebsiteData"_s);1127 1123 RELEASE_LOG_IF(isReleaseLoggingAllowed(), ProcessSuspension, "%p - WebProcessProxy is taking a background assertion because the Web process is deleting Website data", this); 1128 1124 1129 connection()->sendWithAsyncReply(Messages::WebProcess::DeleteWebsiteData(dataTypes, modifiedSince), [this, protectedThis = makeRef(*this), activity = WTFMove(activity), completionHandler = WTFMove(completionHandler)] () mutable {1125 sendWithAsyncReply(Messages::WebProcess::DeleteWebsiteData(dataTypes, modifiedSince), [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] () mutable { 1130 1126 #if RELEASE_LOG_DISABLED 1131 1127 UNUSED_PARAM(this); … … 1141 1137 ASSERT_UNUSED(sessionID, sessionID == this->sessionID()); 1142 1138 1143 auto activity = throttler().backgroundActivity("WebProcessProxy::deleteWebsiteDataForOrigins"_s);1144 1139 RELEASE_LOG_IF(isReleaseLoggingAllowed(), ProcessSuspension, "%p - WebProcessProxy is taking a background assertion because the Web process is deleting Website data for several origins", this); 1145 1140 1146 connection()->sendWithAsyncReply(Messages::WebProcess::DeleteWebsiteDataForOrigins(dataTypes, origins), [this, protectedThis = makeRef(*this), activity = WTFMove(activity), completionHandler = WTFMove(completionHandler)] () mutable {1141 sendWithAsyncReply(Messages::WebProcess::DeleteWebsiteDataForOrigins(dataTypes, origins), [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] () mutable { 1147 1142 #if RELEASE_LOG_DISABLED 1148 1143 UNUSED_PARAM(this); … … 1326 1321 void WebProcessProxy::sendPrepareToSuspend(IsSuspensionImminent isSuspensionImminent, CompletionHandler<void()>&& completionHandler) 1327 1322 { 1328 sendWithAsyncReply(Messages::WebProcess::PrepareToSuspend(isSuspensionImminent == IsSuspensionImminent::Yes), WTFMove(completionHandler) );1323 sendWithAsyncReply(Messages::WebProcess::PrepareToSuspend(isSuspensionImminent == IsSuspensionImminent::Yes), WTFMove(completionHandler), 0, { }, ShouldStartProcessThrottlerActivity::No); 1329 1324 } 1330 1325 … … 1547 1542 void WebProcessProxy::activePagesDomainsForTesting(CompletionHandler<void(Vector<String>&&)>&& completionHandler) 1548 1543 { 1549 connection()->sendWithAsyncReply(Messages::WebProcess::GetActivePagesOriginsForTesting(), WTFMove(completionHandler));1544 sendWithAsyncReply(Messages::WebProcess::GetActivePagesOriginsForTesting(), WTFMove(completionHandler)); 1550 1545 } 1551 1546 … … 1648 1643 void WebProcessProxy::establishServiceWorkerContext(const WebPreferencesStore& store, CompletionHandler<void()>&& completionHandler) 1649 1644 { 1650 sendWithAsyncReply(Messages::WebProcess::EstablishWorkerContextConnectionToNetworkProcess { processPool().defaultPageGroup().pageGroupID(), m_serviceWorkerInformation->serviceWorkerPageProxyID, m_serviceWorkerInformation->serviceWorkerPageID, store, *m_registrableDomain, m_serviceWorkerInformation->initializationData }, [ activity = m_throttler.backgroundActivity("Establish Service Worker"_s),completionHandler = WTFMove(completionHandler)]() mutable {1645 sendWithAsyncReply(Messages::WebProcess::EstablishWorkerContextConnectionToNetworkProcess { processPool().defaultPageGroup().pageGroupID(), m_serviceWorkerInformation->serviceWorkerPageProxyID, m_serviceWorkerInformation->serviceWorkerPageID, store, *m_registrableDomain, m_serviceWorkerInformation->initializationData }, [completionHandler = WTFMove(completionHandler)]() mutable { 1651 1646 RELEASE_LOG(Loading, "WebProcessProxy::establishServiceWorkerContext finished"); 1652 1647 completionHandler(); -
trunk/Source/WebKit/UIProcess/WebProcessProxy.h
r261254 r261288 243 243 void windowServerConnectionStateChanged(); 244 244 245 ProcessThrottler& throttler() { return m_throttler; }245 ProcessThrottler& throttler() final { return m_throttler; } 246 246 247 247 void isResponsive(CompletionHandler<void(bool isWebProcessResponsive)>&&); -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r261209 r261288 467 467 return; 468 468 } 469 m_process->connection()->sendWithAsyncReply(Messages::WebPage::InsertTextPlaceholder { size }, WTFMove(completionHandler), m_webPageID);469 sendWithAsyncReply(Messages::WebPage::InsertTextPlaceholder { size }, WTFMove(completionHandler)); 470 470 } 471 471 … … 476 476 return; 477 477 } 478 m_process->connection()->sendWithAsyncReply(Messages::WebPage::RemoveTextPlaceholder { placeholder }, WTFMove(completionHandler), m_webPageID);478 sendWithAsyncReply(Messages::WebPage::RemoveTextPlaceholder { placeholder }, WTFMove(completionHandler)); 479 479 } 480 480 … … 485 485 return; 486 486 } 487 m_process->connection()->sendWithAsyncReply(Messages::WebPage::RequestAutocorrectionData(textForAutocorrection), WTFMove(callback), m_webPageID);487 sendWithAsyncReply(Messages::WebPage::RequestAutocorrectionData(textForAutocorrection), WTFMove(callback)); 488 488 } 489 489 … … 1223 1223 } 1224 1224 1225 m_process->connection()->sendWithAsyncReply(Messages::WebPage::RequestEvasionRectsAboveSelection(), WTFMove(callback), m_webPageID);1225 sendWithAsyncReply(Messages::WebPage::RequestEvasionRectsAboveSelection(), WTFMove(callback)); 1226 1226 } 1227 1227 … … 1233 1233 } 1234 1234 1235 m_process->connection()->sendWithAsyncReply(Messages::WebPage::UpdateSelectionWithDelta(locationDelta, lengthDelta), WTFMove(completionHandler), m_webPageID);1235 sendWithAsyncReply(Messages::WebPage::UpdateSelectionWithDelta(locationDelta, lengthDelta), WTFMove(completionHandler)); 1236 1236 } 1237 1237 … … 1243 1243 } 1244 1244 1245 m_process->connection()->sendWithAsyncReply(Messages::WebPage::RequestDocumentEditingContext(request), WTFMove(completionHandler), m_webPageID);1245 sendWithAsyncReply(Messages::WebPage::RequestDocumentEditingContext(request), WTFMove(completionHandler)); 1246 1246 } 1247 1247 … … 1273 1273 { 1274 1274 if (hasRunningProcess()) 1275 m_process->connection()->sendWithAsyncReply(Messages::WebPage::InsertDroppedImagePlaceholders(imageSizes), WTFMove(completionHandler), m_webPageID);1275 sendWithAsyncReply(Messages::WebPage::InsertDroppedImagePlaceholders(imageSizes), WTFMove(completionHandler)); 1276 1276 else 1277 1277 completionHandler({ }, WTF::nullopt);
Note: See TracChangeset
for help on using the changeset viewer.