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

Side by Side Diff: content/common/child_process_host_impl.cc

Issue 10914279: Cleanup: Add a const variable for /proc/self/exe. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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 | « content/browser/browser_main_loop.cc ('k') | content/common/set_process_title.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/common/child_process_host_impl.h" 5 #include "content/common/child_process_host_impl.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/atomicops.h" 9 #include "base/atomicops.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 child_path = CommandLine::ForCurrentProcess()->GetSwitchValuePath( 91 child_path = CommandLine::ForCurrentProcess()->GetSwitchValuePath(
92 switches::kBrowserSubprocessPath); 92 switches::kBrowserSubprocessPath);
93 93
94 #if defined(OS_LINUX) 94 #if defined(OS_LINUX)
95 // Use /proc/self/exe rather than our known binary path so updates 95 // Use /proc/self/exe rather than our known binary path so updates
96 // can't swap out the binary from underneath us. 96 // can't swap out the binary from underneath us.
97 // When running under Valgrind, forking /proc/self/exe ends up forking the 97 // When running under Valgrind, forking /proc/self/exe ends up forking the
98 // Valgrind executable, which then crashes. However, it's almost safe to 98 // Valgrind executable, which then crashes. However, it's almost safe to
99 // assume that the updates won't happen while testing with Valgrind tools. 99 // assume that the updates won't happen while testing with Valgrind tools.
100 if (child_path.empty() && flags & CHILD_ALLOW_SELF && !RunningOnValgrind()) 100 if (child_path.empty() && flags & CHILD_ALLOW_SELF && !RunningOnValgrind())
101 child_path = FilePath("/proc/self/exe"); 101 child_path = FilePath(base::kProcSelfExe);
102 #endif 102 #endif
103 103
104 // On most platforms, the child executable is the same as the current 104 // On most platforms, the child executable is the same as the current
105 // executable. 105 // executable.
106 if (child_path.empty()) 106 if (child_path.empty())
107 PathService::Get(content::CHILD_PROCESS_EXE, &child_path); 107 PathService::Get(content::CHILD_PROCESS_EXE, &child_path);
108 108
109 #if defined(OS_MACOSX) 109 #if defined(OS_MACOSX)
110 DCHECK(!(flags & CHILD_NO_PIE && flags & CHILD_ALLOW_HEAP_EXECUTION)); 110 DCHECK(!(flags & CHILD_NO_PIE && flags & CHILD_ALLOW_HEAP_EXECUTION));
111 111
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 base::SharedMemoryHandle* handle) { 287 base::SharedMemoryHandle* handle) {
288 AllocateSharedMemory(buffer_size, peer_handle_, handle); 288 AllocateSharedMemory(buffer_size, peer_handle_, handle);
289 } 289 }
290 290
291 void ChildProcessHostImpl::OnShutdownRequest() { 291 void ChildProcessHostImpl::OnShutdownRequest() {
292 if (delegate_->CanShutdown()) 292 if (delegate_->CanShutdown())
293 Send(new ChildProcessMsg_Shutdown()); 293 Send(new ChildProcessMsg_Shutdown());
294 } 294 }
295 295
296 } // namespace content 296 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | content/common/set_process_title.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698