diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-05 18:25:20 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-05 18:25:20 +0000 |
commit | dbd9bfc0b4df5132997d1c4216ba4bbd860fed85 (patch) | |
tree | e4e6ec0a6e0468447d6b0337bd981c55c376099e /chrome | |
parent | f505c31ba55975411a009f74a59b001a5a46bb56 (diff) | |
download | chromium_src-dbd9bfc0b4df5132997d1c4216ba4bbd860fed85.zip chromium_src-dbd9bfc0b4df5132997d1c4216ba4bbd860fed85.tar.gz chromium_src-dbd9bfc0b4df5132997d1c4216ba4bbd860fed85.tar.bz2 |
Some fixes to ease debugging of the renderer process on OS X.
Review URL: http://codereview.chromium.org/21084
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9225 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/renderer/renderer_main.cc | 10 | ||||
-rw-r--r-- | chrome/renderer/renderer_main_platform_delegate_mac.cc | 7 | ||||
-rw-r--r-- | chrome/renderer/renderer_main_unittest.cc | 7 |
3 files changed, 19 insertions, 5 deletions
diff --git a/chrome/renderer/renderer_main.cc b/chrome/renderer/renderer_main.cc index 1ae28a3..b6d4dfe 100644 --- a/chrome/renderer/renderer_main.cc +++ b/chrome/renderer/renderer_main.cc @@ -44,8 +44,14 @@ static void HandleRendererErrorTestParameters(const CommandLine& command_line) { title += L" renderer"; // makes attaching to process easier MessageBox(NULL, L"renderer starting...", title.c_str(), MB_OK | MB_SETFOREGROUND); -#else - NOTIMPLEMENTED(); +#else if defined(OS_MACOSX) + // TODO(playmobil): In the long term, overriding this flag doesn't seem + // right, either use our own flag or open a dialog we can use. + // This is just to ease debugging in the interim. + LOG(WARNING) << "Renderer (" + << getpid() + << ") paused waiting for debugger to attach @ pid" ; + pause(); #endif // !OS_WIN } } diff --git a/chrome/renderer/renderer_main_platform_delegate_mac.cc b/chrome/renderer/renderer_main_platform_delegate_mac.cc index d7d5caa..cb5e750 100644 --- a/chrome/renderer/renderer_main_platform_delegate_mac.cc +++ b/chrome/renderer/renderer_main_platform_delegate_mac.cc @@ -4,6 +4,8 @@ #include "chrome/renderer/renderer_main_platform_delegate.h" +#include "base/debug_util.h" + extern "C" { #include <sandbox.h> } @@ -27,6 +29,11 @@ bool RendererMainPlatformDelegate::InitSandboxTests(bool no_sandbox) { } bool RendererMainPlatformDelegate::EnableSandbox() { + // This call doesn't work when the sandbox is enabled, the implementation + // caches it's return value so we call it here and then future calls will + // succeed. + DebugUtil::BeingDebugged(); + char* error_buff = NULL; int error = sandbox_init(kSBXProfilePureComputation, SANDBOX_NAMED, &error_buff); diff --git a/chrome/renderer/renderer_main_unittest.cc b/chrome/renderer/renderer_main_unittest.cc index f003015..bfa3df0 100644 --- a/chrome/renderer/renderer_main_unittest.cc +++ b/chrome/renderer/renderer_main_unittest.cc @@ -78,10 +78,11 @@ class SuicidalListener : public IPC::Channel::Listener { MULTIPROCESS_TEST_MAIN(SimpleRenderer) { SandboxInitWrapper dummy_sandbox_init; - CommandLine command_line(L""); - command_line.AppendSwitchWithValue(switches::kProcessChannelID, + CommandLine cl(*CommandLine::ForCurrentProcess()); + cl.AppendSwitchWithValue(switches::kProcessChannelID, kRendererTestChannelName); - MainFunctionParams dummy_params(command_line, + + MainFunctionParams dummy_params(cl, dummy_sandbox_init); return RendererMain(dummy_params); } |