Changeset 243258 in webkit
- Timestamp:
- Mar 20, 2019, 4:37:54 PM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 16 edited
-
ChangeLog (modified) (1 diff)
-
NetworkProcess/NetworkConnectionToWebProcess.cpp (modified) (7 diffs)
-
NetworkProcess/NetworkConnectionToWebProcess.h (modified) (4 diffs)
-
NetworkProcess/NetworkConnectionToWebProcess.messages.in (modified) (3 diffs)
-
UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp (modified) (4 diffs)
-
UIProcess/Cocoa/UserMediaCaptureManagerProxy.h (modified) (1 diff)
-
UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in (modified) (1 diff)
-
UIProcess/Plugins/PluginProcessProxy.h (modified) (1 diff)
-
UIProcess/Plugins/PluginProcessProxy.messages.in (modified) (1 diff)
-
UIProcess/Plugins/mac/PluginProcessProxyMac.mm (modified) (6 diffs)
-
UIProcess/WebFullScreenManagerProxy.cpp (modified) (1 diff)
-
UIProcess/WebFullScreenManagerProxy.h (modified) (1 diff)
-
UIProcess/WebFullScreenManagerProxy.messages.in (modified) (1 diff)
-
WebProcess/WebProcess.cpp (modified) (6 diffs)
-
WebProcess/WebProcess.h (modified) (2 diffs)
-
WebProcess/WebProcess.messages.in (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r243253 r243258 1 2019-03-20 Alex Christensen <achristensen@webkit.org> 2 3 Reduce use of LegacySync IPC message type 4 https://bugs.webkit.org/show_bug.cgi?id=194835 5 6 Reviewed by Darin Adler. 7 8 * NetworkProcess/NetworkConnectionToWebProcess.cpp: 9 (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): 10 (WebKit::NetworkConnectionToWebProcess::cookiesEnabled): 11 (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue): 12 (WebKit::NetworkConnectionToWebProcess::getRawCookies): 13 (WebKit::NetworkConnectionToWebProcess::blobSize): 14 (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer): 15 (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection): 16 * NetworkProcess/NetworkConnectionToWebProcess.h: 17 (WebKit::NetworkConnectionToWebProcess::getNetworkLoadInformationRequest): 18 (WebKit::NetworkConnectionToWebProcess::getNetworkLoadInformationResponse): 19 (WebKit::NetworkConnectionToWebProcess::getNetworkLoadIntermediateInformation): 20 (WebKit::NetworkConnectionToWebProcess::takeNetworkLoadInformationMetrics): 21 * NetworkProcess/NetworkConnectionToWebProcess.messages.in: 22 * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: 23 (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): 24 (WebKit::UserMediaCaptureManagerProxy::capabilities): 25 * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: 26 * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: 27 * UIProcess/Plugins/PluginProcessProxy.h: 28 * UIProcess/Plugins/PluginProcessProxy.messages.in: 29 * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: 30 (WebKit::PluginProcessProxy::launchProcess): 31 (WebKit::PluginProcessProxy::launchApplicationAtURL): 32 (WebKit::PluginProcessProxy::openURL): 33 (WebKit::PluginProcessProxy::openFile): 34 * UIProcess/WebFullScreenManagerProxy.cpp: 35 (WebKit::WebFullScreenManagerProxy::supportsFullScreen): 36 * UIProcess/WebFullScreenManagerProxy.h: 37 * UIProcess/WebFullScreenManagerProxy.messages.in: 38 * WebProcess/WebProcess.cpp: 39 (WebKit::WebProcess::fetchWebsiteData): 40 (WebKit::WebProcess::deleteWebsiteData): 41 (WebKit::WebProcess::deleteWebsiteDataForOrigins): 42 (WebKit::WebProcess::processWillSuspendImminently): 43 * WebProcess/WebProcess.h: 44 * WebProcess/WebProcess.messages.in: 45 1 46 2019-03-20 Keith Rollin <krollin@apple.com> 2 47 -
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
r242891 r243258 480 480 } 481 481 482 void NetworkConnectionToWebProcess::cookiesForDOM(PAL::SessionID sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies, String& cookieString, bool& secureCookiesAccessed)482 void NetworkConnectionToWebProcess::cookiesForDOM(PAL::SessionID sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies, CompletionHandler<void(String cookieString, bool secureCookiesAccessed)>&& completionHandler) 483 483 { 484 484 auto& networkStorageSession = storageSession(networkProcess(), sessionID); 485 std::tie(cookieString, secureCookiesAccessed)= networkStorageSession.cookiesForDOM(firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies);485 auto result = networkStorageSession.cookiesForDOM(firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies); 486 486 #if ENABLE(RESOURCE_LOAD_STATISTICS) && !RELEASE_LOG_DISABLED 487 487 if (auto session = networkProcess().networkSession(sessionID)) { … … 490 490 } 491 491 #endif 492 completionHandler(WTFMove(result.first), result.second); 492 493 } 493 494 … … 504 505 } 505 506 506 void NetworkConnectionToWebProcess::cookiesEnabled(PAL::SessionID sessionID, bool& result) 507 { 508 result = storageSession(networkProcess(), sessionID).cookiesEnabled(); 509 } 510 511 void NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue(PAL::SessionID sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies, String& cookieString, bool& secureCookiesAccessed) 512 { 513 std::tie(cookieString, secureCookiesAccessed) = storageSession(networkProcess(), sessionID).cookieRequestHeaderFieldValue(firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies); 514 } 515 516 void NetworkConnectionToWebProcess::getRawCookies(PAL::SessionID sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Vector<Cookie>& result) 517 { 507 void NetworkConnectionToWebProcess::cookiesEnabled(PAL::SessionID sessionID, CompletionHandler<void(bool)>&& completionHandler) 508 { 509 completionHandler(storageSession(networkProcess(), sessionID).cookiesEnabled()); 510 } 511 512 void NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue(PAL::SessionID sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies, CompletionHandler<void(String, bool)>&& completionHandler) 513 { 514 auto result = storageSession(networkProcess(), sessionID).cookieRequestHeaderFieldValue(firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies); 515 completionHandler(WTFMove(result.first), result.second); 516 } 517 518 void NetworkConnectionToWebProcess::getRawCookies(PAL::SessionID sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, CompletionHandler<void(Vector<WebCore::Cookie>&&)>&& completionHandler) 519 { 520 Vector<WebCore::Cookie> result; 518 521 storageSession(networkProcess(), sessionID).getRawCookies(firstParty, sameSiteInfo, url, frameID, pageID, result); 522 completionHandler(WTFMove(result)); 519 523 } 520 524 … … 554 558 } 555 559 556 void NetworkConnectionToWebProcess::blobSize(const URL& url, uint64_t& resultSize)557 { 558 resultSize = m_networkProcess->networkBlobRegistry().blobSize(*this, url);560 void NetworkConnectionToWebProcess::blobSize(const URL& url, CompletionHandler<void(uint64_t)>&& completionHandler) 561 { 562 completionHandler(m_networkProcess->networkBlobRegistry().blobSize(*this, url)); 559 563 } 560 564 … … 790 794 } 791 795 792 void NetworkConnectionToWebProcess::establishIDBConnectionToServer(PAL::SessionID sessionID, uint64_t& serverConnectionIdentifier)793 { 794 serverConnectionIdentifier = generateIDBConnectionToServerIdentifier();796 void NetworkConnectionToWebProcess::establishIDBConnectionToServer(PAL::SessionID sessionID, CompletionHandler<void(uint64_t)>&& completionHandler) 797 { 798 uint64_t serverConnectionIdentifier = generateIDBConnectionToServerIdentifier(); 795 799 LOG(IndexedDB, "NetworkConnectionToWebProcess::establishIDBConnectionToServer - %" PRIu64, serverConnectionIdentifier); 796 800 ASSERT(!m_webIDBConnections.contains(serverConnectionIdentifier)); 797 801 798 802 m_webIDBConnections.set(serverConnectionIdentifier, WebIDBConnectionToClient::create(m_networkProcess, m_connection.get(), serverConnectionIdentifier, sessionID)); 803 completionHandler(serverConnectionIdentifier); 799 804 } 800 805 #endif … … 810 815 } 811 816 812 void NetworkConnectionToWebProcess::establishSWServerConnection(PAL::SessionID sessionID, SWServerConnectionIdentifier& serverConnectionIdentifier)817 void NetworkConnectionToWebProcess::establishSWServerConnection(PAL::SessionID sessionID, CompletionHandler<void(WebCore::SWServerConnectionIdentifier&&)>&& completionHandler) 813 818 { 814 819 auto& server = m_networkProcess->swServerForSession(sessionID); 815 820 auto connection = std::make_unique<WebSWServerConnection>(m_networkProcess, server, m_connection.get(), sessionID); 816 821 817 serverConnectionIdentifier = connection->identifier();822 SWServerConnectionIdentifier serverConnectionIdentifier = connection->identifier(); 818 823 LOG(ServiceWorker, "NetworkConnectionToWebProcess::establishSWServerConnection - %s", serverConnectionIdentifier.loggingString().utf8().data()); 819 824 … … 821 826 m_swConnections.add(serverConnectionIdentifier, makeWeakPtr(*connection)); 822 827 server.addConnection(WTFMove(connection)); 828 completionHandler(WTFMove(serverConnectionIdentifier)); 823 829 } 824 830 #endif -
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h
r242891 r243258 92 92 void endSuspension(); 93 93 94 void getNetworkLoadInformationRequest(ResourceLoadIdentifier identifier, WebCore::ResourceRequest& request)95 { 96 request = m_networkLoadInformationByID.get(identifier).request;97 } 98 99 void getNetworkLoadInformationResponse(ResourceLoadIdentifier identifier, WebCore::ResourceResponse& response)100 { 101 response = m_networkLoadInformationByID.get(identifier).response;102 } 103 104 void getNetworkLoadIntermediateInformation(ResourceLoadIdentifier identifier, Vector<WebCore::NetworkTransactionInformation>& information)105 { 106 information = m_networkLoadInformationByID.get(identifier).transactions;107 } 108 109 void takeNetworkLoadInformationMetrics(ResourceLoadIdentifier identifier, WebCore::NetworkLoadMetrics& metrics)110 { 111 metrics = m_networkLoadInformationByID.take(identifier).metrics;94 void getNetworkLoadInformationRequest(ResourceLoadIdentifier identifier, CompletionHandler<void(const WebCore::ResourceRequest&)>&& completionHandler) 95 { 96 completionHandler(m_networkLoadInformationByID.get(identifier).request); 97 } 98 99 void getNetworkLoadInformationResponse(ResourceLoadIdentifier identifier, CompletionHandler<void(const WebCore::ResourceResponse&)>&& completionHandler) 100 { 101 completionHandler(m_networkLoadInformationByID.get(identifier).response); 102 } 103 104 void getNetworkLoadIntermediateInformation(ResourceLoadIdentifier identifier, CompletionHandler<void(const Vector<WebCore::NetworkTransactionInformation>&)>&& completionHandler) 105 { 106 completionHandler(m_networkLoadInformationByID.get(identifier).transactions); 107 } 108 109 void takeNetworkLoadInformationMetrics(ResourceLoadIdentifier identifier, CompletionHandler<void(const WebCore::NetworkLoadMetrics&)>&& completionHandler) 110 { 111 completionHandler(m_networkLoadInformationByID.take(identifier).metrics); 112 112 } 113 113 … … 169 169 void convertMainResourceLoadToDownload(PAL::SessionID, uint64_t mainResourceLoadIdentifier, DownloadID, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&); 170 170 171 void cookiesForDOM(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, WebCore::IncludeSecureCookies, String& cookieString, bool& secureCookiesAccessed);171 void cookiesForDOM(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, WebCore::IncludeSecureCookies, CompletionHandler<void(String cookieString, bool secureCookiesAccessed)>&&); 172 172 void setCookiesFromDOM(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, const String&); 173 void cookiesEnabled(PAL::SessionID, bool& result);174 void cookieRequestHeaderFieldValue(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, WebCore::IncludeSecureCookies, String& cookieString, bool& secureCookiesAccessed);175 void getRawCookies(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, Vector<WebCore::Cookie>&);173 void cookiesEnabled(PAL::SessionID, CompletionHandler<void(bool)>&&); 174 void cookieRequestHeaderFieldValue(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, WebCore::IncludeSecureCookies, CompletionHandler<void(String cookieString, bool secureCookiesAccessed)>&&); 175 void getRawCookies(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, CompletionHandler<void(Vector<WebCore::Cookie>&&)>&&); 176 176 void deleteCookie(PAL::SessionID, const URL&, const String& cookieName); 177 177 … … 181 181 void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, const String& fileBackedPath, const String& contentType); 182 182 void registerBlobURLForSlice(const URL&, const URL& srcURL, int64_t start, int64_t end); 183 void blobSize(const URL&, uint64_t& resultSize);183 void blobSize(const URL&, CompletionHandler<void(uint64_t)>&&); 184 184 void unregisterBlobURL(const URL&); 185 185 void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&&)>&&); … … 194 194 #if ENABLE(INDEXED_DATABASE) 195 195 // Messages handlers (Modern IDB). 196 void establishIDBConnectionToServer(PAL::SessionID, uint64_t& serverConnectionIdentifier);196 void establishIDBConnectionToServer(PAL::SessionID, CompletionHandler<void(uint64_t serverConnectionIdentifier)>&&); 197 197 #endif 198 198 199 199 #if ENABLE(SERVICE_WORKER) 200 void establishSWServerConnection(PAL::SessionID, WebCore::SWServerConnectionIdentifier&);200 void establishSWServerConnection(PAL::SessionID, CompletionHandler<void(WebCore::SWServerConnectionIdentifier&&)>&&); 201 201 void unregisterSWConnections(); 202 202 #endif -
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in
r242891 r243258 34 34 ConvertMainResourceLoadToDownload(PAL::SessionID sessionID, uint64_t mainResourceLoadIdentifier, WebKit::DownloadID downloadID, WebCore::ResourceRequest request, WebCore::ResourceResponse response) 35 35 36 CookiesForDOM(PAL::SessionID sessionID, URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, enum:bool WebCore::IncludeSecureCookies includeSecureCookies) -> (String cookieString, bool didAccessSecureCookies) LegacySync36 CookiesForDOM(PAL::SessionID sessionID, URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, enum:bool WebCore::IncludeSecureCookies includeSecureCookies) -> (String cookieString, bool didAccessSecureCookies) Delayed 37 37 SetCookiesFromDOM(PAL::SessionID sessionID, URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, String cookieString) 38 CookiesEnabled(PAL::SessionID sessionID) -> (bool enabled) LegacySync39 CookieRequestHeaderFieldValue(PAL::SessionID sessionID, URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, enum:bool WebCore::IncludeSecureCookies includeSecureCookies) -> (String cookieString, bool didAccessSecureCookies) LegacySync40 GetRawCookies(PAL::SessionID sessionID, URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, Optional<uint64_t> frameID, Optional<uint64_t> pageID) -> (Vector<WebCore::Cookie> cookies) LegacySync38 CookiesEnabled(PAL::SessionID sessionID) -> (bool enabled) Delayed 39 CookieRequestHeaderFieldValue(PAL::SessionID sessionID, URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, enum:bool WebCore::IncludeSecureCookies includeSecureCookies) -> (String cookieString, bool didAccessSecureCookies) Delayed 40 GetRawCookies(PAL::SessionID sessionID, URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, Optional<uint64_t> frameID, Optional<uint64_t> pageID) -> (Vector<WebCore::Cookie> cookies) Delayed 41 41 DeleteCookie(PAL::SessionID sessionID, URL url, String cookieName) 42 42 … … 47 47 RegisterBlobURLForSlice(URL url, URL srcURL, int64_t start, int64_t end) 48 48 UnregisterBlobURL(URL url) 49 BlobSize(URL url) -> (uint64_t resultSize) LegacySync49 BlobSize(URL url) -> (uint64_t resultSize) Delayed 50 50 WriteBlobsToTemporaryFiles(Vector<String> blobURLs) -> (Vector<String> fileNames) Async 51 51 … … 72 72 ResetOriginAccessWhitelists(); 73 73 74 GetNetworkLoadInformationRequest(uint64_t resourceLoadIdentifier) -> (WebCore::ResourceRequest request) LegacySync75 GetNetworkLoadInformationResponse(uint64_t resourceLoadIdentifier) -> (WebCore::ResourceResponse response) LegacySync76 GetNetworkLoadIntermediateInformation(uint64_t resourceLoadIdentifier) -> (Vector<WebCore::NetworkTransactionInformation> transactions) LegacySync77 TakeNetworkLoadInformationMetrics(uint64_t resourceLoadIdentifier) -> (WebCore::NetworkLoadMetrics networkMetrics) LegacySync74 GetNetworkLoadInformationRequest(uint64_t resourceLoadIdentifier) -> (WebCore::ResourceRequest request) Delayed 75 GetNetworkLoadInformationResponse(uint64_t resourceLoadIdentifier) -> (WebCore::ResourceResponse response) Delayed 76 GetNetworkLoadIntermediateInformation(uint64_t resourceLoadIdentifier) -> (Vector<WebCore::NetworkTransactionInformation> transactions) Delayed 77 TakeNetworkLoadInformationMetrics(uint64_t resourceLoadIdentifier) -> (WebCore::NetworkLoadMetrics networkMetrics) Delayed 78 78 79 79 #if ENABLE(INDEXED_DATABASE) 80 EstablishIDBConnectionToServer(PAL::SessionID sessionID) -> (uint64_t serverConnectionIdentifier) LegacySync80 EstablishIDBConnectionToServer(PAL::SessionID sessionID) -> (uint64_t serverConnectionIdentifier) Delayed 81 81 #endif 82 82 83 83 #if ENABLE(SERVICE_WORKER) 84 EstablishSWServerConnection(PAL::SessionID sessionID) -> (WebCore::SWServerConnectionIdentifier serverConnectionIdentifier) LegacySync84 EstablishSWServerConnection(PAL::SessionID sessionID) -> (WebCore::SWServerConnectionIdentifier serverConnectionIdentifier) Delayed 85 85 #endif 86 86 -
trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp
r242378 r243258 140 140 } 141 141 142 void UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints(uint64_t id, const CaptureDevice& device, String&& hashSalt, const MediaConstraints& constraints, bool& succeeded, String& invalidConstraints, WebCore::RealtimeMediaSourceSettings& settings)142 void UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints(uint64_t id, const CaptureDevice& device, String&& hashSalt, const MediaConstraints& constraints, CompletionHandler<void(bool succeeded, String invalidConstraints, WebCore::RealtimeMediaSourceSettings&&)>&& completionHandler) 143 143 { 144 144 MESSAGE_CHECK_CONTEXTID(id); … … 161 161 } 162 162 163 succeeded = !!sourceOrError; 163 bool succeeded = !!sourceOrError; 164 String invalidConstraints; 165 WebCore::RealtimeMediaSourceSettings settings; 164 166 if (sourceOrError) { 165 167 auto source = sourceOrError.source(); … … 170 172 } else 171 173 invalidConstraints = WTFMove(sourceOrError.errorMessage); 174 completionHandler(succeeded, invalidConstraints, WTFMove(settings)); 172 175 } 173 176 … … 194 197 } 195 198 196 void UserMediaCaptureManagerProxy::capabilities(uint64_t id, WebCore::RealtimeMediaSourceCapabilities& capabilities) 197 { 198 MESSAGE_CHECK_CONTEXTID(id); 199 void UserMediaCaptureManagerProxy::capabilities(uint64_t id, CompletionHandler<void(WebCore::RealtimeMediaSourceCapabilities&&)>&& completionHandler) 200 { 201 MESSAGE_CHECK_CONTEXTID(id); 202 WebCore::RealtimeMediaSourceCapabilities capabilities; 199 203 auto iter = m_proxies.find(id); 200 204 if (iter != m_proxies.end()) 201 205 capabilities = iter->value->source().capabilities(); 206 completionHandler(WTFMove(capabilities)); 202 207 } 203 208 -
trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.h
r241132 r243258 52 52 void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) final; 53 53 54 void createMediaSourceForCaptureDeviceWithConstraints(uint64_t id, const WebCore::CaptureDevice& deviceID, String&&, const WebCore::MediaConstraints&, bool& succeeded, String& invalidConstraints, WebCore::RealtimeMediaSourceSettings&);54 void createMediaSourceForCaptureDeviceWithConstraints(uint64_t id, const WebCore::CaptureDevice& deviceID, String&&, const WebCore::MediaConstraints&, CompletionHandler<void(bool succeeded, String invalidConstraints, WebCore::RealtimeMediaSourceSettings&&)>&&); 55 55 void startProducingData(uint64_t); 56 56 void stopProducingData(uint64_t); 57 57 void end(uint64_t); 58 void capabilities(uint64_t, WebCore::RealtimeMediaSourceCapabilities&);58 void capabilities(uint64_t, CompletionHandler<void(WebCore::RealtimeMediaSourceCapabilities&&)>&&); 59 59 void setMuted(uint64_t, bool); 60 60 void applyConstraints(uint64_t, const WebCore::MediaConstraints&); -
trunk/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in
r241132 r243258 25 25 26 26 messages -> UserMediaCaptureManagerProxy { 27 CreateMediaSourceForCaptureDeviceWithConstraints(uint64_t id, WebCore::CaptureDevice device, String hashSalt, struct WebCore::MediaConstraints constraints) -> (bool success, String invalidConstraints, WebCore::RealtimeMediaSourceSettings settings) LegacySync 27 CreateMediaSourceForCaptureDeviceWithConstraints(uint64_t id, WebCore::CaptureDevice device, String hashSalt, struct WebCore::MediaConstraints constraints) -> (bool success, String invalidConstraints, WebCore::RealtimeMediaSourceSettings settings) Delayed 28 28 StartProducingData(uint64_t id) 29 29 StopProducingData(uint64_t id) 30 30 End(uint64_t id) 31 Capabilities(uint64_t id) -> (WebCore::RealtimeMediaSourceCapabilities capabilities) LegacySync31 Capabilities(uint64_t id) -> (WebCore::RealtimeMediaSourceCapabilities capabilities) Delayed 32 32 SetMuted(uint64_t id, bool muted) 33 33 ApplyConstraints(uint64_t id, struct WebCore::MediaConstraints constraints) -
trunk/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.h
r240683 r243258 131 131 132 132 void applicationDidBecomeActive(); 133 void launchProcess(const String& launchPath, const Vector<String>& arguments, bool& result);134 void launchApplicationAtURL(const String& urlString, const Vector<String>& arguments, bool& result);135 void openURL(const String& url, bool& result, int32_t& status, String& launchedURLString);136 void openFile(const String& fullPath, bool& result);133 void launchProcess(const String& launchPath, const Vector<String>& arguments, CompletionHandler<void(bool)>&&); 134 void launchApplicationAtURL(const String& urlString, const Vector<String>& arguments, CompletionHandler<void(bool)>&&); 135 void openURL(const String& url, CompletionHandler<void(bool result, int32_t status, String launchedURLString)>&&); 136 void openFile(const String& fullPath, CompletionHandler<void(bool)>&&); 137 137 #endif 138 138 -
trunk/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.messages.in
r237300 r243258 35 35 36 36 # Returns true if the UI process launched the process. 37 LaunchProcess(String launchPath, Vector<String> arguments) -> (bool result) LegacySync37 LaunchProcess(String launchPath, Vector<String> arguments) -> (bool result) Delayed 38 38 39 39 # Returns true if the UI process launched the application. 40 LaunchApplicationAtURL(String url, Vector<String> arguments) -> (bool result) LegacySync40 LaunchApplicationAtURL(String url, Vector<String> arguments) -> (bool result) Delayed 41 41 42 42 # Returns true if the UI process did open the URL. 43 OpenURL(String urlString) -> (bool result, int32_t status, String launchedURLString) LegacySync43 OpenURL(String urlString) -> (bool result, int32_t status, String launchedURLString) Delayed 44 44 45 45 # Returns true if the UI process did open the file. 46 OpenFile(String fullPath) -> (bool result) LegacySync46 OpenFile(String fullPath) -> (bool result) Delayed 47 47 #endif 48 48 } -
trunk/Source/WebKit/UIProcess/Plugins/mac/PluginProcessProxyMac.mm
r240437 r243258 249 249 } 250 250 251 void PluginProcessProxy::launchProcess(const String& launchPath, const Vector<String>& arguments, bool& result) 252 { 253 if (!shouldLaunchProcess(m_pluginProcessAttributes, launchPath, arguments)) { 254 result = false; 255 return; 256 } 257 258 result = true; 251 void PluginProcessProxy::launchProcess(const String& launchPath, const Vector<String>& arguments, CompletionHandler<void(bool)>&& completionHandler) 252 { 253 if (!shouldLaunchProcess(m_pluginProcessAttributes, launchPath, arguments)) 254 return completionHandler(false); 259 255 260 256 RetainPtr<NSMutableArray> argumentsArray = adoptNS([[NSMutableArray alloc] initWithCapacity:arguments.size()]); … … 263 259 264 260 [NSTask launchedTaskWithLaunchPath:launchPath arguments:argumentsArray.get()]; 261 completionHandler(true); 265 262 } 266 263 … … 290 287 } 291 288 292 void PluginProcessProxy::launchApplicationAtURL(const String& urlString, const Vector<String>& arguments, bool& result) 293 { 294 if (!shouldLaunchApplicationAtURL(m_pluginProcessAttributes, urlString)) { 295 result = false; 296 return; 297 } 298 299 result = true; 289 void PluginProcessProxy::launchApplicationAtURL(const String& urlString, const Vector<String>& arguments, CompletionHandler<void(bool)>&& completionHandler) 290 { 291 if (!shouldLaunchApplicationAtURL(m_pluginProcessAttributes, urlString)) 292 return completionHandler(false); 300 293 301 294 RetainPtr<NSMutableArray> argumentsArray = adoptNS([[NSMutableArray alloc] initWithCapacity:arguments.size()]); … … 305 298 NSDictionary *configuration = [NSDictionary dictionaryWithObject:argumentsArray.get() forKey:NSWorkspaceLaunchConfigurationArguments]; 306 299 [[NSWorkspace sharedWorkspace] launchApplicationAtURL:[NSURL URLWithString:urlString] options:NSWorkspaceLaunchAsync configuration:configuration error:nullptr]; 300 completionHandler(true); 307 301 } 308 302 … … 322 316 } 323 317 324 void PluginProcessProxy::openURL(const String& urlString, bool& result, int32_t& status, String& launchedURLString) 325 { 326 if (!shouldOpenURL(m_pluginProcessAttributes, urlString)) { 327 result = false; 328 return; 329 } 330 331 result = true; 318 void PluginProcessProxy::openURL(const String& urlString, CompletionHandler<void(bool result, int32_t status, String launchedURLString)>&& completionHandler) 319 { 320 if (!shouldOpenURL(m_pluginProcessAttributes, urlString)) 321 return completionHandler(false, 0, { }); 322 332 323 CFURLRef launchedURL; 333 status = LSOpenCFURLRef(URL({ }, urlString).createCFURL().get(), &launchedURL); 334 324 uint32_t status = LSOpenCFURLRef(URL({ }, urlString).createCFURL().get(), &launchedURL); 325 326 String launchedURLString; 335 327 if (launchedURL) { 336 328 launchedURLString = URL(launchedURL).string(); 337 329 CFRelease(launchedURL); 338 330 } 331 completionHandler(true, status, launchedURLString); 339 332 } 340 333 … … 349 342 } 350 343 351 void PluginProcessProxy::openFile(const String& fullPath, bool& result) 352 { 353 if (!shouldOpenFile(m_pluginProcessAttributes, fullPath)) { 354 result = false; 355 return; 356 } 357 358 result = true; 344 void PluginProcessProxy::openFile(const String& fullPath, CompletionHandler<void(bool)>&& completionHandler) 345 { 346 if (!shouldOpenFile(m_pluginProcessAttributes, fullPath)) 347 return completionHandler(false); 348 359 349 [[NSWorkspace sharedWorkspace] openFile:fullPath]; 350 completionHandler(true); 360 351 } 361 352 -
trunk/Source/WebKit/UIProcess/WebFullScreenManagerProxy.cpp
r237266 r243258 98 98 } 99 99 100 void WebFullScreenManagerProxy::supportsFullScreen(bool withKeyboard, bool& supports)100 void WebFullScreenManagerProxy::supportsFullScreen(bool withKeyboard, CompletionHandler<void(bool)>&& completionHandler) 101 101 { 102 102 #if PLATFORM(IOS_FAMILY) 103 supports = !withKeyboard;103 completionHandler(!withKeyboard); 104 104 #else 105 supports = true;105 completionHandler(true); 106 106 #endif 107 107 } -
trunk/Source/WebKit/UIProcess/WebFullScreenManagerProxy.h
r234143 r243258 78 78 79 79 private: 80 void supportsFullScreen(bool withKeyboard, bool&);80 void supportsFullScreen(bool withKeyboard, CompletionHandler<void(bool)>&&); 81 81 void enterFullScreen(); 82 82 void exitFullScreen(); -
trunk/Source/WebKit/UIProcess/WebFullScreenManagerProxy.messages.in
r237300 r243258 23 23 #if ENABLE(FULLSCREEN_API) 24 24 messages -> WebFullScreenManagerProxy { 25 SupportsFullScreen(bool withKeyboard) -> (bool supportsFullScreen) LegacySync25 SupportsFullScreen(bool withKeyboard) -> (bool supportsFullScreen) Delayed 26 26 EnterFullScreen() 27 27 ExitFullScreen() -
trunk/Source/WebKit/WebProcess/WebProcess.cpp
r243034 r243258 1349 1349 } 1350 1350 1351 void WebProcess::fetchWebsiteData(PAL::SessionID sessionID, OptionSet<WebsiteDataType> websiteDataTypes, WebsiteData& websiteData) 1352 { 1351 void WebProcess::fetchWebsiteData(PAL::SessionID sessionID, OptionSet<WebsiteDataType> websiteDataTypes, CompletionHandler<void(WebsiteData&&)>&& completionHandler) 1352 { 1353 WebsiteData websiteData; 1353 1354 if (websiteDataTypes.contains(WebsiteDataType::MemoryCache)) { 1354 1355 for (auto& origin : MemoryCache::singleton().originsWithCache(sessionID)) 1355 1356 websiteData.entries.append(WebsiteData::Entry { origin->data(), WebsiteDataType::MemoryCache, 0 }); 1356 1357 } 1357 } 1358 1359 void WebProcess::deleteWebsiteData(PAL::SessionID sessionID, OptionSet<WebsiteDataType> websiteDataTypes, WallTime modifiedSince) 1358 completionHandler(WTFMove(websiteData)); 1359 } 1360 1361 void WebProcess::deleteWebsiteData(PAL::SessionID sessionID, OptionSet<WebsiteDataType> websiteDataTypes, WallTime modifiedSince, CompletionHandler<void()>&& completionHandler) 1360 1362 { 1361 1363 UNUSED_PARAM(modifiedSince); … … 1367 1369 CrossOriginPreflightResultCache::singleton().clear(); 1368 1370 } 1369 } 1370 1371 void WebProcess::deleteWebsiteDataForOrigins(PAL::SessionID sessionID, OptionSet<WebsiteDataType> websiteDataTypes, const Vector<WebCore::SecurityOriginData>& originDatas) 1371 completionHandler(); 1372 } 1373 1374 void WebProcess::deleteWebsiteDataForOrigins(PAL::SessionID sessionID, OptionSet<WebsiteDataType> websiteDataTypes, const Vector<WebCore::SecurityOriginData>& originDatas, CompletionHandler<void()>&& completionHandler) 1372 1375 { 1373 1376 if (websiteDataTypes.contains(WebsiteDataType::MemoryCache)) { … … 1378 1381 MemoryCache::singleton().removeResourcesWithOrigins(sessionID, origins); 1379 1382 } 1383 completionHandler(); 1380 1384 } 1381 1385 … … 1468 1472 } 1469 1473 1470 void WebProcess::processWillSuspendImminently( bool& handled)1474 void WebProcess::processWillSuspendImminently(CompletionHandler<void(bool)>&& completionHandler) 1471 1475 { 1472 1476 if (parentProcessConnection()->inSendSync()) { … … 1475 1479 // reply to a sync message. 1476 1480 // FIXME: ProcessWillSuspendImminently should not be a sync message. 1477 return ;1481 return completionHandler(false); 1478 1482 } 1479 1483 … … 1481 1485 DatabaseTracker::singleton().closeAllDatabases(CurrentQueryBehavior::Interrupt); 1482 1486 actualPrepareToSuspend(ShouldAcknowledgeWhenReadyToSuspend::No); 1483 handled = true;1487 completionHandler(true); 1484 1488 } 1485 1489 -
trunk/Source/WebKit/WebProcess/WebProcess.h
r243034 r243258 205 205 void setHiddenPageDOMTimerThrottlingIncreaseLimit(int milliseconds); 206 206 207 void processWillSuspendImminently( bool& handled);207 void processWillSuspendImminently(CompletionHandler<void(bool)>&&); 208 208 void prepareToSuspend(); 209 209 void cancelPrepareToSuspend(); … … 343 343 void releasePageCache(); 344 344 345 void fetchWebsiteData(PAL::SessionID, OptionSet<WebsiteDataType>, WebsiteData&);346 void deleteWebsiteData(PAL::SessionID, OptionSet<WebsiteDataType>, WallTime modifiedSince );347 void deleteWebsiteDataForOrigins(PAL::SessionID, OptionSet<WebsiteDataType>, const Vector<WebCore::SecurityOriginData>& origins );345 void fetchWebsiteData(PAL::SessionID, OptionSet<WebsiteDataType>, CompletionHandler<void(WebsiteData&&)>&&); 346 void deleteWebsiteData(PAL::SessionID, OptionSet<WebsiteDataType>, WallTime modifiedSince, CompletionHandler<void()>&&); 347 void deleteWebsiteDataForOrigins(PAL::SessionID, OptionSet<WebsiteDataType>, const Vector<WebCore::SecurityOriginData>& origins, CompletionHandler<void()>&&); 348 348 349 349 void setMemoryCacheDisabled(bool); -
trunk/Source/WebKit/WebProcess/WebProcess.messages.in
r243034 r243258 78 78 ReleasePageCache() 79 79 80 FetchWebsiteData(PAL::SessionID sessionID, OptionSet<WebKit::WebsiteDataType> websiteDataTypes) -> (struct WebKit::WebsiteData websiteData) LegacySync81 DeleteWebsiteData(PAL::SessionID sessionID, OptionSet<WebKit::WebsiteDataType> websiteDataTypes, WallTime modifiedSince) -> () LegacySync82 DeleteWebsiteDataForOrigins(PAL::SessionID sessionID, OptionSet<WebKit::WebsiteDataType> websiteDataTypes, Vector<WebCore::SecurityOriginData> origins) -> () LegacySync80 FetchWebsiteData(PAL::SessionID sessionID, OptionSet<WebKit::WebsiteDataType> websiteDataTypes) -> (struct WebKit::WebsiteData websiteData) Delayed 81 DeleteWebsiteData(PAL::SessionID sessionID, OptionSet<WebKit::WebsiteDataType> websiteDataTypes, WallTime modifiedSince) -> () Delayed 82 DeleteWebsiteDataForOrigins(PAL::SessionID sessionID, OptionSet<WebKit::WebsiteDataType> websiteDataTypes, Vector<WebCore::SecurityOriginData> origins) -> () Delayed 83 83 84 84 SetHiddenPageDOMTimerThrottlingIncreaseLimit(int milliseconds) … … 96 96 DestroyAutomationSessionProxy() 97 97 98 ProcessWillSuspendImminently() -> (bool handled) LegacySync98 ProcessWillSuspendImminently() -> (bool handled) Delayed 99 99 PrepareToSuspend() 100 100 CancelPrepareToSuspend()
Note:
See TracChangeset
for help on using the changeset viewer.