From a4d9e36f366bc0dd8562ba099c32e088213ac2e6 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 1 Feb 2011 13:53:53 -0600 Subject: [PATCH] Bug 625060: Only plugin-container needs to walk out of plugin-container.app/Content/MacOS to find the real GRE dir. r=bent --HG-- extra : rebase_source : a679b5caf11b507f15d952cb1979e73b125a5b0a --- ipc/glue/ScopedXREEmbed.cpp | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/ipc/glue/ScopedXREEmbed.cpp b/ipc/glue/ScopedXREEmbed.cpp index 1f31dbce03e..9647aa99b45 100644 --- a/ipc/glue/ScopedXREEmbed.cpp +++ b/ipc/glue/ScopedXREEmbed.cpp @@ -87,26 +87,30 @@ ScopedXREEmbed::Start() NS_ENSURE_TRUE(localFile,); #ifdef OS_MACOSX - rv = localFile->GetParent(getter_AddRefs(parent)); - if (NS_FAILED(rv)) - return; + if (XRE_GetProcessType() == GeckoProcessType_Content) { + // We're an XPCOM-using subprocess. Walk out of + // [subprocess].app/Contents/MacOS to the real GRE dir. + rv = localFile->GetParent(getter_AddRefs(parent)); + if (NS_FAILED(rv)) + return; - localFile = do_QueryInterface(parent); - NS_ENSURE_TRUE(localFile,); + localFile = do_QueryInterface(parent); + NS_ENSURE_TRUE(localFile,); - rv = localFile->GetParent(getter_AddRefs(parent)); - if (NS_FAILED(rv)) - return; + rv = localFile->GetParent(getter_AddRefs(parent)); + if (NS_FAILED(rv)) + return; - localFile = do_QueryInterface(parent); - NS_ENSURE_TRUE(localFile,); + localFile = do_QueryInterface(parent); + NS_ENSURE_TRUE(localFile,); - rv = localFile->GetParent(getter_AddRefs(parent)); - if (NS_FAILED(rv)) - return; + rv = localFile->GetParent(getter_AddRefs(parent)); + if (NS_FAILED(rv)) + return; - localFile = do_QueryInterface(parent); - NS_ENSURE_TRUE(localFile,); + localFile = do_QueryInterface(parent); + NS_ENSURE_TRUE(localFile,); + } #endif rv = XRE_InitEmbedding2(localFile, localFile, nsnull);