mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 06:45:42 +00:00
Bug 1348981 - add Cu.readURI helper for sync file reading on startup r=kmag
MozReview-Commit-ID: 1yz25afCUDs --HG-- extra : rebase_source : 549e28b7ceeb6556156d8f6e4d2a7470852d64c0
This commit is contained in:
parent
f0cf406637
commit
cb1aad0897
@ -15,6 +15,7 @@ interface nsIClassInfo;
|
||||
interface nsIComponentManager;
|
||||
interface nsICycleCollectorListener;
|
||||
interface nsIFile;
|
||||
interface nsIURI;
|
||||
interface nsIJSCID;
|
||||
interface nsIJSIID;
|
||||
interface nsIPrincipal;
|
||||
@ -701,6 +702,12 @@ interface nsIXPCComponents_Utils : nsISupports
|
||||
* startup so its contents will be available the next time they're read.
|
||||
*/
|
||||
ACString readFile(in nsIFile file);
|
||||
|
||||
/*
|
||||
* Reads the given local file URL and returns its contents. This has the
|
||||
* same semantics of readFile.
|
||||
*/
|
||||
ACString readURI(in nsIURI url);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -3397,6 +3397,15 @@ nsXPCComponents_Utils::ReadFile(nsIFile* aFile, nsACString& aResult)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXPCComponents_Utils::ReadURI(nsIURI* aURI, nsACString& aResult)
|
||||
{
|
||||
NS_ENSURE_TRUE(aURI, NS_ERROR_INVALID_ARG);
|
||||
|
||||
MOZ_TRY_VAR(aResult, URLPreloader::ReadURI(aURI));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXPCComponents_Utils::Now(double* aRetval)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user