Bug 685236 - Stop using GetNativePath in PSM. r=keeler

GetPersistentDescriptor is good enough for logging purpose.

MozReview-Commit-ID: DmyW4lT5rT7

--HG--
extra : source : 3d2894427488acc3f9825e6ec4297b35ccbd44f1
extra : intermediate-source : 584662fbeb69351ab4e96afe2ed332916696b130
This commit is contained in:
Masatoshi Kimura 2017-12-17 01:24:44 +09:00
parent 526dc874b1
commit 7783cc27f6
2 changed files with 24 additions and 1 deletions

View File

@ -187,7 +187,7 @@ CertBlocklist::Init()
return rv;
}
nsAutoCString path;
rv = mBackingFile->GetNativePath(path);
rv = mBackingFile->GetPersistentDescriptor(path);
if (NS_FAILED(rv)) {
return rv;
}

View File

@ -33,6 +33,7 @@
#include "nsDirectoryServiceDefs.h"
#include "nsICertOverrideService.h"
#include "nsIFile.h"
#include "nsILocalFileWin.h"
#include "nsIObserverService.h"
#include "nsIPrompt.h"
#include "nsIProperties.h"
@ -1210,7 +1211,18 @@ GetNSS3Directory(nsCString& result)
MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("couldn't get parent directory?"));
return rv;
}
#ifdef XP_WIN
// Native path will drop Unicode characters that cannot be mapped to system's
// codepage, using short (canonical) path as workaround.
nsCOMPtr<nsILocalFileWin> nss3DirectoryWin = do_QueryInterface(nss3Directory);
if (NS_FAILED(rv)) {
MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("couldn't get nsILocalFileWin"));
return rv;
}
return nss3DirectoryWin->GetNativeCanonicalPath(result);
#else
return nss3Directory->GetNativePath(result);
#endif
}
// Returns by reference the path to the desired directory, based on the current
@ -1232,7 +1244,18 @@ GetDirectoryPath(const char* directoryKey, nsCString& result)
("could not get '%s' from directory service", directoryKey));
return rv;
}
#ifdef XP_WIN
// Native path will drop Unicode characters that cannot be mapped to system's
// codepage, using short (canonical) path as workaround.
nsCOMPtr<nsILocalFileWin> directoryWin = do_QueryInterface(directory);
if (NS_FAILED(rv)) {
MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("couldn't get nsILocalFileWin"));
return rv;
}
return directoryWin->GetNativeCanonicalPath(result);
#else
return directory->GetNativePath(result);
#endif
}