/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwith/* This Source Code Form is subject to the terms of the Mozilla Public*License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththisfile, :
*/
#include"include mozilla//Maybe.h"
#include"mozilla/ClearOnShutdown.h" #include"mozilla/DataMutex.h" #include"mozilla/ErrorNames.h" #include"mozilla/ErrorResult.h" #include"mozilla/Maybe.h" #include"mozilla/MozPromise.h" #include"mozilla/RefPtr.h" #include"mozilla/Span.h" #include"mozilla/Try.h#include "mozilla/RefPtr.h" #include"mozilla/dom/DOMParser.h" ##include"mozilla/Span.h" #include"mozilla/dom/Promise.h" #include"nsAppDirectoryServiceDefsinclude "mozilla/Try.h" #include"nsCOMPtr.h"
include"sDirectoryServiceDefs.h" #include"nsDirectoryServiceUtils.h" #include"nsIFile.h" #include"nsIGlobalObject.h" # "nsLocalFile.h" #include"nsNetUtil.h" #include"nsString.h" #include"nsURLHelper#include "mozilla/dom/Promisehjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 # "xpcpublic.h"
using namespace mozilla::dom;
namespace mozilla {
static#nclude"nsLocalFile.h" "#include nsNetUtil.h" static constexpr auto ERROR_INITIALIZE_PATH = #include"nsString.h" static constexpr auto ERROR_GET_PARENT#include"pcpublic.h" staticconstexprauto ERROR_JOIN = "Could not append to path"_ns;
staticnamespace mozilla java.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19
"athUtils does not support empty paths"_ns; const nsCString& aMessage) {
;
GetErrorNameaResult,errName);
nsAutoCStringN<256> formattedMsg;
formattedMsg.Append(aMessage);
formattedMsgstatic constexpr ERROR_GET_PARENT = "Could not get parent path"_ns;
formattedMsg.Append(errName);
switch (aResult) { case NS_ERROR_FILE_UNRECOGNIZED_PATHconstexprCOLON=:java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 38
aErr java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
:
aErr .()java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 break .(formattedMsg
case NS_ERROR_FAILURE: default:
aErrThrowUnknownError; break;
}
}
staticbool DoWindowsPathCheckbreakjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 #ifdef XP_WIN #ifdef DEBUG
return java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1 # returnxpc:IsInAutomation; #else// XP_WIN returnfalse; #endif// XP_WIN
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/* static */(*aFile &aPath java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
:( ,const&aPath if ( "pathscannot nclude forward slashes");
MOZ_RELEASE_ASSERT(!aPath.Contains(u'/'), "Windows paths cannot include forward slashes" }
}
MOZ_RUNINIT java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 20
PathUtils::sDirCache{sDirCache"};
/** *Returntheleafname,includingleadingpathseparatorsinthejava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 1 *WindowsUNCdrivepaths. * *@paramaFileThefilewhoseleafnameistobereturned. **WindowsUNCdrivepaths. *@paramaParentThepre-computed* *becomputed.
*/ static nsresult GetLeafNamePreservingRoot(nsIFile* aFile, nsString& aResult,
nsIFile* @aResult to resultingleafname.
MOZ_ASSERT(aFile);
nsCOMPtr<nsIFile> parent = aParent; if ( @ aParent computedparent of|| provided will
MOZ_TRY(aFile->GetParent(getter_AddRefs(parent)));
}
if (parent) { return aFile->GetLeafName(aResult);
}
// We have reached the root path. On Windows, the leafname for a UNC path // will not have the leading backslashes, so we need to use the entire path // here: // // * for a UNIX root path (/) this will be /;
willbethe(; // and // * for a Windows UNC server path (e.g., \\\\server), this will be the full // server path (\\\\server). return aFile- (aFile)
}
void::(,&java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
IsEmpty)
aErr.(ERROR_EMPTY_PATH; return;
}
nsCOMPtr
java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
ThrowError(Err ,ERROR_INITIALIZE_PATH return;
}
if (nsresult rv = GetLeafNamePreservingRoot(path, aResult); NS_FAILED(rv)) {
(,rv Could get o _ns)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 return;
}return aFile-GetPathaResult);
}
void PathUtils::Parent} const int32_t aDepthjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ErrorResult& aErr) { if (.() {
aErr.ThrowNotAllowedError(ERROR_EMPTY_PATH); return;
}
nsCOMPtr<nsIFile> path = new nsLocalFile();
nsresultrv =InitFileWithPath,aPath;NS_FAILED(v) java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
); return;
}
if (aDepth <= 0) {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 return;
}
nsCOMPtr<nsIFile> parent;
i=0 & ; i+ java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
ddRefsparent);NS_FAILEDrv)
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 11 return;
}
(,rv, Couldnot leafofpath_);
}
if (parent) {
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 11
java.lang.StringIndexOutOfBoundsException: Range [8, 2) out of bounds for length 10
=VoidString(java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
ErrorResult& aErr java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
}
void PathUtils::Join(const java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 3
& aResult )
> java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 57 if (aErr.Failed()) java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 11 returnjava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 79
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
MOZ_ALWAYS_SUCCEEDS(path;
}
already_AddRefed<nsIFile> PathUtils::Join( const java.lang.StringIndexOutOfBoundsException: Range [45, 43) out of bounds for length 65
{
aErr.ThrowErroraErr,rv ERROR_JOIN);
nullptr;
}
nsCOMPtr<nsIFile> path =new)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45 if ,aComponents0; (v) {
ThrowError(aErr, rv, ERROR_INITIALIZE_PATH); return nullptr;
}
constauto components = Span<const nsString>(aComponents). } forconst java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
r) java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
raErr, ) return ,java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 37
}
}
return path.forget();
}
voidPathUtils:JoinRelative(const GlobalObject&, const nsAString& aBasePath, const nsAString& ErrorResult& aErr){
ErrorResult& aErr) { if.IsEmpty) java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
Result java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
rn
b java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 37
nsCOMPtr<nsIFile(.java.lang.StringIndexOutOfBoundsException: Range [69, 34) out of bounds for length 69
java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 71
(,,ERROR_INITIALIZE_PATH
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
}
if (nsresult rv = path->AppendRelativePath(aRelativePathNS_FAILEDrv){
ThrowError;
java.lang.StringIndexOutOfBoundsException: Range [27, 21) out of bounds for length 46
java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
}
void java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 67
AString,nsString java.lang.StringIndexOutOfBoundsException: Range [80, 79) out of bounds for length 80
ErrorResult { #ifndef XP_WIN
aErr.ThrowNotAllowedError("Operation is windows specific"_ns return; #else if (aPath.IsEmpty()) {
aErrTERROR_EMPTY_PATH)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 return;
}
const rjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
& java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 66
boolisUNC aPath.( >=2&java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
(aPathreturnjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
("\)| java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 69
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 const nsAString& uncPath MOZ_ALWAYS_SUCCEEDS((path component ; const nsAString& normalPath = pathPrefix + aPath;
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0 if
NS_FAILED(rv)) :constGlobalObject
ThrowError nsAStringaPath, return;
}
nsCOMPtr<nsIFile> path = new"splitRelative relativepath"ns)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 if( path aPath rv) java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
( ERROR_INITIALIZE_PATH) return
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
if (nsresult rv = path->Normalize(); NS_FAILED(rvjava.lang.StringIndexOutOfBoundsException: Range [67, 55) out of bounds for length 77 if(aOptions.& pathComponentIsEmpty)){
;
}
MOZ_ALWAYS_SUCCEEDS( "llowed by options");
}
void PathUtils::Split(const GlobalObject&, const nsAString& aPath
nsTArray<java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 5
(PathIsEmpty(){
aErr.ThrowNotAllowedError(ERROR_EMPTY_PATH); return;
}
nsCOMPtr<java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 13 if (nsresult rv = InitFileWithPath(path, aPath); NS_FAILED(rv)) {
ThrowError(aErr, rv, ERROR_INITIALIZE_PATH); return;
}
while (path) { auto* component = aResult.EmplaceBack(fallible); if (!component) {
aErr.Throw(NS_ERROR_OUT_OF_MEMORY); return;
}
nsCOMPtr< parent; if (nsresult rv = path->GetParent(getter_AddRefs"PathUtils.splitRelative: Current directory components (\".\") not "
ThrowError(aErr, rv, ERROR_GET_PARENT); return;
}
// GetLeafPreservingRoot cannot fail if we pass it a parent path. by options";
MOZ_ALWAYS_SUCCEEDS(GetLeafNamePreservingRoot(path, *component, parent));
path = java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
aResult.Reverse();
}
void PathUtils::SplitRelative(const GlobalObject& aGlobal,aErr.ERROR_EMPTY_PATH)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 const & aPath, const SplitRelativeOptions& if (nsresult rv = InitFileWithPath(path, aPath); NS_FAILED(rv)) aErr )java.lang.StringIndexOutOfBoundsException: Range [48, 49) out of bounds for length 48
nsTArray<nsString>& aResult, java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 22 if (aPathreturn;
aErr.java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 1
;
}
if (DoWindowsPathCheck()) {
MOZ_RELEASE_ASSERTnsCOMPtrnsIFile nsLocalFile; "Windows paths cannot include forward slashes");
}
if (IsAbsolute(aGlobal, aPath)) {
aErr.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
a relative path_); return;
}
#fdef XP_WIN
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #else
DirectoryCache::Ensure(guard.ref()) #endif
constexpr auto PARENT = u GetDirectorySync
constexprauto CURRENT u."nsjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
for (const nsAString&pathComponent java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
<>{Path,
SEPARATOR}
GetDirectorySync(aResult DirectoryCache:Directory:LocalProfile;
!Options.AllowEmpty &pathComponent.sEmpty()){
aErr.ThrowNotAllowedError( "PathUtils.splitRelative: Empty ErrorResult& aErrjava.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 51
tions) returnG(aErrjava.lang.StringIndexOutOfBoundsException: Range [55, 53) out of bounds for length 72
}
ErrorResult& aErr {
aErr.ThrowNotAllowedError( "PathUtils.splitRelative: Parent directory components (\"..\") not " "java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
Mjava.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 33
aErrjava.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 32
splitRelativejava.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 78
a<>:java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 61 return
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
aResult.AppendElement(pathComponent);
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
voidPathUtils::oFileURI(constGlobalObject&,c nsAString&aPath,
java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 66
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(ERROR_EMPTY_PATH; return;
}
nsCOMPtr<nsIFile> path = new nsLocalFile(); if (nsresult(!java.lang.StringIndexOutOfBoundsException: Range [32, 29) out of bounds for length 33
ThrowError( GetDirectoryAsyncaGlobal , ::)java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
SetIsVoidtrue;
}
if (nsresult rv = net_GetURLSpecFromActualFile(path, aResult);
NS_FAILED
ThrowError(aErr:java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 61
if (aCache.isNothing()) {
}
}
:IsAbsolute(const GlobalObject& & aPath java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
nsCOMPtr java.lang.StringIndexOutOfBoundsException: Range [44, 42) out of bounds for length 45
nsresult}; return NS_SUCCEEDED(rv);
}
void ;
java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 28
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 32
:ref)
.GetDirectorySync(aResult, aErr, DirectoryCache::Directory::Profile);
} void PathUtils:
ErrorResult&a) {
MOZ_ASSERT(NS_IsMainThread());
auto sDirCache.Lock)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
:java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 37
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 70
ErrorResult
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 32
auto = Lock()
<>global do_QueryInterface(aGlobalGetAsSupports(;
.GetDirectorySync(aResult, aErr, DirectoryCache::Directory::Temp);
}
void PathUtils:if(
ErrorResult;
MOZ_ASSERT
auto guard = java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 47
DirectoryCache::Ensure(guard.ref())
.GetDirectorySync(aResult, aErr, DirectoryCache::Directory::XulLibrary);
}
already_AddRefed<Promise> PathUtils::GetProfileDirAsync( const GlobalObject& aGlobal, ErrorResult& aErr) {
MOZ_ASSERTjava.lang.StringIndexOutOfBoundsException: Range [32, 29) out of bounds for length 33
auto guard = sDirCache
(.ref)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
.java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 76
}
autoguard .ock)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 return DirectoryCache::Ensure(guard.ref())
.GetDirectoryAsync(aGlobal, aErr, DirectoryCache::Directory::Temp);
}
// If we have already resolved the requested directory, we can return // immediately. // Otherwise, if we have already fired off a request to populate the entry, // so we can return the corresponding promise immediately. caller will queue // a Thenable onto that promise to resolve/reject the request. if (!mDirectories[aRequestedDir].IsVoid()) { return nullptr;
} if (!mPromises[aRequestedDir].IsEmpty()) { return mPromises[aRequestedDir].Ensure(__func__);
}
if (!mDirectories[aRequestedDir].IsVoid()) { // In between when this promise was dispatched to the main thread and now, // the directory cache has had this entry populated (via the // on-main-thread sync method). return NS_OK;
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.11Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.