| 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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/histogram.h" | 6 #include "base/histogram.h" |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/platform_thread.h" | 9 #include "base/platform_thread.h" |
| 10 #include "base/process_util.h" |
| 10 #include "base/scoped_nsautorelease_pool.h" | 11 #include "base/scoped_nsautorelease_pool.h" |
| 11 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 12 #include "base/system_monitor.h" | 13 #include "base/system_monitor.h" |
| 13 #include "chrome/common/chrome_constants.h" | 14 #include "chrome/common/chrome_constants.h" |
| 14 #include "chrome/common/chrome_counters.h" | 15 #include "chrome/common/chrome_counters.h" |
| 15 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
| 16 #include "chrome/common/l10n_util.h" | 17 #include "chrome/common/l10n_util.h" |
| 17 #include "chrome/common/logging_chrome.h" | 18 #include "chrome/common/logging_chrome.h" |
| 18 #include "chrome/common/main_function_params.h" | 19 #include "chrome/common/main_function_params.h" |
| 19 #include "chrome/common/resource_bundle.h" | 20 #include "chrome/common/resource_bundle.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 32 | 33 |
| 33 // This parameter causes a null pointer crash (crash reporter trigger). | 34 // This parameter causes a null pointer crash (crash reporter trigger). |
| 34 if (command_line.HasSwitch(switches::kRendererCrashTest)) { | 35 if (command_line.HasSwitch(switches::kRendererCrashTest)) { |
| 35 int* bad_pointer = NULL; | 36 int* bad_pointer = NULL; |
| 36 *bad_pointer = 0; | 37 *bad_pointer = 0; |
| 37 } | 38 } |
| 38 | 39 |
| 39 if (command_line.HasSwitch(switches::kRendererStartupDialog)) { | 40 if (command_line.HasSwitch(switches::kRendererStartupDialog)) { |
| 40 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
| 41 std::wstring title = l10n_util::GetString(IDS_PRODUCT_NAME); | 42 std::wstring title = l10n_util::GetString(IDS_PRODUCT_NAME); |
| 43 std::wstring message = L"renderer starting with pid: "; |
| 44 message += IntToWString(base::GetCurrentProcId()); |
| 42 title += L" renderer"; // makes attaching to process easier | 45 title += L" renderer"; // makes attaching to process easier |
| 43 ::MessageBox(NULL, L"renderer starting...", title.c_str(), | 46 ::MessageBox(NULL, message.c_str(), title.c_str(), |
| 44 MB_OK | MB_SETFOREGROUND); | 47 MB_OK | MB_SETFOREGROUND); |
| 45 #elif defined(OS_MACOSX) | 48 #elif defined(OS_MACOSX) |
| 46 // TODO(playmobil): In the long term, overriding this flag doesn't seem | 49 // TODO(playmobil): In the long term, overriding this flag doesn't seem |
| 47 // right, either use our own flag or open a dialog we can use. | 50 // right, either use our own flag or open a dialog we can use. |
| 48 // This is just to ease debugging in the interim. | 51 // This is just to ease debugging in the interim. |
| 49 LOG(WARNING) << "Renderer (" | 52 LOG(WARNING) << "Renderer (" |
| 50 << getpid() | 53 << getpid() |
| 51 << ") paused waiting for debugger to attach @ pid"; | 54 << ") paused waiting for debugger to attach @ pid"; |
| 52 pause(); | 55 pause(); |
| 53 #endif // defined(OS_MACOSX) | 56 #endif // defined(OS_MACOSX) |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 if (run_loop) { | 107 if (run_loop) { |
| 105 // Load the accelerator table from the browser executable and tell the | 108 // Load the accelerator table from the browser executable and tell the |
| 106 // message loop to use it when translating messages. | 109 // message loop to use it when translating messages. |
| 107 if (pool) pool->Recycle(); | 110 if (pool) pool->Recycle(); |
| 108 MessageLoop::current()->Run(); | 111 MessageLoop::current()->Run(); |
| 109 } | 112 } |
| 110 } | 113 } |
| 111 platform.PlatformUninitialize(); | 114 platform.PlatformUninitialize(); |
| 112 return 0; | 115 return 0; |
| 113 } | 116 } |
| OLD | NEW |