WebKit Bugzilla
Attachment 360098 Details for
Bug 193489
: [GTK][WPE] Add web extensions API to whitelist access to a security origin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
wk2-origin-whitelist.diff (text/plain), 63.26 KB, created by
Carlos Garcia Campos
on 2019-01-25 03:24:30 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Carlos Garcia Campos
Created:
2019-01-25 03:24:30 PST
Size:
63.26 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 38a6769e4ea..19e6a08f415 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,26 @@ >+2019-01-25 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [GTK][WPE] Add web extensions API to whitelist access to a security origin >+ https://bugs.webkit.org/show_bug.cgi?id=193489 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add optional port parameter to OriginAccessEntry. When port is WTF::nullopt all ports are allowed to keep >+ backwards compatibility. >+ >+ * dom/Document.cpp: >+ (WebCore::Document::domainIsRegisterable const): Pass WTF::nullopt as port to OriginAccessEntry. >+ * page/OriginAccessEntry.cpp: >+ (WebCore::OriginAccessEntry::OriginAccessEntry): Add port. >+ (WebCore::OriginAccessEntry::matchesOrigin const): Check port matches. >+ * page/OriginAccessEntry.h: >+ (WebCore::OriginAccessEntry::port const): Return the port. >+ (WebCore::operator==): Check also that ports are equal. >+ * page/SecurityPolicy.cpp: >+ (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry): Add port. >+ (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry): Ditto. >+ * page/SecurityPolicy.h: >+ > 2019-01-24 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC][MarginCollapsing] Refactor MarginCollapse::updateCollapsedMarginAfter >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index 5db71f516f6..faf8a5b4326 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -4947,7 +4947,7 @@ bool Document::domainIsRegisterable(const String& newDomain) const > return false; > > auto ipAddressSetting = settings().treatIPAddressAsDomain() ? OriginAccessEntry::TreatIPAddressAsDomain : OriginAccessEntry::TreatIPAddressAsIPAddress; >- OriginAccessEntry accessEntry { securityOrigin().protocol(), newDomain, OriginAccessEntry::AllowSubdomains, ipAddressSetting }; >+ OriginAccessEntry accessEntry { securityOrigin().protocol(), newDomain, WTF::nullopt, OriginAccessEntry::AllowSubdomains, ipAddressSetting }; > if (!accessEntry.matchesOrigin(securityOrigin())) > return false; > >diff --git a/Source/WebCore/page/OriginAccessEntry.cpp b/Source/WebCore/page/OriginAccessEntry.cpp >index 376104ec82f..c1a72149ab3 100644 >--- a/Source/WebCore/page/OriginAccessEntry.cpp >+++ b/Source/WebCore/page/OriginAccessEntry.cpp >@@ -34,10 +34,11 @@ > #include "SecurityOrigin.h" > > namespace WebCore { >- >-OriginAccessEntry::OriginAccessEntry(const String& protocol, const String& host, SubdomainSetting subdomainSetting, IPAddressSetting ipAddressSetting) >+ >+OriginAccessEntry::OriginAccessEntry(const String& protocol, const String& host, Optional<uint16_t> port, SubdomainSetting subdomainSetting, IPAddressSetting ipAddressSetting) > : m_protocol(protocol.convertToASCIILowercase()) > , m_host(host.convertToASCIILowercase()) >+ , m_port(port) > , m_subdomainSettings(subdomainSetting) > , m_ipAddressSettings(ipAddressSetting) > , m_hostIsIPAddress(URL::hostIsIPAddress(m_host)) >@@ -52,11 +53,15 @@ bool OriginAccessEntry::matchesOrigin(const SecurityOrigin& origin) const > > if (m_protocol != origin.protocol()) > return false; >- >+ >+ // If m_port is WTF::nullopt, it means any port, not the default one. >+ if (m_port && ((origin.port() && m_port.value() != origin.port().value()) || (!origin.port() && !WTF::isDefaultPortForProtocol(m_port.value(), m_protocol)))) >+ return false; >+ > // Special case: Include subdomains and empty host means "all hosts, including ip addresses". > if (m_subdomainSettings == AllowSubdomains && m_host.isEmpty()) > return true; >- >+ > // Exact match. > if (m_host == origin.host()) > return true; >diff --git a/Source/WebCore/page/OriginAccessEntry.h b/Source/WebCore/page/OriginAccessEntry.h >index f55f7d938c7..873783ebc72 100644 >--- a/Source/WebCore/page/OriginAccessEntry.h >+++ b/Source/WebCore/page/OriginAccessEntry.h >@@ -49,17 +49,19 @@ public: > }; > > // If host is empty string and SubdomainSetting is AllowSubdomains, the entry will match all domains in the specified protocol. >- OriginAccessEntry(const String& protocol, const String& host, SubdomainSetting, IPAddressSetting); >+ OriginAccessEntry(const String& protocol, const String& host, Optional<uint16_t> port, SubdomainSetting, IPAddressSetting); > bool matchesOrigin(const SecurityOrigin&) const; > > const String& protocol() const { return m_protocol; } > const String& host() const { return m_host; } >+ Optional<uint16_t> port() const { return m_port; } > SubdomainSetting subdomainSettings() const { return m_subdomainSettings; } > IPAddressSetting ipAddressSettings() const { return m_ipAddressSettings; } > > private: > String m_protocol; > String m_host; >+ Optional<uint16_t> m_port; > SubdomainSetting m_subdomainSettings; > IPAddressSetting m_ipAddressSettings; > bool m_hostIsIPAddress; >@@ -69,6 +71,7 @@ inline bool operator==(const OriginAccessEntry& a, const OriginAccessEntry& b) > { > return equalIgnoringASCIICase(a.protocol(), b.protocol()) > && equalIgnoringASCIICase(a.host(), b.host()) >+ && a.port() == b.port() > && a.subdomainSettings() == b.subdomainSettings() > && a.ipAddressSettings() == b.ipAddressSettings(); > } >diff --git a/Source/WebCore/page/SecurityPolicy.cpp b/Source/WebCore/page/SecurityPolicy.cpp >index 423418280ea..1c2a372ea55 100644 >--- a/Source/WebCore/page/SecurityPolicy.cpp >+++ b/Source/WebCore/page/SecurityPolicy.cpp >@@ -178,7 +178,7 @@ bool SecurityPolicy::isAccessToURLWhiteListed(const SecurityOrigin* activeOrigin > return isAccessWhiteListed(activeOrigin, &targetOrigin.get()); > } > >-void SecurityPolicy::addOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomain, bool allowDestinationSubdomains) >+void SecurityPolicy::addOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomain, Optional<uint16_t> destinationPort, bool allowDestinationSubdomains) > { > ASSERT(!sourceOrigin.isUnique()); > if (sourceOrigin.isUnique()) >@@ -192,10 +192,10 @@ void SecurityPolicy::addOriginAccessWhitelistEntry(const SecurityOrigin& sourceO > result.iterator->value = std::make_unique<OriginAccessWhiteList>(); > > OriginAccessWhiteList* list = result.iterator->value.get(); >- list->append(OriginAccessEntry(destinationProtocol, destinationDomain, allowDestinationSubdomains ? OriginAccessEntry::AllowSubdomains : OriginAccessEntry::DisallowSubdomains, OriginAccessEntry::TreatIPAddressAsIPAddress)); >+ list->append(OriginAccessEntry(destinationProtocol, destinationDomain, destinationPort, allowDestinationSubdomains ? OriginAccessEntry::AllowSubdomains : OriginAccessEntry::DisallowSubdomains, OriginAccessEntry::TreatIPAddressAsIPAddress)); > } > >-void SecurityPolicy::removeOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomain, bool allowDestinationSubdomains) >+void SecurityPolicy::removeOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomain, Optional<uint16_t> destinationPort, bool allowDestinationSubdomains) > { > ASSERT(!sourceOrigin.isUnique()); > if (sourceOrigin.isUnique()) >@@ -210,7 +210,7 @@ void SecurityPolicy::removeOriginAccessWhitelistEntry(const SecurityOrigin& sour > return; > > OriginAccessWhiteList& list = *it->value; >- OriginAccessEntry originAccessEntry(destinationProtocol, destinationDomain, allowDestinationSubdomains ? OriginAccessEntry::AllowSubdomains : OriginAccessEntry::DisallowSubdomains, OriginAccessEntry::TreatIPAddressAsIPAddress); >+ OriginAccessEntry originAccessEntry(destinationProtocol, destinationDomain, destinationPort, allowDestinationSubdomains ? OriginAccessEntry::AllowSubdomains : OriginAccessEntry::DisallowSubdomains, OriginAccessEntry::TreatIPAddressAsIPAddress); > if (!list.removeFirst(originAccessEntry)) > return; > >diff --git a/Source/WebCore/page/SecurityPolicy.h b/Source/WebCore/page/SecurityPolicy.h >index 533b1d4fbda..4dd94abd3e9 100644 >--- a/Source/WebCore/page/SecurityPolicy.h >+++ b/Source/WebCore/page/SecurityPolicy.h >@@ -62,8 +62,8 @@ public: > static bool restrictAccessToLocal(); > static bool allowSubstituteDataAccessToLocal(); > >- WEBCORE_EXPORT static void addOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomain, bool allowDestinationSubdomains); >- WEBCORE_EXPORT static void removeOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomain, bool allowDestinationSubdomains); >+ WEBCORE_EXPORT static void addOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomain, Optional<uint16_t> destinationPort, bool allowDestinationSubdomains); >+ WEBCORE_EXPORT static void removeOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomain, Optional<uint16_t> destinationPort, bool allowDestinationSubdomains); > WEBCORE_EXPORT static void resetOriginAccessWhitelists(); > > static bool isAccessWhiteListed(const SecurityOrigin* activeOrigin, const SecurityOrigin* targetOrigin); >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 3f711eaa3f8..890203ee9ae 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,47 @@ >+2019-01-25 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [GTK][WPE] Add web extensions API to whitelist access to a security origin >+ https://bugs.webkit.org/show_bug.cgi?id=193489 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Expose InjectedBundle::addOriginAccessWhitelistEntry(), InjectedBundle::removeOriginAccessWhitelistEntry() and >+ InjectedBundle::resetOriginAccessWhitelists() in GLib API. This patch moves WebKitSecurityOrigin from UIProcess >+ to Shared and make it available from the web extensions API. >+ >+ * NetworkProcess/NetworkConnectionToWebProcess.cpp: >+ (WebKit::NetworkConnectionToWebProcess::addOriginAccessWhitelistEntry): Add port. >+ (WebKit::NetworkConnectionToWebProcess::removeOriginAccessWhitelistEntry): Ditto. >+ * NetworkProcess/NetworkConnectionToWebProcess.h: Ditto. >+ * NetworkProcess/NetworkConnectionToWebProcess.messages.in: Ditto. >+ * PlatformGTK.cmake: >+ * Shared/API/glib/WebKitSecurityOrigin.cpp: Renamed from Source/WebKit/UIProcess/API/glib/WebKitSecurityOrigin.cpp. >+ (webkitSecurityOriginCanRequest): Internal function only used by tests. >+ * Shared/API/glib/WebKitSecurityOriginInternal.h: Copied from Source/WebKit/UIProcess/API/glib/WebKitSecurityOriginPrivate.h. >+ * Shared/API/glib/WebKitSecurityOriginPrivate.h: Copied from Source/WebKit/UIProcess/API/glib/WebKitSecurityOriginPrivate.h. >+ * SourcesGTK.txt: >+ * SourcesWPE.txt: >+ * UIProcess/API/gtk/WebKitSecurityOrigin.h: >+ * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: >+ * UIProcess/API/wpe/WebKitSecurityOrigin.h: >+ * WebProcess/InjectedBundle/API/c/WKBundle.cpp: >+ (WKBundleAddOriginAccessWhitelistEntry): Pass WTF::nullopt as port. >+ (WKBundleRemoveOriginAccessWhitelistEntry): Ditto. >+ * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp: >+ (webkitWebExtensionCreate): Keep a reference to InjectedBundle in WebKitWebExtension private struct. >+ (webkit_web_extension_add_origin_access_whitelist_entry): >+ (webkit_web_extension_remove_origin_access_whitelist_entry): >+ (webkit_web_extension_reset_origin_access_whitelists): >+ * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h: >+ * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h: >+ * WebProcess/InjectedBundle/API/wpe/WebKitWebExtension.h: >+ * WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-0.1-sections.txt: >+ * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h: >+ * WebProcess/InjectedBundle/InjectedBundle.cpp: >+ (WebKit::InjectedBundle::addOriginAccessWhitelistEntry): Add port. >+ (WebKit::InjectedBundle::removeOriginAccessWhitelistEntry): Ditto. >+ * WebProcess/InjectedBundle/InjectedBundle.h: >+ > 2019-01-24 Ryosuke Niwa <rniwa@webkit.org> > > iOS: Split keyboard should not shrink visualViewport.height >diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp >index e634147deba..9ece6239988 100644 >--- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp >@@ -595,14 +595,14 @@ void NetworkConnectionToWebProcess::logUserInteraction(PAL::SessionID sessionID, > #endif > } > >-void NetworkConnectionToWebProcess::addOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, bool allowDestinationSubdomains) >+void NetworkConnectionToWebProcess::addOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, Optional<uint16_t> destinationPort, bool allowDestinationSubdomains) > { >- SecurityPolicy::addOriginAccessWhitelistEntry(SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, allowDestinationSubdomains); >+ SecurityPolicy::addOriginAccessWhitelistEntry(SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, destinationPort, allowDestinationSubdomains); > } > >-void NetworkConnectionToWebProcess::removeOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, bool allowDestinationSubdomains) >+void NetworkConnectionToWebProcess::removeOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, Optional<uint16_t> destinationPort, bool allowDestinationSubdomains) > { >- SecurityPolicy::removeOriginAccessWhitelistEntry(SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, allowDestinationSubdomains); >+ SecurityPolicy::removeOriginAccessWhitelistEntry(SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, destinationPort, allowDestinationSubdomains); > } > > void NetworkConnectionToWebProcess::resetOriginAccessWhitelists() >diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h >index 088de8fded1..580e6e4022b 100644 >--- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h >+++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h >@@ -196,8 +196,8 @@ private: > void removeStorageAccessForAllFramesOnPage(PAL::SessionID, uint64_t pageID); > void logUserInteraction(PAL::SessionID, const String& topLevelOrigin); > >- void addOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, bool allowDestinationSubdomains); >- void removeOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, bool allowDestinationSubdomains); >+ void addOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, Optional<uint16_t> destinationPort, bool allowDestinationSubdomains); >+ void removeOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, Optional<uint16_t> destinationPort, bool allowDestinationSubdomains); > void resetOriginAccessWhitelists(); > > struct ResourceNetworkActivityTracker { >diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in >index f245bca7dc6..6c74fb80d6e 100644 >--- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in >+++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in >@@ -62,8 +62,8 @@ messages -> NetworkConnectionToWebProcess LegacyReceiver { > LogUserInteraction(PAL::SessionID sessionID, String topLevelOrigin) > #endif > >- AddOriginAccessWhitelistEntry(String sourceOrigin, String destinationProtocol, String destinationHost, bool allowDestinationSubdomains); >- RemoveOriginAccessWhitelistEntry(String sourceOrigin, String destinationProtocol, String destinationHost, bool allowDestinationSubdomains); >+ AddOriginAccessWhitelistEntry(String sourceOrigin, String destinationProtocol, String destinationHost, Optional<uint16_t> destinationPort, bool allowDestinationSubdomains); >+ RemoveOriginAccessWhitelistEntry(String sourceOrigin, String destinationProtocol, String destinationHost, Optional<uint16_t> destinationPort, bool allowDestinationSubdomains); > ResetOriginAccessWhitelists(); > > GetNetworkLoadInformationRequest(uint64_t resourceLoadIdentifier) -> (WebCore::ResourceRequest request) LegacySync >diff --git a/Source/WebKit/PlatformGTK.cmake b/Source/WebKit/PlatformGTK.cmake >index 2281274cf0c..74e39a269eb 100644 >--- a/Source/WebKit/PlatformGTK.cmake >+++ b/Source/WebKit/PlatformGTK.cmake >@@ -824,12 +824,14 @@ if (ENABLE_INTROSPECTION) > ${WEBKIT_DIR}/Shared/API/glib/WebKitContextMenu.cpp > ${WEBKIT_DIR}/Shared/API/glib/WebKitContextMenuItem.cpp > ${WEBKIT_DIR}/Shared/API/glib/WebKitHitTestResult.cpp >+ ${WEBKIT_DIR}/Shared/API/glib/WebKitSecurityOrigin.cpp > ${WEBKIT_DIR}/Shared/API/glib/WebKitURIRequest.cpp > ${WEBKIT_DIR}/Shared/API/glib/WebKitURIResponse.cpp > ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitContextMenu.h > ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitContextMenuActions.h > ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitContextMenuItem.h > ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitHitTestResult.h >+ ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitSecurityOrigin.h > ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitURIRequest.h > ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitURIResponse.h > ${WEBKIT_DIR}/WebProcess/InjectedBundle/API/glib/*.cpp >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitSecurityOrigin.cpp b/Source/WebKit/Shared/API/glib/WebKitSecurityOrigin.cpp >similarity index 97% >rename from Source/WebKit/UIProcess/API/glib/WebKitSecurityOrigin.cpp >rename to Source/WebKit/Shared/API/glib/WebKitSecurityOrigin.cpp >index 2e0789d4301..2c68806fe76 100644 >--- a/Source/WebKit/UIProcess/API/glib/WebKitSecurityOrigin.cpp >+++ b/Source/WebKit/Shared/API/glib/WebKitSecurityOrigin.cpp >@@ -68,6 +68,13 @@ WebCore::SecurityOrigin& webkitSecurityOriginGetSecurityOrigin(WebKitSecurityOri > return origin->securityOrigin.get(); > } > >+// Internal API only used for testing. >+bool webkitSecurityOriginCanRequest(WebKitSecurityOrigin* origin, const char* url) >+{ >+ ASSERT(origin); >+ return origin->securityOrigin->canRequest(URL(URL(), String::fromUTF8(url))); >+} >+ > /** > * webkit_security_origin_new: > * @protocol: The protocol for the new origin >diff --git a/Source/WebKit/Shared/API/glib/WebKitSecurityOriginInternal.h b/Source/WebKit/Shared/API/glib/WebKitSecurityOriginInternal.h >new file mode 100644 >index 00000000000..de9a982ee1e >--- /dev/null >+++ b/Source/WebKit/Shared/API/glib/WebKitSecurityOriginInternal.h >@@ -0,0 +1,24 @@ >+/* >+ * Copyright (C) 2019 Igalia S.L. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#pragma once >+ >+#include "WebKitSecurityOrigin.h" >+ >+bool webkitSecurityOriginCanRequest(WebKitSecurityOrigin*, const char*); >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitSecurityOriginPrivate.h b/Source/WebKit/Shared/API/glib/WebKitSecurityOriginPrivate.h >similarity index 100% >rename from Source/WebKit/UIProcess/API/glib/WebKitSecurityOriginPrivate.h >rename to Source/WebKit/Shared/API/glib/WebKitSecurityOriginPrivate.h >diff --git a/Source/WebKit/SourcesGTK.txt b/Source/WebKit/SourcesGTK.txt >index a7188051594..f6a6948ddac 100644 >--- a/Source/WebKit/SourcesGTK.txt >+++ b/Source/WebKit/SourcesGTK.txt >@@ -70,6 +70,7 @@ Shared/API/glib/WebKitContextMenu.cpp @no-unify > Shared/API/glib/WebKitContextMenuActions.cpp @no-unify > Shared/API/glib/WebKitContextMenuItem.cpp @no-unify > Shared/API/glib/WebKitHitTestResult.cpp @no-unify >+Shared/API/glib/WebKitSecurityOrigin.cpp @no-unify > Shared/API/glib/WebKitURIRequest.cpp @no-unify > Shared/API/glib/WebKitURIResponse.cpp @no-unify > >@@ -165,7 +166,6 @@ UIProcess/API/glib/WebKitPrivate.cpp @no-unify > UIProcess/API/glib/WebKitResponsePolicyDecision.cpp @no-unify > UIProcess/API/glib/WebKitScriptDialog.cpp @no-unify > UIProcess/API/glib/WebKitSecurityManager.cpp @no-unify >-UIProcess/API/glib/WebKitSecurityOrigin.cpp @no-unify > UIProcess/API/glib/WebKitSettings.cpp @no-unify > UIProcess/API/glib/WebKitUIClient.cpp @no-unify > UIProcess/API/glib/WebKitURISchemeRequest.cpp @no-unify >diff --git a/Source/WebKit/SourcesWPE.txt b/Source/WebKit/SourcesWPE.txt >index 16b899308ff..9a60be49229 100644 >--- a/Source/WebKit/SourcesWPE.txt >+++ b/Source/WebKit/SourcesWPE.txt >@@ -67,6 +67,7 @@ Shared/API/glib/WebKitContextMenu.cpp @no-unify > Shared/API/glib/WebKitContextMenuActions.cpp @no-unify > Shared/API/glib/WebKitContextMenuItem.cpp @no-unify > Shared/API/glib/WebKitHitTestResult.cpp @no-unify >+Shared/API/glib/WebKitSecurityOrigin.cpp @no-unify > Shared/API/glib/WebKitURIRequest.cpp @no-unify > Shared/API/glib/WebKitURIResponse.cpp @no-unify > >@@ -150,7 +151,6 @@ UIProcess/API/glib/WebKitPrivate.cpp @no-unify > UIProcess/API/glib/WebKitResponsePolicyDecision.cpp @no-unify > UIProcess/API/glib/WebKitScriptDialog.cpp @no-unify > UIProcess/API/glib/WebKitSecurityManager.cpp @no-unify >-UIProcess/API/glib/WebKitSecurityOrigin.cpp @no-unify > UIProcess/API/glib/WebKitSettings.cpp @no-unify > UIProcess/API/glib/WebKitUIClient.cpp @no-unify > UIProcess/API/glib/WebKitURISchemeRequest.cpp @no-unify >diff --git a/Source/WebKit/UIProcess/API/gtk/WebKitSecurityOrigin.h b/Source/WebKit/UIProcess/API/gtk/WebKitSecurityOrigin.h >index 6dca2b77ea6..2a443f88853 100644 >--- a/Source/WebKit/UIProcess/API/gtk/WebKitSecurityOrigin.h >+++ b/Source/WebKit/UIProcess/API/gtk/WebKitSecurityOrigin.h >@@ -17,7 +17,7 @@ > * Boston, MA 02110-1301, USA. > */ > >-#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION) >+#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION) && !defined(__WEBKIT_WEB_EXTENSION_H_INSIDE__) > #error "Only <webkit2/webkit2.h> can be included directly." > #endif > >diff --git a/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt b/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt >index 756aaa4de72..859a60bef6d 100644 >--- a/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt >+++ b/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt >@@ -1451,6 +1451,9 @@ WebKitWebExtension > WebKitWebExtensionInitializeFunction > WebKitWebExtensionInitializeWithUserDataFunction > webkit_web_extension_get_page >+webkit_web_extension_add_origin_access_whitelist_entry >+webkit_web_extension_remove_origin_access_whitelist_entry >+webkit_web_extension_reset_origin_access_whitelists > > <SUBSECTION Standard> > WebKitWebExtensionClass >diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitSecurityOrigin.h b/Source/WebKit/UIProcess/API/wpe/WebKitSecurityOrigin.h >index 80e04523c7f..44e3e65cac0 100644 >--- a/Source/WebKit/UIProcess/API/wpe/WebKitSecurityOrigin.h >+++ b/Source/WebKit/UIProcess/API/wpe/WebKitSecurityOrigin.h >@@ -17,7 +17,7 @@ > * Boston, MA 02110-1301, USA. > */ > >-#if !defined(__WEBKIT_H_INSIDE__) && !defined(WEBKIT2_COMPILATION) >+#if !defined(__WEBKIT_H_INSIDE__) && !defined(WEBKIT2_COMPILATION) && !defined(__WEBKIT_WEB_EXTENSION_H_INSIDE__) > #error "Only <wpe/webkit.h> can be included directly." > #endif > >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp >index bc621c080bc..eb9963af507 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp >@@ -198,12 +198,12 @@ void WKBundleSetSpatialNavigationEnabled(WKBundleRef bundleRef, WKBundlePageGrou > > void WKBundleAddOriginAccessWhitelistEntry(WKBundleRef bundleRef, WKStringRef sourceOrigin, WKStringRef destinationProtocol, WKStringRef destinationHost, bool allowDestinationSubdomains) > { >- WebKit::toImpl(bundleRef)->addOriginAccessWhitelistEntry(WebKit::toWTFString(sourceOrigin), WebKit::toWTFString(destinationProtocol), WebKit::toWTFString(destinationHost), allowDestinationSubdomains); >+ WebKit::toImpl(bundleRef)->addOriginAccessWhitelistEntry(WebKit::toWTFString(sourceOrigin), WebKit::toWTFString(destinationProtocol), WebKit::toWTFString(destinationHost), WTF::nullopt, allowDestinationSubdomains); > } > > void WKBundleRemoveOriginAccessWhitelistEntry(WKBundleRef bundleRef, WKStringRef sourceOrigin, WKStringRef destinationProtocol, WKStringRef destinationHost, bool allowDestinationSubdomains) > { >- WebKit::toImpl(bundleRef)->removeOriginAccessWhitelistEntry(WebKit::toWTFString(sourceOrigin), WebKit::toWTFString(destinationProtocol), WebKit::toWTFString(destinationHost), allowDestinationSubdomains); >+ WebKit::toImpl(bundleRef)->removeOriginAccessWhitelistEntry(WebKit::toWTFString(sourceOrigin), WebKit::toWTFString(destinationProtocol), WebKit::toWTFString(destinationHost), WTF::nullopt, allowDestinationSubdomains); > } > > void WKBundleResetOriginAccessWhitelists(WKBundleRef bundleRef) >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp b/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp >index 082d609a87b..d0498f81162 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp >@@ -23,6 +23,7 @@ > #include "APIDictionary.h" > #include "APIInjectedBundleBundleClient.h" > #include "APIString.h" >+#include "WebKitSecurityOriginPrivate.h" > #include "WebKitWebExtensionPrivate.h" > #include "WebKitWebPagePrivate.h" > #include "WebProcess.h" >@@ -118,6 +119,7 @@ enum { > typedef HashMap<WebPage*, GRefPtr<WebKitWebPage> > WebPageMap; > > struct _WebKitWebExtensionPrivate { >+ RefPtr<InjectedBundle> bundle; > WebPageMap pages; > #if ENABLE(DEVELOPER_MODE) > bool garbageCollectOnPageDestroy; >@@ -196,6 +198,7 @@ private: > WebKitWebExtension* webkitWebExtensionCreate(InjectedBundle* bundle) > { > WebKitWebExtension* extension = WEBKIT_WEB_EXTENSION(g_object_new(WEBKIT_TYPE_WEB_EXTENSION, NULL)); >+ extension->priv->bundle = bundle; > bundle->setClient(std::make_unique<WebExtensionInjectedBundleClient>(extension)); > return extension; > } >@@ -229,3 +232,83 @@ WebKitWebPage* webkit_web_extension_get_page(WebKitWebExtension* extension, guin > > return 0; > } >+ >+/** >+ * webkit_web_extension_add_origin_access_whitelist_entry: >+ * @extension: a #WebKitWebExtension >+ * @origin: a #WebKitSecurityOrigin >+ * @protocol: the destination protocol >+ * @host: (nullable): the destination host, or %NULL for any host >+ * @port: the destination port, or -1 for any port, or 0 to indicate the >+ * default port for @protocol >+ * @allow_subdomains: whether to allow subdomains when @host is not %NULL >+ * >+ * Add a whitelist entry for origin to allow cross origin access to the given @protocol and @host. >+ * If @host is %NULL, all hosts are allowed and the @allow_subdomains parameter is ignored. >+ * If @allow_subdomains is %TRUE, subdomains of @host for the given @protocol are also allowed to >+ * be accessed from @origin. >+ * >+ * Since: 2.24 >+ */ >+void webkit_web_extension_add_origin_access_whitelist_entry(WebKitWebExtension* extension, WebKitSecurityOrigin* origin, const char* protocol, const char* host, gint16 port, gboolean allowSubdomains) >+{ >+ g_return_if_fail(WEBKIT_IS_WEB_EXTENSION(extension)); >+ g_return_if_fail(origin); >+ g_return_if_fail(!webkit_security_origin_is_opaque(origin)); >+ g_return_if_fail(protocol); >+ g_return_if_fail(port >= -1); >+ >+ Optional<uint16_t> destinationPort; >+ if (!port) >+ destinationPort = WTF::defaultPortForProtocol(String::fromUTF8(protocol)); >+ else if (port > 0) >+ destinationPort = port; >+ >+ extension->priv->bundle->addOriginAccessWhitelistEntry(webkitSecurityOriginGetSecurityOrigin(origin).toString(), String::fromUTF8(protocol), String::fromUTF8(host), destinationPort, host ? allowSubdomains : true); >+} >+ >+/** >+ * webkit_web_extension_remove_origin_access_whitelist_entry: >+ * @extension: a #WebKitWebExtension >+ * @origin: a #WebKitSecurityOrigin >+ * @protocol: the destination protocol >+ * @host: (nullable): the destination host, or %NULL for any host >+ * @port: the destination port, or -1 for any port, or 0 to indicate the >+ * default port for @protocol >+ * @allow_subdomains: whether subdomains were allowed when @host is not %NULL >+ * >+ * Remove a whitelist entry for origin previously added with webkit_web_extension_add_origin_access_whitelist_entry(). >+ * >+ * Since: 2.24 >+ */ >+void webkit_web_extension_remove_origin_access_whitelist_entry(WebKitWebExtension* extension, WebKitSecurityOrigin* origin, const char* protocol, const char* host, gint16 port, gboolean allowSubdomains) >+{ >+ g_return_if_fail(WEBKIT_IS_WEB_EXTENSION(extension)); >+ g_return_if_fail(origin); >+ g_return_if_fail(!webkit_security_origin_is_opaque(origin)); >+ g_return_if_fail(protocol); >+ g_return_if_fail(port >= -1); >+ >+ Optional<uint16_t> destinationPort; >+ if (!port) >+ destinationPort = WTF::defaultPortForProtocol(String::fromUTF8(protocol)); >+ else if (port > 0) >+ destinationPort = port; >+ >+ extension->priv->bundle->removeOriginAccessWhitelistEntry(webkitSecurityOriginGetSecurityOrigin(origin).toString(), String::fromUTF8(protocol), String::fromUTF8(host), destinationPort, host ? allowSubdomains : true); >+} >+ >+/** >+ * webkit_web_extension_reset_origin_access_whitelists: >+ * @extension: a #WebKitWebExtension >+ * >+ * Remove all whitelist entries previously added with webkit_web_extension_add_origin_access_whitelist_entry(). >+ * >+ * Since: 2.24 >+ */ >+void webkit_web_extension_reset_origin_access_whitelists(WebKitWebExtension* extension) >+{ >+ g_return_if_fail(WEBKIT_IS_WEB_EXTENSION(extension)); >+ >+ extension->priv->bundle->resetOriginAccessWhitelists(); >+} >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h b/Source/WebKit/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h >index 34136a37d25..49296ff3a9e 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h >@@ -26,6 +26,7 @@ > > #include <glib-object.h> > #include <webkit2/WebKitDefines.h> >+#include <webkit2/WebKitSecurityOrigin.h> > #include <webkit2/WebKitWebPage.h> > > G_BEGIN_DECLS >@@ -76,11 +77,30 @@ struct _WebKitWebExtensionClass { > }; > > WEBKIT_API GType >-webkit_web_extension_get_type (void); >+webkit_web_extension_get_type (void); > > WEBKIT_API WebKitWebPage * >-webkit_web_extension_get_page (WebKitWebExtension *extension, >- guint64 page_id); >+webkit_web_extension_get_page (WebKitWebExtension *extension, >+ guint64 page_id); >+ >+WEBKIT_API void >+webkit_web_extension_add_origin_access_whitelist_entry (WebKitWebExtension *extension, >+ WebKitSecurityOrigin *origin, >+ const gchar *protocol, >+ const gchar *host, >+ gint16 port, >+ gboolean allow_subdomains); >+ >+WEBKIT_API void >+webkit_web_extension_remove_origin_access_whitelist_entry (WebKitWebExtension *extension, >+ WebKitSecurityOrigin *origin, >+ const gchar *protocol, >+ const gchar *host, >+ gint16 port, >+ gboolean allow_subdomains); >+ >+WEBKIT_API void >+webkit_web_extension_reset_origin_access_whitelists (WebKitWebExtension *extension); > > G_END_DECLS > >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h b/Source/WebKit/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h >index 1c95f1d3aed..1469089661a 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h >@@ -32,6 +32,7 @@ > #include <webkit2/WebKitContextMenuItem.h> > #include <webkit2/WebKitFrame.h> > #include <webkit2/WebKitScriptWorld.h> >+#include <webkit2/WebKitSecurityOrigin.h> > #include <webkit2/WebKitURIRequest.h> > #include <webkit2/WebKitURIResponse.h> > #include <webkit2/WebKitVersion.h> >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/wpe/WebKitWebExtension.h b/Source/WebKit/WebProcess/InjectedBundle/API/wpe/WebKitWebExtension.h >index a6ffb485048..6863ee1758d 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/wpe/WebKitWebExtension.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/wpe/WebKitWebExtension.h >@@ -26,6 +26,7 @@ > > #include <glib-object.h> > #include <wpe/WebKitDefines.h> >+#include <wpe/WebKitSecurityOrigin.h> > #include <wpe/WebKitWebPage.h> > > G_BEGIN_DECLS >@@ -76,11 +77,30 @@ struct _WebKitWebExtensionClass { > }; > > WEBKIT_API GType >-webkit_web_extension_get_type (void); >+webkit_web_extension_get_type (void); > > WEBKIT_API WebKitWebPage * >-webkit_web_extension_get_page (WebKitWebExtension *extension, >- guint64 page_id); >+webkit_web_extension_get_page (WebKitWebExtension *extension, >+ guint64 page_id); >+ >+WEBKIT_API void >+webkit_web_extension_add_origin_access_whitelist_entry (WebKitWebExtension *extension, >+ WebKitSecurityOrigin *origin, >+ const gchar *protocol, >+ const gchar *host, >+ gint16 port, >+ gboolean allow_subdomains); >+ >+WEBKIT_API void >+webkit_web_extension_remove_origin_access_whitelist_entry (WebKitWebExtension *extension, >+ WebKitSecurityOrigin *origin, >+ const gchar *protocol, >+ const gchar *host, >+ gint16 port, >+ gboolean allow_subdomains); >+ >+WEBKIT_API void >+webkit_web_extension_reset_origin_access_whitelists (WebKitWebExtension *extension); > > G_END_DECLS > >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-0.1-sections.txt b/Source/WebKit/WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-0.1-sections.txt >index a1d6844ddcf..fd2083c4f24 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-0.1-sections.txt >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-0.1-sections.txt >@@ -13,6 +13,9 @@ WebKitWebExtension > WebKitWebExtensionInitializeFunction > WebKitWebExtensionInitializeWithUserDataFunction > webkit_web_extension_get_page >+webkit_web_extension_add_origin_access_whitelist_entry >+webkit_web_extension_remove_origin_access_whitelist_entry >+webkit_web_extension_reset_origin_access_whitelists > > <SUBSECTION Standard> > WebKitWebExtensionClass >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h b/Source/WebKit/WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h >index 796b21e41f1..ade4b8dcfdc 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h >@@ -32,6 +32,7 @@ > #include <wpe/WebKitContextMenuItem.h> > #include <wpe/WebKitFrame.h> > #include <wpe/WebKitScriptWorld.h> >+#include <wpe/WebKitSecurityOrigin.h> > #include <wpe/WebKitURIRequest.h> > #include <wpe/WebKitURIResponse.h> > #include <wpe/WebKitWebEditor.h> >diff --git a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp >index 1dbbdcfe497..cded92b25f0 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp >@@ -392,17 +392,17 @@ void InjectedBundle::setSpatialNavigationEnabled(WebPageGroupProxy* pageGroup, b > (*iter)->settings().setSpatialNavigationEnabled(enabled); > } > >-void InjectedBundle::addOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, bool allowDestinationSubdomains) >+void InjectedBundle::addOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, Optional<uint16_t> destinationPort, bool allowDestinationSubdomains) > { >- SecurityPolicy::addOriginAccessWhitelistEntry(SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, allowDestinationSubdomains); >- WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::AddOriginAccessWhitelistEntry { sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains }, 0); >+ SecurityPolicy::addOriginAccessWhitelistEntry(SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, destinationPort, allowDestinationSubdomains); >+ WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::AddOriginAccessWhitelistEntry { sourceOrigin, destinationProtocol, destinationHost, destinationPort, allowDestinationSubdomains }, 0); > > } > >-void InjectedBundle::removeOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, bool allowDestinationSubdomains) >+void InjectedBundle::removeOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, Optional<uint16_t> destinationPort, bool allowDestinationSubdomains) > { >- SecurityPolicy::removeOriginAccessWhitelistEntry(SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, allowDestinationSubdomains); >- WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RemoveOriginAccessWhitelistEntry { sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains }, 0); >+ SecurityPolicy::removeOriginAccessWhitelistEntry(SecurityOrigin::createFromString(sourceOrigin).get(), destinationProtocol, destinationHost, destinationPort, allowDestinationSubdomains); >+ WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RemoveOriginAccessWhitelistEntry { sourceOrigin, destinationProtocol, destinationHost, destinationPort, allowDestinationSubdomains }, 0); > } > > void InjectedBundle::resetOriginAccessWhitelists() >diff --git a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h >index 255c9f597cf..d6df801be32 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h >@@ -109,8 +109,8 @@ public: > void setPopupBlockingEnabled(WebPageGroupProxy*, bool); > void setAuthorAndUserStylesEnabled(WebPageGroupProxy*, bool); > void setSpatialNavigationEnabled(WebPageGroupProxy*, bool); >- void addOriginAccessWhitelistEntry(const String&, const String&, const String&, bool); >- void removeOriginAccessWhitelistEntry(const String&, const String&, const String&, bool); >+ void addOriginAccessWhitelistEntry(const String&, const String&, const String&, Optional<uint16_t>, bool); >+ void removeOriginAccessWhitelistEntry(const String&, const String&, const String&, Optional<uint16_t>, bool); > void resetOriginAccessWhitelists(); > void setAsynchronousSpellCheckingEnabled(WebPageGroupProxy*, bool); > int numberOfPages(WebFrame*, double, double); >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index d9ba94dd537..09159f2a562 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,46 @@ >+2019-01-25 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [GTK][WPE] Add web extensions API to whitelist access to a security origin >+ https://bugs.webkit.org/show_bug.cgi?id=193489 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a new test to check the new API. This patch refactors WebProcess tests to receive the WebKitWebExtension as >+ parameter of create function. >+ >+ * TestWebKitAPI/Tests/WebKitGLib/DOMElementTest.cpp: >+ (DOMElementTest::create): >+ * TestWebKitAPI/Tests/WebKitGLib/EditorTest.cpp: >+ (WebKitWebEditorTest::create): >+ * TestWebKitAPI/Tests/WebKitGLib/FrameTest.cpp: >+ (WebKitFrameTest::create): >+ * TestWebKitAPI/Tests/WebKitGLib/OriginWhitelistTest.cpp: Added. >+ (OriginWhitelistTest::create): >+ (OriginWhitelistTest::OriginWhitelistTest): >+ (OriginWhitelistTest::testWhitelist): >+ (registerTests): >+ * TestWebKitAPI/Tests/WebKitGLib/TestOriginWhitelist.cpp: Added. >+ (testOriginWhitelist): >+ (beforeAll): >+ (afterAll): >+ * TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.cpp: >+ (WebProcessTest::add): >+ (WebProcessTest::create): >+ (runTest): >+ (windowObjectClearedCallback): >+ * TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.h: >+ * TestWebKitAPI/Tests/WebKitGtk/AutocleanupsTest.cpp: >+ (AutocleanupsTest::create): >+ * TestWebKitAPI/Tests/WebKitGtk/DOMClientRectTest.cpp: >+ (WebKitDOMClientRectTest::create): >+ * TestWebKitAPI/Tests/WebKitGtk/DOMNodeFilterTest.cpp: >+ (WebKitDOMNodeFilterTest::create): >+ * TestWebKitAPI/Tests/WebKitGtk/DOMNodeTest.cpp: >+ (WebKitDOMNodeTest::create): >+ * TestWebKitAPI/Tests/WebKitGtk/DOMXPathNSResolverTest.cpp: >+ (WebKitDOMXPathNSResolverTest::create): >+ * TestWebKitAPI/glib/CMakeLists.txt: >+ > 2019-01-24 Ryan Haddad <ryanhaddad@apple.com> > > Update macOS JSC bot configurations >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/DOMElementTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/DOMElementTest.cpp >index cd603ac2b57..7a5bcd57e8b 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/DOMElementTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/DOMElementTest.cpp >@@ -25,7 +25,7 @@ > > class DOMElementTest : public WebProcessTest { > public: >- static std::unique_ptr<WebProcessTest> create() { return std::unique_ptr<WebProcessTest>(new DOMElementTest()); } >+ static std::unique_ptr<WebProcessTest> create(WebKitWebExtension*) { return std::unique_ptr<WebProcessTest>(new DOMElementTest()); } > > private: > bool testAutoFill(WebKitWebPage* page) >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/EditorTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/EditorTest.cpp >index 5f763e4bbcd..83c23b4603e 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/EditorTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/EditorTest.cpp >@@ -23,7 +23,7 @@ > > class WebKitWebEditorTest : public WebProcessTest { > public: >- static std::unique_ptr<WebProcessTest> create() { return std::unique_ptr<WebProcessTest>(new WebKitWebEditorTest()); } >+ static std::unique_ptr<WebProcessTest> create(WebKitWebExtension*) { return std::unique_ptr<WebProcessTest>(new WebKitWebEditorTest()); } > > private: > static void selectionChangedCallback(bool* selectionChanged) >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/FrameTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/FrameTest.cpp >index 2e67c0a7a32..ea29418000c 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/FrameTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/FrameTest.cpp >@@ -25,7 +25,7 @@ > > class WebKitFrameTest : public WebProcessTest { > public: >- static std::unique_ptr<WebProcessTest> create() { return std::unique_ptr<WebProcessTest>(new WebKitFrameTest()); } >+ static std::unique_ptr<WebProcessTest> create(WebKitWebExtension*) { return std::unique_ptr<WebProcessTest>(new WebKitFrameTest()); } > > private: > bool testMainFrame(WebKitWebPage* page) >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/OriginWhitelistTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/OriginWhitelistTest.cpp >new file mode 100644 >index 00000000000..8b4b3402395 >--- /dev/null >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/OriginWhitelistTest.cpp >@@ -0,0 +1,127 @@ >+/* >+ * Copyright (C) 2019 Igalia S.L. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#include "config.h" >+ >+#include "WebKitSecurityOriginInternal.h" >+#include "WebProcessTest.h" >+#include <gio/gio.h> >+#include <wtf/glib/GUniquePtr.h> >+ >+class OriginWhitelistTest : public WebProcessTest { >+public: >+ static std::unique_ptr<WebProcessTest> create(WebKitWebExtension* extension) { return std::unique_ptr<WebProcessTest>(new OriginWhitelistTest(extension)); } >+ >+private: >+ OriginWhitelistTest(WebKitWebExtension* extension) >+ : m_extension(extension) >+ { >+ } >+ >+ bool testWhitelist(WebKitWebPage* page) >+ { >+ WebKitSecurityOrigin* origin = webkit_security_origin_new("http", "foo.com", 0); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://foo.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "http://foo.com:8080/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "http://bar.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://bar.com/page")); >+ >+ webkit_web_extension_add_origin_access_whitelist_entry(m_extension, origin, "https", "foo.com", 0, FALSE); >+ g_assert_true(webkitSecurityOriginCanRequest(origin, "https://foo.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://foo.com:8080/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "http://bar.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://bar.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://bar.foo.com/page")); >+ >+ webkit_web_extension_add_origin_access_whitelist_entry(m_extension, origin, "https", "foo.com", 443, FALSE); >+ g_assert_true(webkitSecurityOriginCanRequest(origin, "https://foo.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://foo.com:8080/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "http://bar.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://bar.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://bar.foo.com/page")); >+ >+ webkit_web_extension_add_origin_access_whitelist_entry(m_extension, origin, "https", "foo.com", -1, FALSE); >+ g_assert_true(webkitSecurityOriginCanRequest(origin, "https://foo.com/page")); >+ g_assert_true(webkitSecurityOriginCanRequest(origin, "https://foo.com:8080/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "http://bar.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://bar.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://bar.foo.com/page")); >+ >+ webkit_web_extension_remove_origin_access_whitelist_entry(m_extension, origin, "https", "foo.com", -1, FALSE); >+ g_assert_true(webkitSecurityOriginCanRequest(origin, "https://foo.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://foo.com:8080/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "http://bar.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://bar.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://bar.foo.com/page")); >+ >+ webkit_web_extension_add_origin_access_whitelist_entry(m_extension, origin, "https", "foo.com", 0, TRUE); >+ g_assert_true(webkitSecurityOriginCanRequest(origin, "https://foo.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://foo.com:8080/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "http://bar.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://bar.com/page")); >+ g_assert_true(webkitSecurityOriginCanRequest(origin, "https://bar.foo.com/page")); >+ >+ webkit_web_extension_remove_origin_access_whitelist_entry(m_extension, origin, "https", "foo.com", 0, TRUE); >+ g_assert_true(webkitSecurityOriginCanRequest(origin, "https://foo.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://foo.com:8080/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "http://bar.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://bar.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://bar.foo.com/page")); >+ >+ webkit_web_extension_add_origin_access_whitelist_entry(m_extension, origin, "http", "bar.com", 0, FALSE); >+ g_assert_true(webkitSecurityOriginCanRequest(origin, "https://foo.com/page")); >+ g_assert_true(webkitSecurityOriginCanRequest(origin, "http://bar.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://bar.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://bar.foo.com/page")); >+ >+ webkit_web_extension_reset_origin_access_whitelists(m_extension); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://foo.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "http://bar.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://bar.com/page")); >+ >+ webkit_web_extension_add_origin_access_whitelist_entry(m_extension, origin, "https", nullptr, 0, TRUE); >+ g_assert_true(webkitSecurityOriginCanRequest(origin, "https://foo.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "http://bar.com/page")); >+ g_assert_true(webkitSecurityOriginCanRequest(origin, "https://bar.com/page")); >+ g_assert_true(webkitSecurityOriginCanRequest(origin, "https://bar.foo.com/page")); >+ >+ webkit_web_extension_reset_origin_access_whitelists(m_extension); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://foo.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "http://bar.com/page")); >+ g_assert_false(webkitSecurityOriginCanRequest(origin, "https://bar.com/page")); >+ >+ return true; >+ } >+ >+ bool runTest(const char* testName, WebKitWebPage* page) override >+ { >+ if (!strcmp(testName, "whitelist")) >+ return testWhitelist(page); >+ >+ g_assert_not_reached(); >+ return false; >+ } >+ >+ WebKitWebExtension* m_extension { nullptr }; >+}; >+ >+static void __attribute__((constructor)) registerTests() >+{ >+ REGISTER_TEST(OriginWhitelistTest, "OriginWhitelist/whitelist"); >+} >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestOriginWhitelist.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestOriginWhitelist.cpp >new file mode 100644 >index 00000000000..428f97365f2 >--- /dev/null >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestOriginWhitelist.cpp >@@ -0,0 +1,36 @@ >+/* >+ * Copyright (C) 2019 Igalia S.L. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Lesser General Public >+ * License as published by the Free Software Foundation; either >+ * version 2,1 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#include "config.h" >+ >+#include "WebViewTest.h" >+ >+static void testOriginWhitelist(WebViewTest* test, gconstpointer) >+{ >+ g_assert_true(test->runWebProcessTest("OriginWhitelist", "whitelist")); >+} >+ >+void beforeAll() >+{ >+ WebViewTest::add("OriginWhitelist", "whitelist", testOriginWhitelist); >+} >+ >+void afterAll() >+{ >+} >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.cpp >index f441a719a82..3778fb75a80 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.cpp >@@ -29,7 +29,7 @@ > > static HashSet<GObject*> s_watchedObjects; > >-typedef HashMap<String, std::function<std::unique_ptr<WebProcessTest> ()>> TestsMap; >+typedef HashMap<String, std::function<std::unique_ptr<WebProcessTest> (WebKitWebExtension*)>> TestsMap; > static TestsMap& testsMap() > { > static NeverDestroyed<TestsMap> s_testsMap; >@@ -49,7 +49,7 @@ static void checkLeaks() > g_assert_true(s_watchedObjects.isEmpty()); > } > >-void WebProcessTest::add(const String& testName, std::function<std::unique_ptr<WebProcessTest> ()> closure) >+void WebProcessTest::add(const String& testName, std::function<std::unique_ptr<WebProcessTest> (WebKitWebExtension*)> closure) > { > testsMap().add(testName, WTFMove(closure)); > } >@@ -62,19 +62,19 @@ void WebProcessTest::assertObjectIsDeletedWhenTestFinishes(GObject* object) > }, nullptr); > } > >-std::unique_ptr<WebProcessTest> WebProcessTest::create(const String& testName) >+std::unique_ptr<WebProcessTest> WebProcessTest::create(WebKitWebExtension* extension, const String& testName) > { > g_assert_true(testsMap().contains(testName)); >- return testsMap().get(testName)(); >+ return testsMap().get(testName)(extension); > } > >-static gboolean runTest(WebKitWebPage* webPage, const char* testPath) >+static gboolean runTest(WebKitWebPage* webPage, const char* testPath, WebKitWebExtension* extension) > { > g_assert_true(WEBKIT_IS_WEB_PAGE(webPage)); > WebProcessTest::assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webPage)); > g_assert_nonnull(testPath); > >- std::unique_ptr<WebProcessTest> test = WebProcessTest::create(String::fromUTF8(testPath)); >+ std::unique_ptr<WebProcessTest> test = WebProcessTest::create(extension, String::fromUTF8(testPath)); > return test->runTest(g_strrstr(testPath, "/") + 1, webPage); > } > >@@ -93,7 +93,7 @@ static void windowObjectClearedCallback(WebKitScriptWorld* world, WebKitWebPage* > WebProcessTest::assertObjectIsDeletedWhenTestFinishes(G_OBJECT(context.get())); > auto* jsClass = jsc_context_register_class(context.get(), "WebProcessTestRunner", nullptr, nullptr, reinterpret_cast<GDestroyNotify>(webProcessTestRunnerFinalize)); > WebProcessTest::assertObjectIsDeletedWhenTestFinishes(G_OBJECT(jsClass)); >- jsc_class_add_method(jsClass, "runTest", G_CALLBACK(runTest), NULL, NULL, G_TYPE_BOOLEAN, 1, G_TYPE_STRING); >+ jsc_class_add_method(jsClass, "runTest", G_CALLBACK(runTest), extension, nullptr, G_TYPE_BOOLEAN, 1, G_TYPE_STRING); > GRefPtr<JSCValue> testRunner = adoptGRef(jsc_value_new_object(context.get(), g_object_ref(webPage), jsClass)); > WebProcessTest::assertObjectIsDeletedWhenTestFinishes(G_OBJECT(testRunner.get())); > jsc_context_set_value(context.get(), "WebProcessTestRunner", testRunner.get()); >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.h b/Tools/TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.h >index 7a44cb05cd4..01b53eb7ce0 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.h >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.h >@@ -36,8 +36,8 @@ public: > > static void assertObjectIsDeletedWhenTestFinishes(GObject*); > >- static void add(const String& testName, std::function<std::unique_ptr<WebProcessTest> ()>); >- static std::unique_ptr<WebProcessTest> create(const String& testName); >+ static void add(const String& testName, std::function<std::unique_ptr<WebProcessTest> (WebKitWebExtension*)>); >+ static std::unique_ptr<WebProcessTest> create(WebKitWebExtension*, const String& testName); > }; > > #define REGISTER_TEST(ClassName, TestName) \ >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/AutocleanupsTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/AutocleanupsTest.cpp >index f79cf345182..05d73e2f70e 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/AutocleanupsTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/AutocleanupsTest.cpp >@@ -26,7 +26,7 @@ > > class AutocleanupsTest : public WebProcessTest { > public: >- static std::unique_ptr<WebProcessTest> create() { return std::unique_ptr<WebProcessTest>(new AutocleanupsTest()); } >+ static std::unique_ptr<WebProcessTest> create(WebKitWebExtension*) { return std::unique_ptr<WebProcessTest>(new AutocleanupsTest()); } > > private: > bool testWebProcessAutocleanups(WebKitWebPage* webPage) >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMClientRectTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMClientRectTest.cpp >index 1b39fafa7a7..1605922da62 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMClientRectTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMClientRectTest.cpp >@@ -27,7 +27,7 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS; > > class WebKitDOMClientRectTest : public WebProcessTest { > public: >- static std::unique_ptr<WebProcessTest> create() { return std::unique_ptr<WebKitDOMClientRectTest>(new WebKitDOMClientRectTest()); } >+ static std::unique_ptr<WebProcessTest> create(WebKitWebExtension*) { return std::unique_ptr<WebKitDOMClientRectTest>(new WebKitDOMClientRectTest()); } > > private: > static void checkClientRectPosition(WebKitDOMClientRect* clientRect) >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMNodeFilterTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMNodeFilterTest.cpp >index cca82fcee0c..78dc15943d8 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMNodeFilterTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMNodeFilterTest.cpp >@@ -61,7 +61,7 @@ static const char* expectedElementsNoInput[] = { "HTML", "HEAD", "TITLE", "BODY" > > class WebKitDOMNodeFilterTest : public WebProcessTest { > public: >- static std::unique_ptr<WebProcessTest> create() { return std::unique_ptr<WebProcessTest>(new WebKitDOMNodeFilterTest()); } >+ static std::unique_ptr<WebProcessTest> create(WebKitWebExtension*) { return std::unique_ptr<WebProcessTest>(new WebKitDOMNodeFilterTest()); } > > private: > bool testTreeWalker(WebKitWebPage* page) >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMNodeTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMNodeTest.cpp >index ba7fab99cf6..db4d1e3e116 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMNodeTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMNodeTest.cpp >@@ -28,7 +28,7 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS; > > class WebKitDOMNodeTest : public WebProcessTest { > public: >- static std::unique_ptr<WebProcessTest> create() { return std::unique_ptr<WebKitDOMNodeTest>(new WebKitDOMNodeTest()); } >+ static std::unique_ptr<WebProcessTest> create(WebKitWebExtension*) { return std::unique_ptr<WebKitDOMNodeTest>(new WebKitDOMNodeTest()); } > > private: > bool testHierarchyNavigation(WebKitWebPage* page) >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMXPathNSResolverTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMXPathNSResolverTest.cpp >index 35ee3503a40..47efa02993c 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMXPathNSResolverTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMXPathNSResolverTest.cpp >@@ -59,7 +59,7 @@ static void webkit_xpath_ns_resolver_class_init(WebKitXPathNSResolverClass*) > > class WebKitDOMXPathNSResolverTest : public WebProcessTest { > public: >- static std::unique_ptr<WebProcessTest> create() { return std::unique_ptr<WebProcessTest>(new WebKitDOMXPathNSResolverTest()); } >+ static std::unique_ptr<WebProcessTest> create(WebKitWebExtension*) { return std::unique_ptr<WebProcessTest>(new WebKitDOMXPathNSResolverTest()); } > > private: > void evaluateFooChildTextAndCheckResult(WebKitDOMDocument* document, WebKitDOMXPathNSResolver* resolver) >diff --git a/Tools/TestWebKitAPI/glib/CMakeLists.txt b/Tools/TestWebKitAPI/glib/CMakeLists.txt >index edb8a136102..9dbc51e8344 100644 >--- a/Tools/TestWebKitAPI/glib/CMakeLists.txt >+++ b/Tools/TestWebKitAPI/glib/CMakeLists.txt >@@ -43,6 +43,7 @@ set(WebKitGLibAPIWebProcessTests > ${TOOLS_DIR}/TestWebKitAPI/Tests/WebKitGLib/DOMElementTest.cpp > ${TOOLS_DIR}/TestWebKitAPI/Tests/WebKitGLib/EditorTest.cpp > ${TOOLS_DIR}/TestWebKitAPI/Tests/WebKitGLib/FrameTest.cpp >+ ${TOOLS_DIR}/TestWebKitAPI/Tests/WebKitGLib/OriginWhitelistTest.cpp > ${TOOLS_DIR}/TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.cpp > ) > >@@ -144,6 +145,7 @@ ADD_WK2_TEST(TestWebKitUserContentManager ${TOOLS_DIR}/TestWebKitAPI/Tests/WebKi > ADD_WK2_TEST(TestWebsiteData ${TOOLS_DIR}/TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp) > ADD_WK2_TEST(TestConsoleMessage ${TOOLS_DIR}/TestWebKitAPI/Tests/WebKitGLib/TestConsoleMessage.cpp) > ADD_WK2_TEST(TestDOMElement ${TOOLS_DIR}/TestWebKitAPI/Tests/WebKitGLib/TestDOMElement.cpp) >+ADD_WK2_TEST(TestOriginWhitelist ${TOOLS_DIR}/TestWebKitAPI/Tests/WebKitGLib/TestOriginWhitelist.cpp) > > # FIXME: Enable for WPE > if (PORT STREQUAL "GTK")
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193489
:
359265
|
359266
|
359366
|
360098
|
360112
|
360325
|
361675