Bug 1435671 - Reduce binary size by making NS_MutateURI.Apply not be a templated method r=mayhemer
We instead add a templated method NS_MutatorMethod that returns a std::function<nsresult(nsIURIMutator*)> which Apply then calls with mMutator as an argument. The function returned by NS_MutatorMethod performs a QueryInterface, then calls the passed method with arguments on the result. MozReview-Commit-ID: Jjqp7gGLG1D
This commit is contained in:
@@ -141,12 +141,13 @@ nsAndroidProtocolHandler::NewURI(const nsACString &aSpec,
|
||||
nsIURI *aBaseURI,
|
||||
nsIURI **result)
|
||||
{
|
||||
nsCOMPtr<nsIURI> base(aBaseURI);
|
||||
return NS_MutateURI(NS_STANDARDURLMUTATOR_CONTRACTID)
|
||||
.Apply<nsIStandardURLMutator>(&nsIStandardURLMutator::Init,
|
||||
nsIStandardURL::URLTYPE_STANDARD, -1,
|
||||
nsCString(aSpec), aCharset, aBaseURI,
|
||||
nullptr)
|
||||
.Finalize(result);
|
||||
.Apply(NS_MutatorMethod(&nsIStandardURLMutator::Init,
|
||||
nsIStandardURL::URLTYPE_STANDARD,
|
||||
-1, nsCString(aSpec), aCharset,
|
||||
base, nullptr))
|
||||
.Finalize(result);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
||||
Reference in New Issue
Block a user