forked from mirrors/gecko-dev
Bug 1940027 - Use nsACString in jar code a=dmeehan
Differential Revision: https://phabricator.services.mozilla.com/D237704
This commit is contained in:
parent
9e1c0c56f8
commit
7ab72cf96a
14 changed files with 64 additions and 60 deletions
|
|
@ -4165,7 +4165,7 @@ nsresult ArrayBufferBuilder::MapToFileInPackage(const nsCString& aFile,
|
|||
if (!zip) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsZipItem* zipItem = zip->GetItem(aFile.get());
|
||||
nsZipItem* zipItem = zip->GetItem(aFile);
|
||||
if (!zipItem) {
|
||||
return NS_ERROR_FILE_NOT_FOUND;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ already_AddRefed<SharedFTFace> FT2FontEntry::GetFTFace(bool aCommit) {
|
|||
RefPtr<SharedFTFace> face;
|
||||
if (mFilename[0] != '/') {
|
||||
RefPtr<nsZipArchive> reader = Omnijar::GetReader(Omnijar::Type::GRE);
|
||||
nsZipItem* item = reader->GetItem(mFilename.get());
|
||||
nsZipItem* item = reader->GetItem(mFilename);
|
||||
NS_ASSERTION(item, "failed to find zip entry");
|
||||
|
||||
uint32_t bufSize = item->RealSize();
|
||||
|
|
@ -468,7 +468,7 @@ hb_face_t* FT2FontEntry::CreateHBFace() const {
|
|||
// A relative path means an omnijar resource, which we may need to
|
||||
// decompress to a temporary buffer.
|
||||
RefPtr<nsZipArchive> reader = Omnijar::GetReader(Omnijar::Type::GRE);
|
||||
nsZipItem* item = reader->GetItem(mFilename.get());
|
||||
nsZipItem* item = reader->GetItem(mFilename);
|
||||
MOZ_ASSERT(item, "failed to find zip entry");
|
||||
if (item) {
|
||||
// TODO(jfkthame):
|
||||
|
|
@ -1507,7 +1507,7 @@ void gfxFT2FontList::AppendFacesFromOmnijarEntry(nsZipArchive* aArchive,
|
|||
}
|
||||
}
|
||||
|
||||
nsZipItem* item = aArchive->GetItem(aEntryName.get());
|
||||
nsZipItem* item = aArchive->GetItem(aEntryName);
|
||||
NS_ASSERTION(item, "failed to find zip entry");
|
||||
|
||||
uint32_t bufSize = item->RealSize();
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ static const void* GetItemPtrFromJarURI(nsIJARURI* aJAR, uint32_t* aLength) {
|
|||
if (archive) {
|
||||
nsCString path;
|
||||
aJAR->GetJAREntry(path);
|
||||
nsZipItem* item = archive->GetItem(path.get());
|
||||
nsZipItem* item = archive->GetItem(path);
|
||||
if (item && item->Compression() == 0 && item->Size() > 0) {
|
||||
// We do NOT own this data, but it won't go away until the omnijar
|
||||
// file is closed during shutdown.
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ static bool GetGREFileContents(const char* aFilePath, nsCString* aOutString) {
|
|||
// Look for the requested file in omnijar.
|
||||
RefPtr<nsZipArchive> zip = Omnijar::GetReader(Omnijar::GRE);
|
||||
if (zip) {
|
||||
nsZipItemPtr<char> item(zip, aFilePath);
|
||||
nsZipItemPtr<char> item(zip, nsDependentCString(aFilePath));
|
||||
if (!item) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -402,7 +402,7 @@ void URLPreloader::BackgroundReadFiles() {
|
|||
entry->TypeString(), entry->mPath.get());
|
||||
}
|
||||
|
||||
auto item = zip->GetItem(entry->mPath.get());
|
||||
auto item = zip->GetItem(entry->mPath);
|
||||
if (!item) {
|
||||
entry->mResultCode = NS_ERROR_FILE_NOT_FOUND;
|
||||
continue;
|
||||
|
|
@ -567,7 +567,7 @@ Result<nsCString, nsresult> URLPreloader::ReadURIInternal(nsIURI* uri,
|
|||
}
|
||||
|
||||
// Not an Omnijar archive, so just read it directly.
|
||||
FileLocation location(zip, PromiseFlatCString(path).BeginReading());
|
||||
FileLocation location(zip, path);
|
||||
return URLEntry::ReadLocation(location);
|
||||
}
|
||||
|
||||
|
|
@ -636,7 +636,7 @@ Result<FileLocation, nsresult> URLPreloader::CacheKey::ToFileLocation() {
|
|||
}
|
||||
|
||||
RefPtr<nsZipArchive> zip = Archive();
|
||||
return FileLocation(zip, mPath.get());
|
||||
return FileLocation(zip, mPath);
|
||||
}
|
||||
|
||||
Result<nsCString, nsresult> URLPreloader::URLEntry::Read() {
|
||||
|
|
|
|||
|
|
@ -135,8 +135,7 @@ nsJAR::OpenInner(nsIZipReader* aZipReader, const nsACString& aZipEntry) {
|
|||
{
|
||||
nsJAR* outerJAR = static_cast<nsJAR*>(aZipReader);
|
||||
RecursiveMutexAutoLock outerLock(outerJAR->mLock);
|
||||
rv = nsZipHandle::Init(outerJAR->mZip.get(),
|
||||
PromiseFlatCString(aZipEntry).get(),
|
||||
rv = nsZipHandle::Init(outerJAR->mZip.get(), aZipEntry,
|
||||
getter_AddRefs(handle));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
|
@ -191,8 +190,7 @@ nsJAR::Test(const nsACString& aEntryName) {
|
|||
if (!mZip) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
return mZip->Test(
|
||||
aEntryName.IsEmpty() ? nullptr : PromiseFlatCString(aEntryName).get());
|
||||
return mZip->Test(aEntryName);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
@ -205,7 +203,7 @@ nsJAR::Extract(const nsACString& aEntryName, nsIFile* outFile) {
|
|||
}
|
||||
|
||||
LOG(("Extract[%p] %s", this, PromiseFlatCString(aEntryName).get()));
|
||||
nsZipItem* item = mZip->GetItem(PromiseFlatCString(aEntryName).get());
|
||||
nsZipItem* item = mZip->GetItem(aEntryName);
|
||||
NS_ENSURE_TRUE(item, NS_ERROR_FILE_NOT_FOUND);
|
||||
|
||||
// Remove existing file or directory so we set permissions correctly.
|
||||
|
|
@ -245,7 +243,7 @@ nsJAR::GetEntry(const nsACString& aEntryName, nsIZipEntry** result) {
|
|||
if (!mZip) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsZipItem* zipItem = mZip->GetItem(PromiseFlatCString(aEntryName).get());
|
||||
nsZipItem* zipItem = mZip->GetItem(aEntryName);
|
||||
NS_ENSURE_TRUE(zipItem, NS_ERROR_FILE_NOT_FOUND);
|
||||
|
||||
nsJARItem* jarItem = new nsJARItem(zipItem);
|
||||
|
|
@ -261,7 +259,7 @@ nsJAR::HasEntry(const nsACString& aEntryName, bool* result) {
|
|||
if (!mZip) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
*result = mZip->GetItem(PromiseFlatCString(aEntryName).get()) != nullptr;
|
||||
*result = mZip->GetItem(aEntryName) != nullptr;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
@ -300,7 +298,7 @@ nsJAR::GetInputStream(const nsACString& aEntryName, nsIInputStream** result) {
|
|||
const nsCString& entry = PromiseFlatCString(aEntryName);
|
||||
if (*entry.get()) {
|
||||
// First check if item exists in jar
|
||||
item = mZip->GetItem(entry.get());
|
||||
item = mZip->GetItem(entry);
|
||||
if (!item) return NS_ERROR_FILE_NOT_FOUND;
|
||||
}
|
||||
nsJARInputStream* jis = new nsJARInputStream();
|
||||
|
|
|
|||
|
|
@ -342,7 +342,8 @@ nsresult nsJARInputStream::ReadDirectory(char* aBuffer, uint32_t aCount,
|
|||
|
||||
const char* entryName = mArray[mArrPos].get();
|
||||
uint32_t entryNameLen = mArray[mArrPos].Length();
|
||||
nsZipItem* ze = mJar->mZip->GetItem(entryName);
|
||||
nsZipItem* ze = mJar->mZip->GetItem(
|
||||
nsDependentCString(mArray[mArrPos].get(), mArray[mArrPos].Length()));
|
||||
NS_ENSURE_TRUE(ze, NS_ERROR_FILE_NOT_FOUND);
|
||||
|
||||
// Last Modified Time
|
||||
|
|
|
|||
|
|
@ -237,12 +237,12 @@ nsresult nsZipHandle::Init(nsIFile* file, nsZipHandle** ret, PRFileDesc** aFd) {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsZipHandle::Init(nsZipArchive* zip, const char* entry,
|
||||
nsresult nsZipHandle::Init(nsZipArchive* zip, const nsACString& entry,
|
||||
nsZipHandle** ret) {
|
||||
RefPtr<nsZipHandle> handle = new nsZipHandle();
|
||||
if (!handle) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
LOG(("ZipHandle::Init entry %s", entry));
|
||||
LOG(("ZipHandle::Init entry %s", PromiseFlatCString(entry).get()));
|
||||
|
||||
nsZipItem* item = zip->GetItem(entry);
|
||||
if (item && item->Compression() == DEFLATED &&
|
||||
|
|
@ -414,10 +414,10 @@ already_AddRefed<nsZipArchive> nsZipArchive::OpenArchive(nsIFile* aFile) {
|
|||
//---------------------------------------------
|
||||
// nsZipArchive::Test
|
||||
//---------------------------------------------
|
||||
nsresult nsZipArchive::Test(const char* aEntryName) {
|
||||
nsresult nsZipArchive::Test(const nsACString& aEntryName) {
|
||||
nsZipItem* currItem;
|
||||
|
||||
if (aEntryName) // only test specified item
|
||||
if (aEntryName.Length()) // only test specified item
|
||||
{
|
||||
currItem = GetItem(aEntryName);
|
||||
if (!currItem) return NS_ERROR_FILE_NOT_FOUND;
|
||||
|
|
@ -442,12 +442,13 @@ nsresult nsZipArchive::Test(const char* aEntryName) {
|
|||
//---------------------------------------------
|
||||
// nsZipArchive::GetItem
|
||||
//---------------------------------------------
|
||||
nsZipItem* nsZipArchive::GetItem(const char* aEntryName) {
|
||||
nsZipItem* nsZipArchive::GetItem(const nsACString& aEntryName) {
|
||||
MutexAutoLock lock(mLock);
|
||||
|
||||
LOG(("ZipHandle::GetItem[%p] %s", this, aEntryName));
|
||||
if (aEntryName) {
|
||||
uint32_t len = strlen(aEntryName);
|
||||
LOG(("ZipHandle::GetItem[%p] %s", this,
|
||||
PromiseFlatCString(aEntryName).get()));
|
||||
if (aEntryName.Length()) {
|
||||
uint32_t len = aEntryName.Length();
|
||||
//-- If the request is for a directory, make sure that synthetic entries
|
||||
//-- are created for the directories without their own entry.
|
||||
if (!mBuiltSynthetics) {
|
||||
|
|
@ -456,14 +457,14 @@ nsZipItem* nsZipArchive::GetItem(const char* aEntryName) {
|
|||
}
|
||||
}
|
||||
MMAP_FAULT_HANDLER_BEGIN_HANDLE(mFd)
|
||||
nsZipItem* item = mFiles[HashName(aEntryName, len)];
|
||||
nsZipItem* item = mFiles[HashName(aEntryName.BeginReading(), len)];
|
||||
while (item) {
|
||||
if ((len == item->nameLength) &&
|
||||
(!memcmp(aEntryName, item->Name(), len))) {
|
||||
(!memcmp(aEntryName.BeginReading(), item->Name(), len))) {
|
||||
// Successful GetItem() is a good indicator that the file is about to be
|
||||
// read
|
||||
if (mUseZipLog && mURI.Length()) {
|
||||
zipLog.Write(mURI, aEntryName);
|
||||
zipLog.Write(mURI, aEntryName.BeginReading());
|
||||
}
|
||||
return item; //-- found it
|
||||
}
|
||||
|
|
@ -1202,8 +1203,8 @@ uint8_t* nsZipCursor::ReadOrCopy(uint32_t* aBytesRead, bool aCopy) {
|
|||
return buf;
|
||||
}
|
||||
|
||||
nsZipItemPtr_base::nsZipItemPtr_base(nsZipArchive* aZip, const char* aEntryName,
|
||||
bool doCRC)
|
||||
nsZipItemPtr_base::nsZipItemPtr_base(nsZipArchive* aZip,
|
||||
const nsACString& aEntryName, bool doCRC)
|
||||
: mReturnBuf(nullptr), mReadlen(0) {
|
||||
// make sure the ziparchive hangs around
|
||||
mZipHandle = aZip->GetFD();
|
||||
|
|
|
|||
|
|
@ -116,14 +116,14 @@ class nsZipArchive final {
|
|||
*
|
||||
* @return status code
|
||||
*/
|
||||
nsresult Test(const char* aEntryName);
|
||||
nsresult Test(const nsACString& aEntryName);
|
||||
|
||||
/**
|
||||
* GetItem
|
||||
* @param aEntryName Name of file in the archive
|
||||
* @return pointer to nsZipItem
|
||||
*/
|
||||
nsZipItem* GetItem(const char* aEntryName);
|
||||
nsZipItem* GetItem(const nsACString& aEntryName);
|
||||
|
||||
/**
|
||||
* ExtractFile
|
||||
|
|
@ -303,7 +303,8 @@ class nsZipItemPtr_base {
|
|||
* @param aEntryName Archive membername
|
||||
* @param doCRC When set to true Read() will check crc
|
||||
*/
|
||||
nsZipItemPtr_base(nsZipArchive* aZip, const char* aEntryName, bool doCRC);
|
||||
nsZipItemPtr_base(nsZipArchive* aZip, const nsACString& aEntryName,
|
||||
bool doCRC);
|
||||
|
||||
uint32_t Length() const { return mReadlen; }
|
||||
|
||||
|
|
@ -321,7 +322,8 @@ class nsZipItemPtr final : public nsZipItemPtr_base {
|
|||
" a number of assumptions.");
|
||||
|
||||
public:
|
||||
nsZipItemPtr(nsZipArchive* aZip, const char* aEntryName, bool doCRC = false)
|
||||
nsZipItemPtr(nsZipArchive* aZip, const nsACString& aEntryName,
|
||||
bool doCRC = false)
|
||||
: nsZipItemPtr_base(aZip, aEntryName, doCRC) {}
|
||||
/**
|
||||
* @return buffer containing the whole zip member or nullptr on error.
|
||||
|
|
@ -363,7 +365,8 @@ class nsZipHandle final {
|
|||
public:
|
||||
static nsresult Init(nsIFile* file, nsZipHandle** ret,
|
||||
PRFileDesc** aFd = nullptr);
|
||||
static nsresult Init(nsZipArchive* zip, const char* entry, nsZipHandle** ret);
|
||||
static nsresult Init(nsZipArchive* zip, const nsACString& entry,
|
||||
nsZipHandle** ret);
|
||||
static nsresult Init(const uint8_t* aData, uint32_t aLen, nsZipHandle** aRet);
|
||||
|
||||
NS_METHOD_(MozExternalRefCountType) AddRef(void);
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ static Result<FileLocation, nsresult> GetFileLocation(nsIURI* uri) {
|
|||
|
||||
MOZ_TRY_VAR(file, GetFile(fileURI));
|
||||
|
||||
location.Init(file, entry.get());
|
||||
location.Init(file, entry);
|
||||
}
|
||||
|
||||
return std::move(location);
|
||||
|
|
|
|||
|
|
@ -18,11 +18,11 @@ FileLocation::~FileLocation() = default;
|
|||
|
||||
FileLocation::FileLocation(nsIFile* aFile) { Init(aFile); }
|
||||
|
||||
FileLocation::FileLocation(nsIFile* aFile, const char* aPath) {
|
||||
FileLocation::FileLocation(nsIFile* aFile, const nsACString& aPath) {
|
||||
Init(aFile, aPath);
|
||||
}
|
||||
|
||||
FileLocation::FileLocation(nsZipArchive* aZip, const char* aPath) {
|
||||
FileLocation::FileLocation(nsZipArchive* aZip, const nsACString& aPath) {
|
||||
Init(aZip, aPath);
|
||||
}
|
||||
|
||||
|
|
@ -37,14 +37,14 @@ FileLocation::FileLocation(FileLocation&& aOther)
|
|||
aOther.mPath.Truncate();
|
||||
}
|
||||
|
||||
FileLocation::FileLocation(const FileLocation& aFile, const char* aPath) {
|
||||
FileLocation::FileLocation(const FileLocation& aFile, const nsACString& aPath) {
|
||||
if (aFile.IsZip()) {
|
||||
if (aFile.mBaseFile) {
|
||||
Init(aFile.mBaseFile, aFile.mPath.get());
|
||||
Init(aFile.mBaseFile, aFile.mPath);
|
||||
} else {
|
||||
Init(aFile.mBaseZip, aFile.mPath.get());
|
||||
Init(aFile.mBaseZip, aFile.mPath);
|
||||
}
|
||||
if (aPath) {
|
||||
if (aPath.Length()) {
|
||||
int32_t i = mPath.RFindChar('/');
|
||||
if (kNotFound == i) {
|
||||
mPath.Truncate(0);
|
||||
|
|
@ -54,7 +54,7 @@ FileLocation::FileLocation(const FileLocation& aFile, const char* aPath) {
|
|||
mPath += aPath;
|
||||
}
|
||||
} else {
|
||||
if (aPath) {
|
||||
if (aPath.Length()) {
|
||||
nsCOMPtr<nsIFile> cfile;
|
||||
aFile.mBaseFile->GetParent(getter_AddRefs(cfile));
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ FileLocation::FileLocation(const FileLocation& aFile, const char* aPath) {
|
|||
}
|
||||
cfile->AppendRelativeNativePath(pathStr);
|
||||
#else
|
||||
cfile->AppendRelativeNativePath(nsDependentCString(aPath));
|
||||
cfile->AppendRelativeNativePath(aPath);
|
||||
#endif
|
||||
Init(cfile);
|
||||
} else {
|
||||
|
|
@ -84,13 +84,13 @@ void FileLocation::Init(nsIFile* aFile) {
|
|||
mPath.Truncate();
|
||||
}
|
||||
|
||||
void FileLocation::Init(nsIFile* aFile, const char* aPath) {
|
||||
void FileLocation::Init(nsIFile* aFile, const nsACString& aPath) {
|
||||
mBaseZip = nullptr;
|
||||
mBaseFile = aFile;
|
||||
mPath = aPath;
|
||||
}
|
||||
|
||||
void FileLocation::Init(nsZipArchive* aZip, const char* aPath) {
|
||||
void FileLocation::Init(nsZipArchive* aZip, const nsACString& aPath) {
|
||||
mBaseZip = aZip;
|
||||
mBaseFile = nullptr;
|
||||
mPath = aPath;
|
||||
|
|
@ -158,7 +158,7 @@ nsresult FileLocation::GetData(Data& aData) {
|
|||
aData.mZip = nsZipArchive::OpenArchive(mBaseFile);
|
||||
}
|
||||
if (aData.mZip) {
|
||||
aData.mItem = aData.mZip->GetItem(mPath.get());
|
||||
aData.mItem = aData.mZip->GetItem(mPath);
|
||||
if (aData.mItem) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,23 +47,23 @@ class FileLocation {
|
|||
* Constructors for path within an archive. The archive can be given either
|
||||
* as nsIFile or nsZipArchive.
|
||||
*/
|
||||
FileLocation(nsIFile* aZip, const char* aPath);
|
||||
FileLocation(nsIFile* aZip, const nsACString& aPath);
|
||||
|
||||
FileLocation(nsZipArchive* aZip, const char* aPath);
|
||||
FileLocation(nsZipArchive* aZip, const nsACString& aPath);
|
||||
|
||||
/**
|
||||
* Creates a new file location relative to another one.
|
||||
*/
|
||||
FileLocation(const FileLocation& aFile, const char* aPath);
|
||||
FileLocation(const FileLocation& aFile, const nsACString& aPath);
|
||||
|
||||
/**
|
||||
* Initialization functions corresponding to constructors
|
||||
*/
|
||||
void Init(nsIFile* aFile);
|
||||
|
||||
void Init(nsIFile* aZip, const char* aPath);
|
||||
void Init(nsIFile* aZip, const nsACString& aPath);
|
||||
|
||||
void Init(nsZipArchive* aZip, const char* aPath);
|
||||
void Init(nsZipArchive* aZip, const nsACString& aPath);
|
||||
|
||||
/**
|
||||
* Returns an URI string corresponding to the file location
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ void Omnijar::CleanUpOne(Type aType) {
|
|||
}
|
||||
|
||||
void Omnijar::InitOne(nsIFile* aPath, Type aType) {
|
||||
constexpr auto kOmnijarName = nsLiteralCString{MOZ_STRINGIFY(OMNIJAR_NAME)};
|
||||
nsCOMPtr<nsIFile> file;
|
||||
if (aPath) {
|
||||
file = aPath;
|
||||
|
|
@ -83,8 +84,8 @@ void Omnijar::InitOne(nsIFile* aPath, Type aType) {
|
|||
|
||||
RefPtr<nsZipArchive> outerReader;
|
||||
RefPtr<nsZipHandle> handle;
|
||||
if (NS_SUCCEEDED(nsZipHandle::Init(zipReader, MOZ_STRINGIFY(OMNIJAR_NAME),
|
||||
getter_AddRefs(handle)))) {
|
||||
if (NS_SUCCEEDED(
|
||||
nsZipHandle::Init(zipReader, kOmnijarName, getter_AddRefs(handle)))) {
|
||||
outerReader = zipReader;
|
||||
zipReader = nsZipArchive::OpenArchive(handle);
|
||||
if (!zipReader) {
|
||||
|
|
|
|||
|
|
@ -399,7 +399,7 @@ nsresult nsComponentManagerImpl::Init() {
|
|||
RefPtr<nsZipArchive> greOmnijar =
|
||||
mozilla::Omnijar::GetReader(mozilla::Omnijar::GRE);
|
||||
if (greOmnijar) {
|
||||
cl->location.Init(greOmnijar, "chrome.manifest");
|
||||
cl->location.Init(greOmnijar, "chrome.manifest"_ns);
|
||||
} else {
|
||||
nsCOMPtr<nsIFile> lf = CloneAndAppend(greDir, "chrome.manifest"_ns);
|
||||
cl->location.Init(lf);
|
||||
|
|
@ -410,7 +410,7 @@ nsresult nsComponentManagerImpl::Init() {
|
|||
if (appOmnijar) {
|
||||
cl = sModuleLocations->AppendElement();
|
||||
cl->type = NS_APP_LOCATION;
|
||||
cl->location.Init(appOmnijar, "chrome.manifest");
|
||||
cl->location.Init(appOmnijar, "chrome.manifest"_ns);
|
||||
} else {
|
||||
bool equals = false;
|
||||
appDir->Equals(greDir, &equals);
|
||||
|
|
@ -524,7 +524,7 @@ void nsComponentManagerImpl::RegisterManifest(NSLocationType aType,
|
|||
void nsComponentManagerImpl::ManifestManifest(ManifestProcessingContext& aCx,
|
||||
int aLineNo, char* const* aArgv) {
|
||||
char* file = aArgv[0];
|
||||
FileLocation f(aCx.mFile, file);
|
||||
FileLocation f(aCx.mFile, nsDependentCString(file));
|
||||
RegisterManifest(aCx.mType, f, aCx.mChromeOnly);
|
||||
}
|
||||
|
||||
|
|
@ -1458,7 +1458,7 @@ nsComponentManagerImpl::RemoveBootstrappedManifestLocation(nsIFile* aLocation) {
|
|||
elem.type = NS_BOOTSTRAPPED_LOCATION;
|
||||
|
||||
if (Substring(path, path.Length() - 4).EqualsLiteral(".xpi")) {
|
||||
elem.location.Init(aLocation, "chrome.manifest");
|
||||
elem.location.Init(aLocation, "chrome.manifest"_ns);
|
||||
} else {
|
||||
nsCOMPtr<nsIFile> lf = CloneAndAppend(aLocation, "chrome.manifest"_ns);
|
||||
elem.location.Init(lf);
|
||||
|
|
@ -1541,7 +1541,7 @@ XRE_AddJarManifestLocation(NSLocationType aType, nsIFile* aLocation) {
|
|||
nsComponentManagerImpl::sModuleLocations->AppendElement();
|
||||
|
||||
c->type = aType;
|
||||
c->location.Init(aLocation, "chrome.manifest");
|
||||
c->location.Init(aLocation, "chrome.manifest"_ns);
|
||||
|
||||
if (nsComponentManagerImpl::gComponentManager &&
|
||||
nsComponentManagerImpl::NORMAL ==
|
||||
|
|
|
|||
Loading…
Reference in a new issue