| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
| 6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
| 7 | 7 |
| 8 #include "chrome/browser/renderer_host/browser_render_process_host.h" | 8 #include "chrome/browser/renderer_host/browser_render_process_host.h" |
| 9 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 284 |
| 285 bool in_sandbox = !browser_command_line.HasSwitch(switches::kNoSandbox); | 285 bool in_sandbox = !browser_command_line.HasSwitch(switches::kNoSandbox); |
| 286 if (browser_command_line.HasSwitch(switches::kInProcessPlugins)) { | 286 if (browser_command_line.HasSwitch(switches::kInProcessPlugins)) { |
| 287 // In process plugins won't work if the sandbox is enabled. | 287 // In process plugins won't work if the sandbox is enabled. |
| 288 in_sandbox = false; | 288 in_sandbox = false; |
| 289 } | 289 } |
| 290 | 290 |
| 291 #if defined(OS_WIN) | 291 #if defined(OS_WIN) |
| 292 bool child_needs_help = | 292 bool child_needs_help = |
| 293 DebugFlags::ProcessDebugFlags(&cmd_line, | 293 DebugFlags::ProcessDebugFlags(&cmd_line, |
| 294 DebugFlags::RENDERER, | 294 ChildProcessInfo::RENDER_PROCESS, |
| 295 in_sandbox); | 295 in_sandbox); |
| 296 #elif defined(OS_POSIX) | 296 #elif defined(OS_POSIX) |
| 297 if (browser_command_line.HasSwitch(switches::kRendererCmdPrefix)) { | 297 if (browser_command_line.HasSwitch(switches::kRendererCmdPrefix)) { |
| 298 // launch the renderer child with some prefix (usually "gdb --args") | 298 // launch the renderer child with some prefix (usually "gdb --args") |
| 299 const std::wstring prefix = | 299 const std::wstring prefix = |
| 300 browser_command_line.GetSwitchValue(switches::kRendererCmdPrefix); | 300 browser_command_line.GetSwitchValue(switches::kRendererCmdPrefix); |
| 301 cmd_line.PrependWrapper(prefix); | 301 cmd_line.PrependWrapper(prefix); |
| 302 } | 302 } |
| 303 #endif | 303 #endif |
| 304 | 304 |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 // child processes determine the pid of the parent. | 814 // child processes determine the pid of the parent. |
| 815 // Build the channel ID. This is composed of a unique identifier for the | 815 // Build the channel ID. This is composed of a unique identifier for the |
| 816 // parent browser process, an identifier for the renderer/plugin instance, | 816 // parent browser process, an identifier for the renderer/plugin instance, |
| 817 // and a random component. We use a random component so that a hacked child | 817 // and a random component. We use a random component so that a hacked child |
| 818 // process can't cause denial of service by causing future named pipe creation | 818 // process can't cause denial of service by causing future named pipe creation |
| 819 // to fail. | 819 // to fail. |
| 820 return StringPrintf(L"%d.%x.%d", | 820 return StringPrintf(L"%d.%x.%d", |
| 821 base::GetCurrentProcId(), instance, | 821 base::GetCurrentProcId(), instance, |
| 822 base::RandInt(0, std::numeric_limits<int>::max())); | 822 base::RandInt(0, std::numeric_limits<int>::max())); |
| 823 } | 823 } |
| OLD | NEW |