diff options
author | Stephen Pohl <spohl.mozilla.bugs@gmail.com> | 2014-09-29 11:51:04 -0700 |
---|---|---|
committer | Steven Schlansker <sschlansker@opentable.com> | 2016-09-13 17:34:53 -0700 |
commit | 2755ccf46ae0beec084ca0215d3c046cfff5ceb7 (patch) | |
tree | a279d38608a80fd96521cc74129c0e0b360b8279 | |
parent | d79459b7f52528f477c84469449d50550abea26f (diff) | |
download | palemoon-gre-2755ccf46ae0beec084ca0215d3c046cfff5ceb7.tar.gz |
Mac v2 signing - Bug 1050944 - Get Firefox to launch and run on OSX with the new .app bundle structure, made necessary by Apple's v2 signatures. r=smichaud, r=ted, sr=bsmedberg
-rw-r--r-- | browser/app/nsBrowserApp.cpp | 14 | ||||
-rw-r--r-- | ipc/glue/GoannaChildProcessHost.cpp | 6 | ||||
-rw-r--r-- | xpcom/build/XPCOMInit.cpp | 11 |
3 files changed, 29 insertions, 2 deletions
diff --git a/browser/app/nsBrowserApp.cpp b/browser/app/nsBrowserApp.cpp index e184e6283..f733d3b4b 100644 --- a/browser/app/nsBrowserApp.cpp +++ b/browser/app/nsBrowserApp.cpp @@ -52,6 +52,9 @@ using namespace mozilla; +#ifdef XP_MACOSX +#define kOSXResourcesFolder "Resources" +#endif #define kDesktopFolder "browser" #define kMetroFolder "metro" #define kMetroAppIniFilename "metroapp.ini" @@ -242,7 +245,12 @@ static int do_main(int argc, char* argv[], nsIFile *xreDirectory) nsCOMPtr<nsIFile> greDir; exeFile->GetParent(getter_AddRefs(greDir)); - +#ifdef XP_MACOSX + nsCOMPtr<nsIFile> parent; + greDir->GetParent(getter_AddRefs(parent)); + greDir = parent.forget(); + greDir->AppendNative(NS_LITERAL_CSTRING(kOSXResourcesFolder)); +#endif nsCOMPtr<nsIFile> appSubdir; greDir->Clone(getter_AddRefs(appSubdir)); appSubdir->Append(NS_LITERAL_STRING(kDesktopFolder)); @@ -386,6 +394,10 @@ InitXPCOMGlue(const char *argv0, nsIFile **xreDirectory) // chop XPCOM_DLL off exePath *lastSlash = '\0'; +#ifdef XP_MACOSX + lastSlash = strrchr(exePath, XPCOM_FILE_PATH_SEPARATOR[0]); + strcpy(lastSlash + 1, kOSXResourcesFolder); +#endif #ifdef XP_WIN rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(exePath), false, xreDirectory); diff --git a/ipc/glue/GoannaChildProcessHost.cpp b/ipc/glue/GoannaChildProcessHost.cpp index c89674587..0a2f95025 100644 --- a/ipc/glue/GoannaChildProcessHost.cpp +++ b/ipc/glue/GoannaChildProcessHost.cpp @@ -138,7 +138,11 @@ GoannaChildProcessHost::GetPathToBinary(FilePath& exePath) NS_NewLocalFile(nsDependentString(gGREBinPath), false, getter_AddRefs(childProcPath)); // We need to use an App Bundle on OS X so that we can hide - // the dock icon. See Bug 557225. + // the dock icon. See Bug 557225. + nsCOMPtr<nsIFile> tempPath; + childProcPath->GetParent(getter_AddRefs(tempPath)); + childProcPath = tempPath.forget(); + childProcPath->AppendNative(NS_LITERAL_CSTRING("MacOS")); childProcPath->AppendNative(NS_LITERAL_CSTRING("plugin-container.app")); childProcPath->AppendNative(NS_LITERAL_CSTRING("Contents")); childProcPath->AppendNative(NS_LITERAL_CSTRING("MacOS")); diff --git a/xpcom/build/XPCOMInit.cpp b/xpcom/build/XPCOMInit.cpp index 4aa9c40cd..04439139a 100644 --- a/xpcom/build/XPCOMInit.cpp +++ b/xpcom/build/XPCOMInit.cpp @@ -611,6 +611,17 @@ NS_InitXPCOM2(nsIServiceManager** aResult, xpcomLib->GetPath(path); gGREBinPath = ToNewUnicode(path); +#ifdef XP_MACOSX + nsCOMPtr<nsIFile> parent; + xpcomLib->GetParent(getter_AddRefs(parent)); + parent->AppendNative(NS_LITERAL_CSTRING("MacOS")); + bool pathExists = false; + parent->Exists(&pathExists); + if (pathExists) { + xpcomLib = parent.forget(); + } +#endif + xpcomLib->AppendNative(nsDependentCString(XPCOM_DLL)); nsDirectoryService::gService->Set(NS_XPCOM_LIBRARY_FILE, xpcomLib); |