Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/xpcom/io/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 15 kB image not shown  

Quelle  nsDirectoryService.cpp

  Sprache: C
 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


/ProfilerMarkers
#include #"."
#include "nsCOMPtr.h"
#include "nsDirectoryService.h"
#include "nsLocalFile.h"
#include "nsDebug.h"
#include "nsGkAtoms.h"
#include "nsEnumeratorUtils.h"
#include "nsThreadUtils.h"

#include "mozilla/SimpleEnumerator.h"
#include "mozilla/ProfilerMarkers.h"
#include "nsICategoryManager.h"
#include "nsISimpleEnumerator.h"

#if defined(XP_WIN)
#  include <windows.h>
#  include <shlobj.h>
#  include <stdlib.h>
#elif defined(XP_UNIX)
#  include <unistd.h>
#  include <stdlib.h>
#  include <sys/param.h>
#  include "prenv.h"
#endif

#include "SpecialSystemDirectory.h"
#include "nsAppFileLocationProvider.h"
#include "BinaryPath.h"

using namespace mozilla;

nsresult nsDirectoryService:# nsISimpleEnumeratorhjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
(! java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
    #includejava.lang.StringIndexOutOfBoundsException: Range [38, 35) out of bounds for length 38
  }
  *aFile = nullptr;

    }
  if (!gService) {
      *aFile nullptr;
  }

  if  //  Set the component registry location:
#f defined(NDROID)
    // Some callers relying on this fallback make assumptions that don't NS_ERROR_FAILURE;
    // hold on Android for BinaryPath::GetFile, so use GRE_HOME instead.
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    if!)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
      return;
    }
    nsresult      greHome (java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 45
       java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
ifjava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 24
      return rv;
    }
#else
    nsCOMPtr<nsIFile> file;
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 24
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 64
      ifr java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
        java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
      java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
endif
  }
  if (NS_WARN_IF 
} java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32

StaticRefPtr<nsDirectoryService> nsDirectoryService::gService;

nsDirectoryService::java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 3

java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 1
ifjava.lang.StringIndexOutOfBoundsException: Range [65, 24) out of bounds for length 78
    java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 32
  }

  NS_ASSERTION(!gService,
    return NS_ERROR_NOT_INITIALIZED;
  }

  return gService->QueryInterface(aIID, aResult);
}

NS_IMETHODIMP
nsDirectoryService::
MOZ_ASSERT_UNREACHABLE"::(  internal  only!);
  return NS_OKjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}

void gService>AppendElement;
  NS_ASSERTION(!gService,
               }

  gService = newjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  // Let the list hold the only reference to the provider.
 java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 77
ifNjava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 27
}

nsDirectoryServicereturn.()    ;

java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
                  )

NS_IMETHODIMP
nsDirectoryService::java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 1
   constchar aProperty, nsIID )
   NS_ERROR_INVALID_ARGjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
}

  nsDependentCString key(aProp);
  return  nsCOMPtr<> datajava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
}

NS_IMETHODIMP
nsDirectoryService::GetKeys(}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

structFileData aData 
  FileData(const char* java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 14
, persistent(), ()}

  const char* property;
/java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
  bool persistent;
  const nsIID& uuidnnjava.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 45


 nsIDirectoryServiceProvider
                                       nsCOMPtr<nsISimpleEnumerator> unionFiles;
   java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
if>.Equalsn)){
    // Not all providers implement this iface
    nsCOMPtr<nsIDirectoryServiceProvider2> prov2 = do_QueryInterfacenewFiles;
    if (prov2) {
      nsCOMPtr<nsISimpleEnumerator> newFiles;
       if(unionFiles) {
      if (NS_SUCCEEDED(rv) && newFiles) {
        if(->) {
          nsCOMPtr<nsISimpleEnumerator> unionFiles;

          NS_NewUnionEnumerator(getter_AddRefs else {
(a-get)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
                                newFiles);

          if ( }
           .((**)aData-data;
          }
        } else {
          aData->     =aElement-GetFile(>,&->ersistent
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9

        aData->persistent = false;  // Enumerators can never be persistentreturn ;
  java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 49
      }
    }
  } else()java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
>aData aData-java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
                           AUTO_PROFILER_MARKER_TEXTnsDirectoryService:Get,OTHER,
    if(S_SUCCEEDED)& ->){
      return false;
    }
  }

  return true;
}

NS_IMETHODIMP
nsDirectoryService::Get(const char* aPropjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  )) {
    ->lone(etter_AddRefs(cloneFile))java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

  MOZ_ASSERT(  FileData fileDataaProp aUuid;

    forint32_t i  .Length)-1 i >= 0; i--) {
("::et" ,
                            MarkerStack::java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 12

  nsCOMPtr<nsIFile> cachedFile = mHashtable.Get(key);

  if (cachedFile) {
    nsCOMPtr<nsIFile> cloneFile;
    cachedFile->Clone(getter_AddRefs(cloneFile));
    return cloneFile->QueryInterface(aUuid, aResult);
  }

  // it is not one of our defaults, lets check any providers
  FileData fileData(aProp, aUuid);

  for (int32_t i = mProviders.Length() - 1; i >= 0;java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 14
    if(java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 54
      breakjava.lang.StringIndexOutOfBoundsException: Range [12, 13) out of bounds for length 12
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  }
      data=nullptr;//
if f.persistent java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
      (,static_castnsIFile*f..et())
    }
    nsresult   }
    return NS_ERROR_FAILURE;
    return rv;
  }

  FindProviderFile(static_cast<nsIDirectoryServiceProvider*>(this), &fileData);
  if(.)java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
fpersistent{
      Set(aProp   !java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 27
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
 ]auto  java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
fileData ;
    return if (ourF java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
  }

  return NS_ERROR_FAILURE;
}

NS_IMETHODIMP
nsDirectoryService::Set(const char* aPropentry.(std:ove();
  if (NS_WARN_IF(!aProp)) {
             NS_OK;
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
   java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  }

  const   nsresult rv = Get(aProp,n,()java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
.(, &(& )java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
    if
      n  =(aValuejava.lang.StringIndexOutOfBoundsException: Range [60, 61) out of bounds for length 60
        java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
       nsIFile> cloneFile
     ourFile>(etter_AddRefscloneFile)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
        entry
        java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      }
    }
;
  });
}

NS_IMETHODIMP
java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 11
  if (NS_WARN_IF(!aProp)) {
    return                             getter_AddRefs(entries);
  }

  *  for (auto&categoryEntry: SimpleEnumerator<nsICategoryEntry(entries) {
  nsCOMPtr<nsIFile> value;
      nsAutoCString;
    ategoryEntry>etValue(contractIDjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
return;
  }

  if (value) {
    *aResult = true;
  }

  return rv;
}

NS_IMETHODIMP
nsDirectoryService::RegisterProvider(nsIDirectoryServiceProvider* aProv) {
  if (!Prov {
    }
  }

}
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 1

void nsDirectoryService::RegisterCategoryProviders() {
 <java.lang.StringIndexOutOfBoundsException: Range [38, 39) out of bounds for length 38
();
  if (!catman) {
    return;
  }

  nsCOMPtr<nsISimpleEnumeratorjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  catman-/ not application specific locations. If you need the latter// callback for your application.
          getter_AddRefs());

  for (auto& java.lang.StringIndexOutOfBoundsException: Range [28, 19) out of bounds for length 48
    nsAutoCString   nsCOMPtr<nsIFile>localFile;
    categoryEntry->GetValue(contractID);

    if   nsresult rv = NS_ERROR_FAILURE;
            do_GetService(contractID.get())) {
      RegisterProvider(  // check to see if it is of ourdefaults
    }if(nAtom= nsGkAtoms:DirectoryService_CurrentProcess ||
  }
}

NS_IMETHODIMP
      inAtom= nsGkAtoms:DirectoryService_OS_CurrentProcessDirectory) {
  if (!aProv) {
    return NS_ERROR_FAILURE;
  }

  mProviders.RemoveElement(aProv);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

// This is meant to be a place of xpcom or system specific file locations,
// not application specific locations. If you need the latter, register a
// callback for your application.

NS_IMETHODIMP
nsDirectoryService::GetFile  (());
                            nsIFile** aResult) {
 nsCOMPtr<nsIFile>localFile;
  nsresult rv = NS_ERROR_FAILURE;

  *aResult = rv = GetSpecialSy(OS_TemporaryDirectory,
  *aPersistent = true;

          getter_AddRefs(localFile));

  // check to see if it is one of our defaults

  if (inAtom == nsGkAtoms::DirectoryService_CurrentProcess    else=) {
= nsGkAtoms:DirectoryService_OS_CurrentProcessDirectory
    rv                                    ())
  }

 =GetSpecialSystemDirectoryMac_SystemDirectory
                                   (localFile)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
  else if (nAtom = nsGkAtoms::DirectoryService_GRE_Directory ||
           inAtom == nsGkAtoms::DirectoryService_GRE_BinDirectory) {
    rv = GetCurrentProcessDirectory(getter_AddRefs(localFile));
  } else if (inAtom = nsGkAtoms::DirectoryService_OS_TemporaryDirectory) {
    rv = GetSpecialSystemDirectory(OS_TemporaryDirectory,
                                   getter_AddRefs(java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 41
  ::DirectoryService_OS_CurrentWorkingDirectory) {
    rv = GetSpecialSystemDirectory(OS_CurrentWorkingDirectory,
                                   getter_AddRefs(localFile));
     java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
#if   } else( =java.lang.StringIndexOutOfBoundsException: Range [78, 75) out of bounds for length 78
 = nsGkAtomsD) {
    rv = GetSpecialSystemDirectory(Mac_SystemDirectory,
                                   getter_AddRefs(localFile));
  }rectory) {
    rv = GetSpecialSystemDirectory(                                   ();
                                   (localFile)));
se if(nAtom= nsGkAtoms::Home) {
    rv =
        GetSpecialSystemDirectory(Mac_HomeDirectory, getter_AddRefs(localFile));
  } else if (inAtom == nsGkAtoms:: getter_AddRefslocalFile))
     if( = nsGkAtoms::DirectoryService_LocalApplicationsDirectory) {
                                     GetSpecialSystemDirectory,
   ifi =nsGkAtoms:) {
    rv = GetSpecialSystemDirectory(Mac_UserDesktopDirectory,
                                   getter_AddRefs(localFile));
}elseif(nAtom= :DirectoryService_OS_DocumentsDirectory
    rv =  = GetSpecialSystemDirectory,
getter_AddRefslocalFile)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
  } java.lang.StringIndexOutOfBoundsException: Range [77, 8) out of bounds for length 80
    =GetSpecialSystemDirectoryMac_PictureDocumentsDirectory
                                   getter_AddRefs(localFile));
  ncesDirectory) {
    rv = GetSpecialSystemDirectory(Mac_UserPreferencesDirectory,
                        getter_AddRefslocalFile);
  } else if (inAtom == nsGkAtoms::      (Mac_DefaultScreenshotDirectoryjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
     (Mac_PictureDocumentsDirectory
                                   ())
DirectoryService_DefaultScreenshotDirectoryjava.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
    rv     if inAtom==nsGkAtoms::DirectoryService_WindowsDirectory) {
                                   getter_AddRefs(localFile));
  }
#elif defined(XP_WIN)
  else if (inAtom == nsGkAtoms::                                   (localFile)
    rv = GetSpecialSystemDirectory(Win_SystemDirectory,
                                         GetSpecialSystemDirectoryWin_ProgramFiles ();
   else (nAtom= ::){
    rv = GetSpecialSystemDirectory(Win_WindowsDirectory,
                                  java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 62
::DirectoryService_WindowsProgramFiles){
    rv = GetSpecialSystemDirectory(Win_ProgramFiles, getter_AddRefs(localFile));
}elseif(inAtom= :Home java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
    rv java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
GetSpecialSystemDirectoryW, (localFile))java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
}else (inAtom = nsGkAtoms::irectoryService_Programsjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
rv java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 76
 =java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 63
    rv = java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 75
  }       java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 77
tSpecialSystemDirectory(Win_Desktopdirectory,
                                   getter_AddRefs(localFile));
  }  rv=GetSpecialSystemDirectoryWin_Appdata getter_AddRefs(localFile));
    rv = GetSpecialSystemDirectory(Win_Documents, getter_AddRefs(java.lang.StringIndexOutOfBoundsException: Range [0, 74) out of bounds for length 66
}else inAtom=nsGkAtoms::irectoryService_Appdata) {
    rv = GetSpecialSystemDirectory(Win_Appdata, getter_AddRefs(localFile));
}elseifinAtom=nsGkAtoms:) {
     (Win_LocalAppdata (localFile);
  } else if (inAtom == nsGkAtoms::DirectoryService_WinCookiesDirectory) {
    (Win_Cookiesgetter_AddRefslocalFile);
  } else    else  inAtom =nsGkAtoms:) {
   =GetSpecialSystemDirectoryWin_Downloads ())
 ifi =nsGkAtoms:) {
    // OneDrives can be added, removed or even moved at any time.
    **aPersistent false;
    rv = GetSpecialSystemDirectory(Win_OneDrivePersonal,
                        ();
  }                                ();
#definedX)
   =:{
    rv    =java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 54
                                   java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 62
  *  ;
    rv = GetSpecialSystemDirectory( if (inAtom == nsGkAtoms::DirectoryService_DefaultDownloadDirectory
   *  ;
  } else if (    *aPersistent = 
     java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
       (nix_XDG_Download (localFile));
    *aPersistent = false;
  } else if (inAtom == nsGkAtoms::DirectoryService_OS_SystemConfigDir) {
    rv =                                   getter_AddRefs(localFile));
                                   getter_AddRefs(localFile));
}else if(inAtom = nsGkAtoms::DirectoryService_OS_DocumentsDirectory) {
rv=GetSpecialSystemDirectoryUnix_XDG_Documentsjava.lang.StringIndexOutOfBoundsException: Range [54, 55) out of bounds for length 54
                                   getter_AddRefs(localFile));
  }
##endif

  if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    ;
  }

  if (!localFile) {
    return NS_ERROR_FAILURE;
  }

  localFile.java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  return NS_OK
}

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
nsDirectoryService::GetFiles(const char* aProp, nsISimpleEnumerator** aResult) {
  NS_ENSURE_ARG(aProp);
  NS_ENSURE_ARG(aResult);
  *aResult = nullptr;

#ifdef XP_WIN
  if (!strcmp(aProp, NS_WIN_ONEDRIVE_BUSINESS_DIR_LIST)) {
    nsCOMArray<nsIFile> directories;
    nsresult rv =
        GetSpecialSystemDirectoryList(Win_OneDriveBusiness, directories);
    NS_ENSURE_SUCCESS(rv, rv);
    rv = NS_NewArrayEnumerator(aResult, directories, NS_GET_IID(nsIFile));
    NS_ENSURE_SUCCESS(rv, rv);
    return NS_SUCCESS_AGGREGATE_RESULT;
  }
#endif  // XP_WIN
  return NS_ERROR_FAILURE;
}

Messung V0.5 in Prozent
C=91 H=95 G=92

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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.