diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-01 19:55:22 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-01 19:55:22 +0000 |
commit | 10f33b1bd6c6adb6306759a45bf3a5c18221d878 (patch) | |
tree | 60d8395d4bb748333871726781b6ef75a7d9c559 | |
parent | 995d592afc0fcee55a67b9f5ebcae7a093de6da0 (diff) | |
download | chromium_src-10f33b1bd6c6adb6306759a45bf3a5c18221d878.zip chromium_src-10f33b1bd6c6adb6306759a45bf3a5c18221d878.tar.gz chromium_src-10f33b1bd6c6adb6306759a45bf3a5c18221d878.tar.bz2 |
Move base/debug_on_start to base/debugger and rename it to be _win since it
only does anything on Windows.
TEST=it compiles
BUG=none
Review URL: http://codereview.chromium.org/5984007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70362 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/base.gypi | 5 | ||||
-rw-r--r-- | base/base_switches.cc | 7 | ||||
-rw-r--r-- | base/debug/debug_on_start_win.cc (renamed from base/debug_on_start.cc) | 12 | ||||
-rw-r--r-- | base/debug/debug_on_start_win.h (renamed from base/debug_on_start.h) | 19 | ||||
-rw-r--r-- | base/test/test_suite.cc | 4 | ||||
-rw-r--r-- | chrome/browser/importer/firefox_importer_unittest_utils_mac.cc | 1 | ||||
-rw-r--r-- | ipc/ipc_tests.cc | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_mac.mm | 1 |
9 files changed, 34 insertions, 21 deletions
diff --git a/base/base.gypi b/base/base.gypi index ce533cb..53ca3c9 100644 --- a/base/base.gypi +++ b/base/base.gypi @@ -49,8 +49,8 @@ 'condition_variable_win.cc', 'cpu.cc', 'cpu.h', - 'debug_on_start.cc', - 'debug_on_start.h', + 'debug/debug_on_start_win.cc', + 'debug/debug_on_start_win.h', 'debug/debugger.cc', 'debug/debugger.h', 'debug/debugger_posix.cc', @@ -510,7 +510,6 @@ 'cpu.cc', 'crypto/capi_util.h', 'crypto/capi_util.cc', - 'debug_on_start.cc', 'event_recorder.cc', 'file_version_info.cc', 'pe_image.cc', diff --git a/base/base_switches.cc b/base/base_switches.cc index c95010e..a1d688a 100644 --- a/base/base_switches.cc +++ b/base/base_switches.cc @@ -6,9 +6,10 @@ namespace switches { -// If the program includes chrome/common/debug_on_start.h, the process will -// start the JIT system-registered debugger on itself and will wait for 60 -// seconds for the debugger to attach to itself. Then a break point will be hit. +// If the program includes base/debug/debug_on_start_win.h, the process will +// (on Windows only) start the JIT system-registered debugger on itself and +// will wait for 60 seconds for the debugger to attach to itself. Then a break +// point will be hit. const char kDebugOnStart[] = "debug-on-start"; // Disables the crash reporting. diff --git a/base/debug_on_start.cc b/base/debug/debug_on_start_win.cc index 15dab05..b5c1094 100644 --- a/base/debug_on_start.cc +++ b/base/debug/debug_on_start_win.cc @@ -1,15 +1,18 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <windows.h> +#include "base/debug/debug_on_start_win.h" -#include "base/debug_on_start.h" +#include <windows.h> #include "base/base_switches.h" #include "base/basictypes.h" #include "base/debug/debugger.h" +namespace base { +namespace debug { + // Minimalist implementation to try to find a command line argument. We can use // kernel32 exported functions but not the CRT functions because we're too early // in the process startup. @@ -66,3 +69,6 @@ int __cdecl DebugOnStart::Init() { } return 0; } + +} // namespace debug +} // namespace base diff --git a/base/debug_on_start.h b/base/debug/debug_on_start_win.h index 1774415..5a1081d 100644 --- a/base/debug_on_start.h +++ b/base/debug/debug_on_start_win.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,19 +6,24 @@ // line argument. When the command line argument is detected, it invokes the // debugger, if no system-wide debugger is registered, a debug break is done. -#ifndef BASE_DEBUG_ON_START_H_ -#define BASE_DEBUG_ON_START_H_ +#ifndef BASE_DEBUG_DEBUG_ON_START_WIN_H_ +#define BASE_DEBUG_DEBUG_ON_START_WIN_H_ #pragma once #include "base/basictypes.h" +#include "build/build_config.h" -// This only works on Windows. +// This only works on Windows. It's legal to include on other platforms, but +// will be a NOP. #if defined(OS_WIN) #ifndef DECLSPEC_SELECTANY #define DECLSPEC_SELECTANY __declspec(selectany) #endif +namespace base { +namespace debug { + // Debug on start functions and data. class DebugOnStart { public: @@ -63,6 +68,10 @@ DECLSPEC_SELECTANY DebugOnStart::PIFV debug_on_start = &DebugOnStart::Init; #pragma data_seg(pop) #endif // _WIN64 + +} // namespace debug +} // namespace base + #endif // defined(OS_WIN) -#endif // BASE_DEBUG_ON_START_H_ +#endif // BASE_DEBUG_DEBUG_ON_START_WIN_H_ diff --git a/base/test/test_suite.cc b/base/test/test_suite.cc index 2cfaa4b..aa23f04 100644 --- a/base/test/test_suite.cc +++ b/base/test/test_suite.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -8,7 +8,7 @@ #include "base/base_paths.h" #include "base/base_switches.h" #include "base/command_line.h" -#include "base/debug_on_start.h" +#include "base/debug/debug_on_start_win.h" #include "base/debug/debugger.h" #include "base/file_path.h" #include "base/i18n/icu_util.h" diff --git a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc index 15ac4a2..f27a53c 100644 --- a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc +++ b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc @@ -6,7 +6,6 @@ #include "base/base_switches.h" #include "base/command_line.h" -#include "base/debug_on_start.h" #include "base/file_path.h" #include "base/message_loop.h" #include "base/test/test_timeouts.h" diff --git a/ipc/ipc_tests.cc b/ipc/ipc_tests.cc index 1b00369..7c0b718 100644 --- a/ipc/ipc_tests.cc +++ b/ipc/ipc_tests.cc @@ -19,7 +19,7 @@ #include "base/base_switches.h" #include "base/command_line.h" -#include "base/debug_on_start.h" +#include "base/debug/debug_on_start_win.h" #include "base/perftimer.h" #include "base/test/perf_test_suite.h" #include "base/test/test_suite.h" diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index fea90a3..2e39f23 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -8,7 +8,7 @@ #include "base/base_paths.h" #include "base/command_line.h" -#include "base/debug_on_start.h" +#include "base/debug/debug_on_start_win.h" #include "base/file_path.h" #include "base/file_util.h" #include "base/md5.h" diff --git a/webkit/tools/test_shell/test_shell_mac.mm b/webkit/tools/test_shell/test_shell_mac.mm index 6cd810d..8a3a25e 100644 --- a/webkit/tools/test_shell/test_shell_mac.mm +++ b/webkit/tools/test_shell/test_shell_mac.mm @@ -12,7 +12,6 @@ #include "app/data_pack.h" #include "base/base_paths.h" #include "base/basictypes.h" -#include "base/debug_on_start.h" #include "base/debug/debugger.h" #include "base/file_path.h" #include "base/file_util.h" |