| OLD | NEW |
| 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/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 // static | 87 // static |
| 88 ChildProcessHost* ChildProcessHost::Create(ChildProcessHostDelegate* delegate) { | 88 ChildProcessHost* ChildProcessHost::Create(ChildProcessHostDelegate* delegate) { |
| 89 return new ChildProcessHostImpl(delegate); | 89 return new ChildProcessHostImpl(delegate); |
| 90 } | 90 } |
| 91 | 91 |
| 92 // static | 92 // static |
| 93 base::FilePath ChildProcessHost::GetChildPath(int flags) { | 93 base::FilePath ChildProcessHost::GetChildPath(int flags) { |
| 94 base::FilePath child_path; | 94 base::FilePath child_path; |
| 95 | 95 |
| 96 child_path = CommandLine::ForCurrentProcess()->GetSwitchValuePath( | 96 child_path = base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( |
| 97 switches::kBrowserSubprocessPath); | 97 switches::kBrowserSubprocessPath); |
| 98 | 98 |
| 99 #if defined(OS_LINUX) | 99 #if defined(OS_LINUX) |
| 100 // Use /proc/self/exe rather than our known binary path so updates | 100 // Use /proc/self/exe rather than our known binary path so updates |
| 101 // can't swap out the binary from underneath us. | 101 // can't swap out the binary from underneath us. |
| 102 // When running under Valgrind, forking /proc/self/exe ends up forking the | 102 // When running under Valgrind, forking /proc/self/exe ends up forking the |
| 103 // Valgrind executable, which then crashes. However, it's almost safe to | 103 // Valgrind executable, which then crashes. However, it's almost safe to |
| 104 // assume that the updates won't happen while testing with Valgrind tools. | 104 // assume that the updates won't happen while testing with Valgrind tools. |
| 105 if (child_path.empty() && flags & CHILD_ALLOW_SELF && !RunningOnValgrind()) | 105 if (child_path.empty() && flags & CHILD_ALLOW_SELF && !RunningOnValgrind()) |
| 106 child_path = base::FilePath(base::kProcSelfExe); | 106 child_path = base::FilePath(base::kProcSelfExe); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 uint32 usage, | 314 uint32 usage, |
| 315 gfx::GpuMemoryBufferHandle* handle) { | 315 gfx::GpuMemoryBufferHandle* handle) { |
| 316 handle->type = gfx::SHARED_MEMORY_BUFFER; | 316 handle->type = gfx::SHARED_MEMORY_BUFFER; |
| 317 AllocateSharedMemory( | 317 AllocateSharedMemory( |
| 318 width * height * GpuMemoryBufferImpl::BytesPerPixel(internalformat), | 318 width * height * GpuMemoryBufferImpl::BytesPerPixel(internalformat), |
| 319 peer_handle_, | 319 peer_handle_, |
| 320 &handle->handle); | 320 &handle->handle); |
| 321 } | 321 } |
| 322 | 322 |
| 323 } // namespace content | 323 } // namespace content |
| OLD | NEW |