Bug 408599 Expose nsSimpleNestedURI to XPCOM r=biesi sr=bz

This commit is contained in:
Neil Rashbrook 2009-08-23 23:48:07 +01:00
Родитель 3fcfcc0d93
Коммит 5e803b125c
2 изменённых файлов: 22 добавлений и 2 удалений

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

@ -46,7 +46,7 @@ interface nsIPrefBranch;
/**
* nsINetUtil provides various network-related utility methods.
*/
[scriptable, uuid(a50d5516-5c0a-4f08-b427-703ca0c44ac3)]
[scriptable, uuid(ca68c485-9db3-4c12-82a6-4fab7948e2d5)]
interface nsINetUtil : nsISupports
{
/**
@ -95,6 +95,13 @@ interface nsINetUtil : nsISupports
*/
nsIURI toImmutableURI(in nsIURI aURI);
/**
* Create a simple nested URI using the result of
* toImmutableURI on the passed-in aURI which may not be null.
* Note: The return URI will not have had its spec set yet.
*/
nsIURI newSimpleNestedURI(in nsIURI aURI);
/** Escape every character with its %XX-escaped equivalent */
const unsigned long ESCAPE_ALL = 0;

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

@ -67,7 +67,7 @@
#include "nsIRecyclingAllocator.h"
#include "nsISocketTransport.h"
#include "nsCRT.h"
#include "nsINestedURI.h"
#include "nsSimpleNestedURI.h"
#include "nsNetUtil.h"
#include "nsThreadUtils.h"
#include "nsIPermissionManager.h"
@ -939,6 +939,19 @@ nsIOService::ToImmutableURI(nsIURI* uri, nsIURI** result)
return NS_OK;
}
NS_IMETHODIMP
nsIOService::NewSimpleNestedURI(nsIURI* aURI, nsIURI** aResult)
{
NS_ENSURE_ARG(aURI);
nsCOMPtr<nsIURI> safeURI;
nsresult rv = NS_EnsureSafeToReturn(aURI, getter_AddRefs(safeURI));
NS_ENSURE_SUCCESS(rv, rv);
NS_IF_ADDREF(*aResult = new nsSimpleNestedURI(safeURI));
return *aResult ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
NS_IMETHODIMP
nsIOService::SetManageOfflineStatus(PRBool aManage) {
PRBool wasManaged = mManageOfflineStatus;