зеркало из https://github.com/mozilla/gecko-dev.git
Bug 557225 - Load the plugin-container from the App Bundle. r=cjones
This commit is contained in:
Родитель
8c74014d71
Коммит
942c80cced
|
@ -35,3 +35,4 @@
|
|||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
MOZ_CHILD_PROCESS_NAME := plugin-container$(BIN_SUFFIX)
|
||||
MOZ_CHILD_PROCESS_BUNDLE := plugin-container.app/Contents/MacOS/
|
||||
|
|
|
@ -18,5 +18,7 @@
|
|||
<string>1.0</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.5</string>
|
||||
<key>LSUIElement</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
@ -134,7 +134,7 @@ bool LaunchApp(const std::vector<std::string>& argv,
|
|||
const file_handle_mapping_vector& fds_to_remap,
|
||||
bool wait, ProcessHandle* process_handle);
|
||||
|
||||
#if defined(CHROMIUM_MOZILLA_BUILD) && defined(OS_LINUX)
|
||||
#if defined(CHROMIUM_MOZILLA_BUILD) && (defined(OS_LINUX) || defined(OS_MACOSX))
|
||||
typedef std::map<std::string, std::string> environment_map;
|
||||
bool LaunchApp(const std::vector<std::string>& argv,
|
||||
const file_handle_mapping_vector& fds_to_remap,
|
||||
|
|
|
@ -21,9 +21,21 @@
|
|||
|
||||
namespace base {
|
||||
|
||||
#if defined(CHROMIUM_MOZILLA_BUILD)
|
||||
bool LaunchApp(const std::vector<std::string>& argv,
|
||||
const file_handle_mapping_vector& fds_to_remap,
|
||||
bool wait, ProcessHandle* process_handle) {
|
||||
return LaunchApp(argv, fds_to_remap, environment_map(),
|
||||
wait, process_handle);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool LaunchApp(const std::vector<std::string>& argv,
|
||||
const file_handle_mapping_vector& fds_to_remap,
|
||||
#if defined(CHROMIUM_MOZILLA_BUILD)
|
||||
const environment_map& env_vars_to_set,
|
||||
#endif
|
||||
bool wait, ProcessHandle* process_handle) {
|
||||
bool retval = true;
|
||||
|
||||
char* argv_copy[argv.size() + 1];
|
||||
|
@ -36,6 +48,14 @@ bool LaunchApp(const std::vector<std::string>& argv,
|
|||
// as close-on-exec.
|
||||
SetAllFDsToCloseOnExec();
|
||||
|
||||
#if defined(CHROMIUM_MOZILLA_BUILD)
|
||||
for (environment_map::const_iterator it = env_vars_to_set.begin();
|
||||
it != env_vars_to_set.end(); ++it) {
|
||||
if (setenv(it->first.c_str(), it->second.c_str(), 1/*overwrite*/))
|
||||
exit(127);
|
||||
}
|
||||
#endif
|
||||
|
||||
posix_spawn_file_actions_t file_actions;
|
||||
if (posix_spawn_file_actions_init(&file_actions) != 0) {
|
||||
return false;
|
||||
|
|
|
@ -219,7 +219,7 @@ GeckoChildProcessHost::PerformAsyncLaunch(std::vector<std::string> aExtraOpts)
|
|||
// we split the logic here.
|
||||
|
||||
FilePath exePath;
|
||||
#ifdef OS_LINUX
|
||||
#if defined(OS_LINUX) || defined(OS_MACOSX)
|
||||
base::environment_map newEnvVars;
|
||||
#endif
|
||||
|
||||
|
@ -235,6 +235,8 @@ GeckoChildProcessHost::PerformAsyncLaunch(std::vector<std::string> aExtraOpts)
|
|||
path += "/lib";
|
||||
#endif
|
||||
newEnvVars["LD_LIBRARY_PATH"] = path.get();
|
||||
#elif OS_MACOSX
|
||||
newEnvVars["DYLD_LIBRARY_PATH"] = path.get();
|
||||
#endif
|
||||
#ifdef MOZ_OMNIJAR
|
||||
// Make sure the child process can find the omnijar
|
||||
|
@ -249,6 +251,13 @@ GeckoChildProcessHost::PerformAsyncLaunch(std::vector<std::string> aExtraOpts)
|
|||
exePath = FilePath(CommandLine::ForCurrentProcess()->argv()[0]);
|
||||
exePath = exePath.DirName();
|
||||
}
|
||||
|
||||
#ifdef OS_MACOSX
|
||||
// We need to use an App Bundle on OS X so that we can hide
|
||||
// the dock icon. See Bug 557225
|
||||
exePath = exePath.AppendASCII(MOZ_CHILD_PROCESS_BUNDLE);
|
||||
#endif
|
||||
|
||||
exePath = exePath.AppendASCII(MOZ_CHILD_PROCESS_NAME);
|
||||
|
||||
#ifdef ANDROID
|
||||
|
@ -297,7 +306,7 @@ GeckoChildProcessHost::PerformAsyncLaunch(std::vector<std::string> aExtraOpts)
|
|||
#endif
|
||||
|
||||
base::LaunchApp(childArgv, mFileMap,
|
||||
#ifdef OS_LINUX
|
||||
#if defined(OS_LINUX) || defined(OS_MACOSX)
|
||||
newEnvVars,
|
||||
#endif
|
||||
false, &process);
|
||||
|
|
|
@ -94,7 +94,8 @@ CPPSRCS += SharedMemory_posix.cpp
|
|||
endif
|
||||
|
||||
include $(topsrcdir)/ipc/app/defs.mk
|
||||
DEFINES += -DMOZ_CHILD_PROCESS_NAME="\"$(MOZ_CHILD_PROCESS_NAME)\""
|
||||
DEFINES += -DMOZ_CHILD_PROCESS_NAME=\"$(MOZ_CHILD_PROCESS_NAME)\"
|
||||
DEFINES += -DMOZ_CHILD_PROCESS_BUNDLE=\"$(MOZ_CHILD_PROCESS_BUNDLE)\"
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
include $(topsrcdir)/ipc/chromium/chromium-config.mk
|
||||
|
|
Загрузка…
Ссылка в новой задаче