2017-12-05 19:17:02 +03:00
|
|
|
#include "nsIURIMutator.h"
|
|
|
|
#include "nsIURI.h"
|
|
|
|
#include "nsComponentManagerUtils.h"
|
|
|
|
|
|
|
|
static nsresult
|
|
|
|
GetURIMutator(nsIURI* aURI, nsIURIMutator** aMutator)
|
|
|
|
{
|
|
|
|
if (NS_WARN_IF(!aURI)) {
|
|
|
|
return NS_ERROR_INVALID_ARG;
|
|
|
|
}
|
|
|
|
return aURI->Mutate(aMutator);
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_MutateURI::NS_MutateURI(nsIURI* aURI)
|
|
|
|
{
|
|
|
|
mStatus = GetURIMutator(aURI, getter_AddRefs(mMutator));
|
2018-02-26 22:43:45 +03:00
|
|
|
NS_ENSURE_SUCCESS_VOID(mStatus);
|
2017-12-05 19:17:02 +03:00
|
|
|
}
|
|
|
|
|
2018-04-13 16:01:28 +03:00
|
|
|
NS_MutateURI::NS_MutateURI(const char * aContractID)
|
2018-06-14 11:19:07 +03:00
|
|
|
: mStatus(NS_ERROR_NOT_INITIALIZED)
|
2017-12-05 19:17:02 +03:00
|
|
|
{
|
|
|
|
mMutator = do_CreateInstance(aContractID, &mStatus);
|
2018-01-08 17:20:35 +03:00
|
|
|
MOZ_ASSERT(NS_SUCCEEDED(mStatus), "Called with wrong aContractID");
|
2017-12-05 19:17:02 +03:00
|
|
|
}
|