| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/debug/debugger.h" | 5 #include "base/debug/debugger.h" |
| 6 | 6 |
| 7 #include "base/threading/platform_thread.h" | 7 #include "base/threading/platform_thread.h" |
| 8 | 8 |
| 9 namespace base { | 9 namespace base { |
| 10 namespace debug { | 10 namespace debug { |
| 11 | 11 |
| 12 static bool is_debug_ui_suppressed = false; |
| 13 |
| 12 bool WaitForDebugger(int wait_seconds, bool silent) { | 14 bool WaitForDebugger(int wait_seconds, bool silent) { |
| 13 for (int i = 0; i < wait_seconds * 10; ++i) { | 15 for (int i = 0; i < wait_seconds * 10; ++i) { |
| 14 if (BeingDebugged()) { | 16 if (BeingDebugged()) { |
| 15 if (!silent) | 17 if (!silent) |
| 16 BreakDebugger(); | 18 BreakDebugger(); |
| 17 return true; | 19 return true; |
| 18 } | 20 } |
| 19 PlatformThread::Sleep(100); | 21 PlatformThread::Sleep(100); |
| 20 } | 22 } |
| 21 return false; | 23 return false; |
| 22 } | 24 } |
| 23 | 25 |
| 26 void SetSuppressDebugUI(bool suppress) { |
| 27 is_debug_ui_suppressed = suppress; |
| 28 } |
| 29 |
| 30 bool IsDebugUISuppressed() { |
| 31 return is_debug_ui_suppressed; |
| 32 } |
| 33 |
| 24 } // namespace debug | 34 } // namespace debug |
| 25 } // namespace base | 35 } // namespace base |
| OLD | NEW |