Bug 1631464 Remove the title argument from registerProtocolHandler() r=smaug

See https://groups.google.com/g/mozilla.dev.platform/c/T633aemFPJU/m/dbv5_iB8AgAJ

Differential Revision: https://phabricator.services.mozilla.com/D71714
This commit is contained in:
Frederic Wang 2020-10-27 14:10:22 +00:00
Родитель 5cabaa29f2
Коммит 5a2adffbe7
5 изменённых файлов: 9 добавлений и 13 удалений

Просмотреть файл

@ -985,7 +985,6 @@ void Navigator::CheckProtocolHandlerAllowed(const nsAString& aScheme,
void Navigator::RegisterProtocolHandler(const nsAString& aScheme, void Navigator::RegisterProtocolHandler(const nsAString& aScheme,
const nsAString& aURI, const nsAString& aURI,
const nsAString& aTitle,
ErrorResult& aRv) { ErrorResult& aRv) {
if (!mWindow || !mWindow->GetOuterWindow() || !mWindow->GetDocShell() || if (!mWindow || !mWindow->GetOuterWindow() || !mWindow->GetDocShell() ||
!mWindow->GetDoc()) { !mWindow->GetDoc()) {
@ -1014,9 +1013,13 @@ void Navigator::RegisterProtocolHandler(const nsAString& aScheme,
return; return;
} }
// Determine a title from the document URI.
nsAutoCString docDisplayHostPort;
docURI->GetDisplayHostPort(docDisplayHostPort);
NS_ConvertASCIItoUTF16 title(docDisplayHostPort);
if (XRE_IsContentProcess()) { if (XRE_IsContentProcess()) {
nsAutoString scheme(aScheme); nsAutoString scheme(aScheme);
nsAutoString title(aTitle);
RefPtr<BrowserChild> browserChild = BrowserChild::GetFrom(mWindow); RefPtr<BrowserChild> browserChild = BrowserChild::GetFrom(mWindow);
browserChild->SendRegisterProtocolHandler(scheme, handlerURI, title, browserChild->SendRegisterProtocolHandler(scheme, handlerURI, title,
docURI); docURI);
@ -1026,8 +1029,8 @@ void Navigator::RegisterProtocolHandler(const nsAString& aScheme,
nsCOMPtr<nsIWebProtocolHandlerRegistrar> registrar = nsCOMPtr<nsIWebProtocolHandlerRegistrar> registrar =
do_GetService(NS_WEBPROTOCOLHANDLERREGISTRAR_CONTRACTID); do_GetService(NS_WEBPROTOCOLHANDLERREGISTRAR_CONTRACTID);
if (registrar) { if (registrar) {
aRv = registrar->RegisterProtocolHandler(aScheme, handlerURI, aTitle, aRv = registrar->RegisterProtocolHandler(aScheme, handlerURI, title, docURI,
docURI, mWindow->GetOuterWindow()); mWindow->GetOuterWindow());
} }
} }

Просмотреть файл

@ -123,7 +123,7 @@ class Navigator final : public nsISupports, public nsWrapperCache {
nsIURI* aHandlerURI, nsIURI* aDocumentURI, nsIURI* aHandlerURI, nsIURI* aDocumentURI,
ErrorResult& aRv); ErrorResult& aRv);
void RegisterProtocolHandler(const nsAString& aScheme, const nsAString& aURL, void RegisterProtocolHandler(const nsAString& aScheme, const nsAString& aURL,
const nsAString& aTitle, ErrorResult& aRv); ErrorResult& aRv);
nsMimeTypeArray* GetMimeTypes(ErrorResult& aRv); nsMimeTypeArray* GetMimeTypes(ErrorResult& aRv);
nsPluginArray* GetPlugins(ErrorResult& aRv); nsPluginArray* GetPlugins(ErrorResult& aRv);
Permissions* GetPermissions(ErrorResult& aRv); Permissions* GetPermissions(ErrorResult& aRv);

Просмотреть файл

@ -84,7 +84,7 @@ interface mixin NavigatorContentUtils {
[Throws, ChromeOnly] [Throws, ChromeOnly]
void checkProtocolHandlerAllowed(DOMString scheme, URI handlerURI, URI documentURI); void checkProtocolHandlerAllowed(DOMString scheme, URI handlerURI, URI documentURI);
[Throws, SecureContext] [Throws, SecureContext]
void registerProtocolHandler(DOMString scheme, DOMString url, DOMString title); void registerProtocolHandler(DOMString scheme, DOMString url);
// NOT IMPLEMENTED // NOT IMPLEMENTED
//void unregisterProtocolHandler(DOMString scheme, DOMString url); //void unregisterProtocolHandler(DOMString scheme, DOMString url);
}; };

Просмотреть файл

@ -711,9 +711,6 @@ prefs: [dom.security.featurePolicy.experimental.enabled:true, dom.security.featu
[OffscreenCanvasRenderingContext2D interface: operation arc(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, optional boolean)] [OffscreenCanvasRenderingContext2D interface: operation arc(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, optional boolean)]
expected: FAIL expected: FAIL
[Navigator interface: operation registerProtocolHandler(DOMString, USVString)]
expected: FAIL
[ElementInternals interface: operation setValidity(optional ValidityStateFlags, optional DOMString, optional HTMLElement)] [ElementInternals interface: operation setValidity(optional ValidityStateFlags, optional DOMString, optional HTMLElement)]
expected: FAIL expected: FAIL

Просмотреть файл

@ -1,4 +0,0 @@
[historical.https.window.html]
[registerProtocolHandler has no third argument]
expected: FAIL