Bug 1536744 - Add "moz-icon" to NS_NewURIOnAnyThread r=baku

Differential Revision: https://phabricator.services.mozilla.com/D30702

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Valentin Gosu 2019-05-28 13:49:19 +00:00
parent 875ad56974
commit 016cf57214
2 changed files with 11 additions and 0 deletions

View File

@ -17,6 +17,10 @@ FINAL_LIBRARY = 'xul'
include('/ipc/chromium/chromium-config.mozbuild')
EXPORTS += [
'nsIconURI.h',
]
platform = None
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:

View File

@ -99,6 +99,7 @@
#include "nsSocketTransportService2.h"
#include "nsViewSourceHandler.h"
#include "nsJARURI.h"
#include "nsIconURI.h"
#include "nsAboutProtocolHandler.h"
#include "nsResProtocolHandler.h"
#include "mozilla/net/ExtensionProtocolHandler.h"
@ -1832,6 +1833,12 @@ nsresult NS_NewURIOnAnyThread(nsIURI** aURI, const nsACString& aSpec,
.Finalize(aURI);
}
if (scheme.EqualsLiteral("moz-icon")) {
return NS_MutateURI(new nsMozIconURI::Mutator())
.SetSpec(aSpec)
.Finalize(aURI);
}
#ifdef MOZ_WIDGET_GTK
if (scheme.EqualsLiteral("smb") || scheme.EqualsLiteral("sftp")) {
nsCOMPtr<nsIURI> base(aBaseURI);