Skip to content

Commit

Permalink
[Tizen] Change Sandbox IPC process title.
Browse files Browse the repository at this point in the history
SetProcessTitleFromCommandLine() plays a role to change process title to
absolute path of the executable with arguments that the CommandLine object has.
For example, we want gpu process title to be "<xwalk dir>/xwalk
--type=gpu-process", not "/proc/self/exe --type=gpu-process"

However, we don't want to change browser process title, because browser process
title should be web app symbolic link path, not xwalk executable absolute path.

SandboxIPC process is the process forked by browser process. We want that
SandboxIPC process title is different from browser process title. Otherwise,
Tizen task switcher misunderstands that SandboxIPC process is also web
application process.

To achieve it,
1. Browser process must not call SetProcessTitleFromCommandLine();
2. Browser process must save argv pointer to change SandboxIPC process title later.
3. SandboxIPC process also calls SetProcessTitleFromCommandLine() to change its own process title.

BUG=crosswalk-project/crosswalk#609
  • Loading branch information
ds-hwang authored and Halton Huo committed Nov 6, 2013
1 parent 738720a commit e70e002
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
7 changes: 6 additions & 1 deletion content/app/content_main_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,12 @@ class ContentMainRunnerImpl : public ContentMainRunner {
if (delegate)
delegate->SandboxInitialized(process_type);

#if defined(OS_POSIX) && !defined(OS_IOS) && !defined(OS_TIZEN_MOBILE)
#if defined(OS_TIZEN_MOBILE)
if (process_type.empty())
StoreArgvPointerAddress(argv);
else
SetProcessTitleFromCommandLine(argv);
#elif defined(OS_POSIX) && !defined(OS_IOS)
SetProcessTitleFromCommandLine(argv);
#endif

Expand Down
6 changes: 6 additions & 0 deletions content/common/set_process_title.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,10 @@ void SetProcessTitleFromCommandLine(const char** /* main_argv */) {

#endif

#if defined(OS_TIZEN_MOBILE)
void StoreArgvPointerAddress(const char** main_argv) {
setproctitle_init(main_argv);
}
#endif

} // namespace content
4 changes: 4 additions & 0 deletions content/common/set_process_title.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ namespace content {
// will try to fix it so the "effective" command line shows up instead.
void SetProcessTitleFromCommandLine(const char** main_argv);

#if defined(OS_TIZEN_MOBILE)
void StoreArgvPointerAddress(const char** main_argv);
#endif

} // namespace content

#endif // CONTENT_COMMON_SET_PROCESS_TITLE_H_

0 comments on commit e70e002

Please sign in to comment.