Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: base/debug/debugger.cc

Issue 7238012: Upstream android debug and log related files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove the android guard around ctype.h Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/debug/debugger_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "base/logging.h"
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; 12 static bool is_debug_ui_suppressed = false;
13 13
14 bool WaitForDebugger(int wait_seconds, bool silent) { 14 bool WaitForDebugger(int wait_seconds, bool silent) {
15 #if defined(OS_ANDROID)
16 // The pid from which we know which process to attach to are not output by
17 // android ddms, so we have to print it out explicitly.
18 LOG(INFO) << "DebugUtil::WaitForDebugger(pid=" << static_cast<int>(getpid())
19 << ")";
20 #endif
15 for (int i = 0; i < wait_seconds * 10; ++i) { 21 for (int i = 0; i < wait_seconds * 10; ++i) {
16 if (BeingDebugged()) { 22 if (BeingDebugged()) {
17 if (!silent) 23 if (!silent)
18 BreakDebugger(); 24 BreakDebugger();
19 return true; 25 return true;
20 } 26 }
21 PlatformThread::Sleep(100); 27 PlatformThread::Sleep(100);
22 } 28 }
23 return false; 29 return false;
24 } 30 }
25 31
26 void SetSuppressDebugUI(bool suppress) { 32 void SetSuppressDebugUI(bool suppress) {
27 is_debug_ui_suppressed = suppress; 33 is_debug_ui_suppressed = suppress;
28 } 34 }
29 35
30 bool IsDebugUISuppressed() { 36 bool IsDebugUISuppressed() {
31 return is_debug_ui_suppressed; 37 return is_debug_ui_suppressed;
32 } 38 }
33 39
34 } // namespace debug 40 } // namespace debug
35 } // namespace base 41 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/debug/debugger_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698