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

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

Issue 6995121: New NaCl zygote implementation 2 (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Dropping mods to content/browser/DEPS 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/child_process_launcher.h" 5 #include "content/browser/child_process_launcher.h"
6 6
7 #include <utility> // For std::pair. 7 #include <utility> // For std::pair.
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 cmd_line->GetSwitchValueASCII(switches::kProcessType); 121 cmd_line->GetSwitchValueASCII(switches::kProcessType);
122 int crash_signal_fd = 122 int crash_signal_fd =
123 content::GetContentClient()->browser()->GetCrashSignalFD(process_type); 123 content::GetContentClient()->browser()->GetCrashSignalFD(process_type);
124 if (use_zygote) { 124 if (use_zygote) {
125 base::GlobalDescriptors::Mapping mapping; 125 base::GlobalDescriptors::Mapping mapping;
126 mapping.push_back(std::pair<uint32_t, int>(kPrimaryIPCChannel, ipcfd)); 126 mapping.push_back(std::pair<uint32_t, int>(kPrimaryIPCChannel, ipcfd));
127 if (crash_signal_fd >= 0) { 127 if (crash_signal_fd >= 0) {
128 mapping.push_back(std::pair<uint32_t, int>(kCrashDumpSignal, 128 mapping.push_back(std::pair<uint32_t, int>(kCrashDumpSignal,
129 crash_signal_fd)); 129 crash_signal_fd));
130 } 130 }
131 handle = ZygoteHost::GetInstance()->ForkRenderer(cmd_line->argv(), 131 handle = ZygoteHost::GetInstance()->ForkRequest(cmd_line->argv(),
132 mapping); 132 mapping,
133 process_type);
133 } else 134 } else
134 // Fall through to the normal posix case below when we're not zygoting. 135 // Fall through to the normal posix case below when we're not zygoting.
135 #endif 136 #endif
136 { 137 {
137 base::file_handle_mapping_vector fds_to_map; 138 base::file_handle_mapping_vector fds_to_map;
138 fds_to_map.push_back(std::make_pair( 139 fds_to_map.push_back(std::make_pair(
139 ipcfd, 140 ipcfd,
140 kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor)); 141 kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor));
141 142
142 #if defined(OS_LINUX) 143 #if defined(OS_LINUX)
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 context_.get(), 355 context_.get(),
355 &ChildProcessLauncher::Context::SetProcessBackgrounded, 356 &ChildProcessLauncher::Context::SetProcessBackgrounded,
356 background)); 357 background));
357 } 358 }
358 359
359 void ChildProcessLauncher::SetTerminateChildOnShutdown( 360 void ChildProcessLauncher::SetTerminateChildOnShutdown(
360 bool terminate_on_shutdown) { 361 bool terminate_on_shutdown) {
361 if (context_) 362 if (context_)
362 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); 363 context_->set_terminate_child_on_shutdown(terminate_on_shutdown);
363 } 364 }
364
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698