summaryrefslogtreecommitdiff
path: root/xpcom
diff options
context:
space:
mode:
Diffstat (limited to 'xpcom')
-rw-r--r--xpcom/base/nsDumpUtils.cpp4
-rw-r--r--xpcom/build/LateWriteChecks.cpp15
-rw-r--r--xpcom/build/XPCOMInit.cpp6
-rw-r--r--xpcom/components/nsNativeModuleLoader.cpp6
-rw-r--r--xpcom/io/nsLocalFileWin.cpp6
5 files changed, 29 insertions, 8 deletions
diff --git a/xpcom/base/nsDumpUtils.cpp b/xpcom/base/nsDumpUtils.cpp
index 1333fdb63f..df71bde10b 100644
--- a/xpcom/base/nsDumpUtils.cpp
+++ b/xpcom/base/nsDumpUtils.cpp
@@ -324,7 +324,11 @@ FifoWatcher::OpenFd()
}
nsAutoCString path;
+#ifdef XP_WIN
+ rv = file->GetPersistentDescriptor(path);
+#else
rv = file->GetNativePath(path);
+#endif
if (NS_WARN_IF(NS_FAILED(rv))) {
return -1;
}
diff --git a/xpcom/build/LateWriteChecks.cpp b/xpcom/build/LateWriteChecks.cpp
index 7ace9a0fbd..218454c4d3 100644
--- a/xpcom/build/LateWriteChecks.cpp
+++ b/xpcom/build/LateWriteChecks.cpp
@@ -122,10 +122,17 @@ InitLateWriteChecks()
nsCOMPtr<nsIFile> mozFile;
NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(mozFile));
if (mozFile) {
- nsAutoCString nativePath;
- nsresult rv = mozFile->GetNativePath(nativePath);
- if (NS_SUCCEEDED(rv) && nativePath.get()) {
- sLateWriteObserver = new LateWriteObserver(nativePath.get());
+ nsAutoCString writeObserverPath;
+#ifdef XP_WIN
+ nsAutoString U16Path;
+ nsresult rv = mozFile->GetPath(U16Path);
+ CopyUTF16toUTF8(U16Path, writeObserverPath);
+#else
+ // On non-Windows just get the native path.
+ nsresult rv = mozFile->GetNativePath(writeObserverPath);
+#endif
+ if (NS_SUCCEEDED(rv) && writeObserverPath.get()) {
+ sLateWriteObserver = new LateWriteObserver(writeObserverPath.get());
}
}
}
diff --git a/xpcom/build/XPCOMInit.cpp b/xpcom/build/XPCOMInit.cpp
index 185a823155..835f250da1 100644
--- a/xpcom/build/XPCOMInit.cpp
+++ b/xpcom/build/XPCOMInit.cpp
@@ -688,9 +688,13 @@ NS_InitXPCOM2(nsIServiceManager** aResult,
getter_AddRefs(greDir));
MOZ_ASSERT(greDir);
nsAutoCString nativeGREPath;
+#ifdef XP_WIN
+ greDir->GetPersistentDescriptor(nativeGREPath);
+#else
greDir->GetNativePath(nativeGREPath);
- u_setDataDirectory(nativeGREPath.get());
#endif
+ u_setDataDirectory(nativeGREPath.get());
+#endif // MOZ_ICU_DATA_ARCHIVE
// Initialize the JS engine.
const char* jsInitFailureReason = JS_InitWithFailureDiagnostic();
diff --git a/xpcom/components/nsNativeModuleLoader.cpp b/xpcom/components/nsNativeModuleLoader.cpp
index bec3a11757..42e322be1b 100644
--- a/xpcom/components/nsNativeModuleLoader.cpp
+++ b/xpcom/components/nsNativeModuleLoader.cpp
@@ -104,7 +104,13 @@ nsNativeModuleLoader::LoadModule(FileLocation& aFile)
}
nsAutoCString filePath;
+#ifdef XP_WIN
+ nsAutoString filePathW;
+ file->GetPath(filePathW);
+ CopyUTF16toUTF8(filePathW, filePath);
+#else
file->GetNativePath(filePath);
+#endif
NativeLoadData data;
diff --git a/xpcom/io/nsLocalFileWin.cpp b/xpcom/io/nsLocalFileWin.cpp
index 2ff05666b1..db1d646bf2 100644
--- a/xpcom/io/nsLocalFileWin.cpp
+++ b/xpcom/io/nsLocalFileWin.cpp
@@ -3564,7 +3564,7 @@ nsLocalFile::SetNativeLeafName(const nsACString& aLeafName)
NS_IMETHODIMP
nsLocalFile::GetNativePath(nsACString& aResult)
{
- //NS_WARNING("This API is lossy. Use GetPath !");
+ NS_WARNING("The GetNativePath API is lossy. Use GetPath!");
nsAutoString tmp;
nsresult rv = GetPath(tmp);
if (NS_SUCCEEDED(rv)) {
@@ -3578,7 +3578,7 @@ nsLocalFile::GetNativePath(nsACString& aResult)
NS_IMETHODIMP
nsLocalFile::GetNativeCanonicalPath(nsACString& aResult)
{
- NS_WARNING("This method is lossy. Use GetCanonicalPath !");
+ NS_WARNING("This method is lossy. Use GetCanonicalPath!");
EnsureShortPath();
NS_CopyUnicodeToNative(mShortWorkingPath, aResult);
return NS_OK;
@@ -3646,7 +3646,7 @@ nsLocalFile::GetNativeTarget(nsACString& aResult)
// Check we are correctly initialized.
CHECK_mWorkingPath();
- NS_WARNING("This API is lossy. Use GetTarget !");
+ NS_WARNING("This API is lossy. Use GetTarget!");
nsAutoString tmp;
nsresult rv = GetTarget(tmp);
if (NS_SUCCEEDED(rv)) {