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

Side by Side Diff: chrome/browser/zygote_main_linux.cc

Issue 196009: Linux: set the process title (that shows in "ps" etc.) of renderers correctly when using the zygote. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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
« no previous file with comments | « chrome/browser/renderer_host/browser_render_process_host.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 <dlfcn.h> 5 #include <dlfcn.h>
6 #include <unistd.h> 6 #include <unistd.h>
7 #include <sys/epoll.h> 7 #include <sys/epoll.h>
8 #include <sys/types.h> 8 #include <sys/types.h>
9 #include <sys/socket.h> 9 #include <sys/socket.h>
10 #include <sys/signal.h> 10 #include <sys/signal.h>
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 mapping.push_back(std::make_pair( 180 mapping.push_back(std::make_pair(
181 static_cast<uint32_t>(kSandboxIPCChannel), 5)); 181 static_cast<uint32_t>(kSandboxIPCChannel), 5));
182 182
183 child = fork(); 183 child = fork();
184 184
185 if (!child) { 185 if (!child) {
186 close(3); // our socket from the browser is in fd 3 186 close(3); // our socket from the browser is in fd 3
187 Singleton<base::GlobalDescriptors>()->Reset(mapping); 187 Singleton<base::GlobalDescriptors>()->Reset(mapping);
188 CommandLine::Reset(); 188 CommandLine::Reset();
189 CommandLine::Init(args); 189 CommandLine::Init(args);
190 CommandLine::SetProcTitle();
190 return true; 191 return true;
191 } 192 }
192 193
193 for (std::vector<int>::const_iterator 194 for (std::vector<int>::const_iterator
194 i = fds.begin(); i != fds.end(); ++i) 195 i = fds.begin(); i != fds.end(); ++i)
195 close(*i); 196 close(*i);
196 197
197 HANDLE_EINTR(write(fd, &child, sizeof(child))); 198 HANDLE_EINTR(write(fd, &child, sizeof(child)));
198 return false; 199 return false;
199 200
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 444
444 if (!MaybeEnterChroot()) { 445 if (!MaybeEnterChroot()) {
445 LOG(FATAL) << "Failed to enter sandbox. Fail safe abort. (errno: " 446 LOG(FATAL) << "Failed to enter sandbox. Fail safe abort. (errno: "
446 << errno << ")"; 447 << errno << ")";
447 return false; 448 return false;
448 } 449 }
449 450
450 Zygote zygote; 451 Zygote zygote;
451 return zygote.ProcessRequests(); 452 return zygote.ProcessRequests();
452 } 453 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/browser_render_process_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698