Skip to content

Commit

Permalink
Merge pull request WebPlatformForEmbedded#1273 from filipe-norte-red/…
Browse files Browse the repository at this point in the history
…wpe-2.38-missing-custom-uri-scheme-handler-info

Fix Security Origin handling in network process
  • Loading branch information
magomez authored Jan 11, 2024
2 parents 98943f6 + 231279c commit d7dbe70
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
#include "WebsiteDataStoreParameters.h"
#include <WebCore/DocumentStorageAccess.h>
#include <WebCore/HTTPCookieAcceptPolicy.h>
#include <WebCore/LegacySchemeRegistry.h>
#include <WebCore/NetworkStorageSession.h>
#include <WebCore/ResourceError.h>
#include <WebCore/ResourceLoadObserver.h>
Expand Down Expand Up @@ -1441,6 +1442,11 @@ void NetworkConnectionToWebProcess::installMockContentFilter(WebCore::MockConten
}
#endif

void NetworkConnectionToWebProcess::registerURLSchemeAsHandledBySchemeHandler(const String& scheme)
{
WebCore::LegacySchemeRegistry::registerURLSchemeAsHandledBySchemeHandler(scheme);
}

} // namespace WebKit

#undef CONNECTION_RELEASE_LOG
Expand Down
2 changes: 2 additions & 0 deletions Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ class NetworkConnectionToWebProcess

void registerURLSchemesAsCORSEnabled(Vector<String>&& schemes);

void registerURLSchemeAsHandledBySchemeHandler(const String& scheme);

void cookiesForDOM(const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, WebCore::FrameIdentifier, WebCore::PageIdentifier, WebCore::IncludeSecureCookies, WebCore::ShouldAskITP, WebCore::ShouldRelaxThirdPartyCookieBlocking, CompletionHandler<void(String cookieString, bool secureCookiesAccessed)>&&);
void setCookiesFromDOM(const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, WebCore::FrameIdentifier, WebCore::PageIdentifier, WebCore::ShouldAskITP, const String&, WebCore::ShouldRelaxThirdPartyCookieBlocking);
void cookieRequestHeaderFieldValue(const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, std::optional<WebCore::FrameIdentifier>, std::optional<WebCore::PageIdentifier>, WebCore::IncludeSecureCookies, WebCore::ShouldAskITP, WebCore::ShouldRelaxThirdPartyCookieBlocking, CompletionHandler<void(String cookieString, bool secureCookiesAccessed)>&&);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,5 @@ messages -> NetworkConnectionToWebProcess LegacyReceiver {
#if ENABLE(CONTENT_FILTERING_IN_NETWORKING_PROCESS)
InstallMockContentFilter(WebCore::MockContentFilterSettings settings)
#endif
RegisterURLSchemeAsHandledBySchemeHandler(String scheme)
}
2 changes: 2 additions & 0 deletions Source/WebKit/WebProcess/WebPage/WebPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7285,6 +7285,8 @@ void WebPage::registerURLSchemeHandler(WebURLSchemeHandlerIdentifier handlerIden
WebCore::LegacySchemeRegistry::registerURLSchemeAsCORSEnabled(scheme);
auto schemeResult = m_schemeToURLSchemeHandlerProxyMap.add(scheme, WebURLSchemeHandlerProxy::create(*this, handlerIdentifier));
m_identifierToURLSchemeHandlerProxyMap.add(handlerIdentifier, schemeResult.iterator->value.get());

WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterURLSchemeAsHandledBySchemeHandler { scheme }, 0);
}

void WebPage::urlSchemeTaskWillPerformRedirection(WebURLSchemeHandlerIdentifier handlerIdentifier, WebCore::ResourceLoaderIdentifier taskIdentifier, ResourceResponse&& response, ResourceRequest&& request, CompletionHandler<void(WebCore::ResourceRequest&&)>&& completionHandler)
Expand Down

0 comments on commit d7dbe70

Please sign in to comment.