- Revision
- 250457
- Author
- [email protected]
- Date
- 2019-09-27 13:55:59 -0700 (Fri, 27 Sep 2019)
Log Message
Move legacy custom protocol registration from process pool to NetworkProcessProxy
https://bugs.webkit.org/show_bug.cgi?id=202315
Reviewed by Tim Horton.
Legacy custom protocol registration is a global thing, which is why it's legacy and we're trying to get rid of it.
In the meantime, we don't want it to be in the set of things the NetworkProcess depends on the WebProcessPool for, which should be an empty set.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::registerGlobalURLSchemeAsHavingCustomProtocolHandlers):
(WebKit::WebProcessPool::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers):
(WebKit::WebProcessPool::registerSchemeForCustomProtocol): Deleted.
(WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): Deleted.
* UIProcess/WebProcessPool.h:
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (250456 => 250457)
--- trunk/Source/WebKit/ChangeLog 2019-09-27 20:49:49 UTC (rev 250456)
+++ trunk/Source/WebKit/ChangeLog 2019-09-27 20:55:59 UTC (rev 250457)
@@ -1,5 +1,23 @@
2019-09-27 Alex Christensen <[email protected]>
+ Move legacy custom protocol registration from process pool to NetworkProcessProxy
+ https://bugs.webkit.org/show_bug.cgi?id=202315
+
+ Reviewed by Tim Horton.
+
+ Legacy custom protocol registration is a global thing, which is why it's legacy and we're trying to get rid of it.
+ In the meantime, we don't want it to be in the set of things the NetworkProcess depends on the WebProcessPool for, which should be an empty set.
+
+ * UIProcess/WebProcessPool.cpp:
+ (WebKit::WebProcessPool::ensureNetworkProcess):
+ (WebKit::WebProcessPool::registerGlobalURLSchemeAsHavingCustomProtocolHandlers):
+ (WebKit::WebProcessPool::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers):
+ (WebKit::WebProcessPool::registerSchemeForCustomProtocol): Deleted.
+ (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): Deleted.
+ * UIProcess/WebProcessPool.h:
+
+2019-09-27 Alex Christensen <[email protected]>
+
Layout Test http/tests/cache-storage/cache-records-persistency.https.html is failing
https://bugs.webkit.org/show_bug.cgi?id=202323
Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp (250456 => 250457)
--- trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp 2019-09-27 20:49:49 UTC (rev 250456)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp 2019-09-27 20:55:59 UTC (rev 250457)
@@ -1138,7 +1138,7 @@
RefPtr<WebKitURISchemeHandler> handler = adoptRef(new WebKitURISchemeHandler(callback, userData, destroyNotify));
auto addResult = context->priv->uriSchemeHandlers.set(String::fromUTF8(scheme), handler.get());
if (addResult.isNewEntry)
- context->priv->processPool->registerSchemeForCustomProtocol(String::fromUTF8(scheme));
+ WebKit::WebProcessPool::registerGlobalURLSchemeAsHavingCustomProtocolHandlers(String::fromUTF8(scheme));
}
/**
Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (250456 => 250457)
--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp 2019-09-27 20:49:49 UTC (rev 250456)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp 2019-09-27 20:55:59 UTC (rev 250457)
@@ -31,6 +31,7 @@
#include "DownloadProxyMap.h"
#include "DownloadProxyMessages.h"
#if ENABLE(LEGACY_CUSTOM_PROTOCOL_MANAGER)
+#include "LegacyCustomProtocolManagerMessages.h"
#include "LegacyCustomProtocolManagerProxyMessages.h"
#endif
#include "Logging.h"
@@ -1257,6 +1258,24 @@
});
}
+void NetworkProcessProxy::registerSchemeForLegacyCustomProtocol(const String& scheme)
+{
+#if ENABLE(LEGACY_CUSTOM_PROTOCOL_MANAGER)
+ send(Messages::LegacyCustomProtocolManager::RegisterScheme(scheme), 0);
+#else
+ UNUSED_PARAM(scheme);
+#endif
+}
+
+void NetworkProcessProxy::unregisterSchemeForLegacyCustomProtocol(const String& scheme)
+{
+#if ENABLE(LEGACY_CUSTOM_PROTOCOL_MANAGER)
+ send(Messages::LegacyCustomProtocolManager::UnregisterScheme(scheme), 0);
+#else
+ UNUSED_PARAM(scheme);
+#endif
+}
+
void NetworkProcessProxy::takeUploadAssertion()
{
ASSERT(!m_uploadAssertion);
Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h (250456 => 250457)
--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h 2019-09-27 20:49:49 UTC (rev 250456)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h 2019-09-27 20:55:59 UTC (rev 250457)
@@ -191,6 +191,9 @@
void sendProcessWillSuspendImminentlyForTesting();
+ void registerSchemeForLegacyCustomProtocol(const String&);
+ void unregisterSchemeForLegacyCustomProtocol(const String&);
+
private:
// AuxiliaryProcessProxy
void getLaunchOptions(ProcessLauncher::LaunchOptions&) override;
Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (250456 => 250457)
--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2019-09-27 20:49:49 UTC (rev 250456)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2019-09-27 20:55:59 UTC (rev 250457)
@@ -102,10 +102,6 @@
#include <wtf/text/StringBuilder.h>
#include <wtf/text/StringConcatenateNumbers.h>
-#if ENABLE(LEGACY_CUSTOM_PROTOCOL_MANAGER)
-#include "LegacyCustomProtocolManagerMessages.h"
-#endif
-
#if ENABLE(SERVICE_CONTROLS)
#include "ServicesController.h"
#endif
@@ -495,9 +491,6 @@
for (auto& scheme : globalURLSchemesWithCustomProtocolHandlers())
parameters.urlSchemesRegisteredForCustomProtocols.append(scheme);
- for (auto& scheme : m_urlSchemesRegisteredForCustomProtocols)
- parameters.urlSchemesRegisteredForCustomProtocols.append(scheme);
-
#if PLATFORM(IOS_FAMILY)
String cookieStorageDirectory = WebProcessPool::cookieStorageDirectory();
if (!cookieStorageDirectory.isEmpty())
@@ -1517,8 +1510,10 @@
return;
globalURLSchemesWithCustomProtocolHandlers().add(urlScheme);
- for (auto* processPool : allProcessPools())
- processPool->registerSchemeForCustomProtocol(urlScheme);
+ for (auto* processPool : allProcessPools()) {
+ if (auto* networkProcess = processPool->networkProcess())
+ networkProcess->registerSchemeForLegacyCustomProtocol(urlScheme);
+ }
}
void WebProcessPool::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers(const String& urlScheme)
@@ -1527,8 +1522,10 @@
return;
globalURLSchemesWithCustomProtocolHandlers().remove(urlScheme);
- for (auto* processPool : allProcessPools())
- processPool->unregisterSchemeForCustomProtocol(urlScheme);
+ for (auto* processPool : allProcessPools()) {
+ if (auto* networkProcess = processPool->networkProcess())
+ networkProcess->unregisterSchemeForLegacyCustomProtocol(urlScheme);
+ }
}
void WebProcessPool::registerURLSchemeAsCachePartitioned(const String& urlScheme)
@@ -1970,23 +1967,6 @@
m_plugInAutoStartProvider.setAutoStartOriginsFilteringOutEntriesAddedAfterTime(dictionary, time);
}
-void WebProcessPool::registerSchemeForCustomProtocol(const String& scheme)
-{
-#if ENABLE(LEGACY_CUSTOM_PROTOCOL_MANAGER)
- if (!globalURLSchemesWithCustomProtocolHandlers().contains(scheme))
- m_urlSchemesRegisteredForCustomProtocols.add(scheme);
- sendToNetworkingProcess(Messages::LegacyCustomProtocolManager::RegisterScheme(scheme));
-#endif
-}
-
-void WebProcessPool::unregisterSchemeForCustomProtocol(const String& scheme)
-{
-#if ENABLE(LEGACY_CUSTOM_PROTOCOL_MANAGER)
- m_urlSchemesRegisteredForCustomProtocols.remove(scheme);
- sendToNetworkingProcess(Messages::LegacyCustomProtocolManager::UnregisterScheme(scheme));
-#endif
-}
-
#if ENABLE(NETSCAPE_PLUGIN_API)
void WebProcessPool::setPluginLoadClientPolicy(WebCore::PluginLoadClientPolicy policy, const String& host, const String& bundleIdentifier, const String& versionString)
{
Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.h (250456 => 250457)
--- trunk/Source/WebKit/UIProcess/WebProcessPool.h 2019-09-27 20:49:49 UTC (rev 250456)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.h 2019-09-27 20:55:59 UTC (rev 250457)
@@ -410,9 +410,6 @@
void resetHSTSHosts();
void resetHSTSHostsAddedAfterDate(double startDateIntervalSince1970);
- void registerSchemeForCustomProtocol(const String&);
- void unregisterSchemeForCustomProtocol(const String&);
-
static void registerGlobalURLSchemeAsHavingCustomProtocolHandlers(const String&);
static void unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers(const String&);
@@ -677,7 +674,6 @@
HTTPCookieAcceptPolicy m_initialHTTPCookieAcceptPolicy { HTTPCookieAcceptPolicy::OnlyFromMainDocumentDomain };
WebCore::SoupNetworkProxySettings m_networkProxySettings;
#endif
- HashSet<String, ASCIICaseInsensitiveHash> m_urlSchemesRegisteredForCustomProtocols;
#if PLATFORM(MAC)
RetainPtr<NSObject> m_enhancedAccessibilityObserver;