Source code

Revision control

Other Tools

1
#include "nsIURIMutator.h"
2
#include "nsIURI.h"
3
#include "nsComponentManagerUtils.h"
4
5
static nsresult GetURIMutator(nsIURI* aURI, nsIURIMutator** aMutator) {
6
if (NS_WARN_IF(!aURI)) {
7
return NS_ERROR_INVALID_ARG;
8
}
9
return aURI->Mutate(aMutator);
10
}
11
12
NS_MutateURI::NS_MutateURI(nsIURI* aURI) {
13
mStatus = GetURIMutator(aURI, getter_AddRefs(mMutator));
14
NS_ENSURE_SUCCESS_VOID(mStatus);
15
}
16
17
NS_MutateURI::NS_MutateURI(const char* aContractID)
18
: mStatus(NS_ERROR_NOT_INITIALIZED) {
19
mMutator = do_CreateInstance(aContractID, &mStatus);
20
MOZ_ASSERT(NS_SUCCEEDED(mStatus), "Called with wrong aContractID");
21
}