Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1246)

Side by Side Diff: content/browser/zygote_host_linux.cc

Issue 7006006: Replace OS_LINUX ifdefs with OS_POSIX & !OS_MACOSX, TOOLKIT_USES_GTK, or (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/zygote_host_linux.h" 5 #include "content/browser/zygote_host_linux.h"
6 6
7 #include <sys/socket.h> 7 #include <sys/socket.h>
8 #include <sys/stat.h> 8 #include <sys/stat.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 DCHECK(!init_); 74 DCHECK(!init_);
75 init_ = true; 75 init_ = true;
76 76
77 FilePath chrome_path; 77 FilePath chrome_path;
78 CHECK(PathService::Get(base::FILE_EXE, &chrome_path)); 78 CHECK(PathService::Get(base::FILE_EXE, &chrome_path));
79 CommandLine cmd_line(chrome_path); 79 CommandLine cmd_line(chrome_path);
80 80
81 cmd_line.AppendSwitchASCII(switches::kProcessType, switches::kZygoteProcess); 81 cmd_line.AppendSwitchASCII(switches::kProcessType, switches::kZygoteProcess);
82 82
83 int fds[2]; 83 int fds[2];
84 #if defined(OS_FREEBSD) || defined(OS_OPENBSD)
85 // The BSDs often don't support SOCK_SEQPACKET yet, so fall back to
86 // SOCK_DGRAM if necessary.
87 if (socketpair(PF_UNIX, SOCK_SEQPACKET, 0, fds) != 0)
88 CHECK(socketpair(PF_UNIX, SOCK_DGRAM, 0, fds) == 0);
89 #else
84 CHECK(socketpair(PF_UNIX, SOCK_SEQPACKET, 0, fds) == 0); 90 CHECK(socketpair(PF_UNIX, SOCK_SEQPACKET, 0, fds) == 0);
91 #endif
85 base::file_handle_mapping_vector fds_to_map; 92 base::file_handle_mapping_vector fds_to_map;
86 fds_to_map.push_back(std::make_pair(fds[1], 3)); 93 fds_to_map.push_back(std::make_pair(fds[1], 3));
87 94
88 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); 95 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
89 if (browser_command_line.HasSwitch(switches::kZygoteCmdPrefix)) { 96 if (browser_command_line.HasSwitch(switches::kZygoteCmdPrefix)) {
90 cmd_line.PrependWrapper( 97 cmd_line.PrependWrapper(
91 browser_command_line.GetSwitchValueNative(switches::kZygoteCmdPrefix)); 98 browser_command_line.GetSwitchValueNative(switches::kZygoteCmdPrefix));
92 } 99 }
93 // Append any switches from the browser process that need to be forwarded on 100 // Append any switches from the browser process that need to be forwarded on
94 // to the zygote/renderers. 101 // to the zygote/renderers.
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 !read_pickle.ReadInt(&iter, &tmp_exit_code)) { 364 !read_pickle.ReadInt(&iter, &tmp_exit_code)) {
358 LOG(WARNING) << "Error parsing GetTerminationStatus response from zygote."; 365 LOG(WARNING) << "Error parsing GetTerminationStatus response from zygote.";
359 return base::TERMINATION_STATUS_NORMAL_TERMINATION; 366 return base::TERMINATION_STATUS_NORMAL_TERMINATION;
360 } 367 }
361 368
362 if (exit_code) 369 if (exit_code)
363 *exit_code = tmp_exit_code; 370 *exit_code = tmp_exit_code;
364 371
365 return static_cast<base::TerminationStatus>(status); 372 return static_cast<base::TerminationStatus>(status);
366 } 373 }
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_unittest.cc ('k') | content/browser/zygote_main_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698