Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
michael@0 | 2 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 3 | // found in the LICENSE file. |
michael@0 | 4 | |
michael@0 | 5 | // This is a cross platform interface for helper functions related to |
michael@0 | 6 | // debuggers. You should use this to test if you're running under a debugger, |
michael@0 | 7 | // and if you would like to yield (breakpoint) into the debugger. |
michael@0 | 8 | |
michael@0 | 9 | #ifndef BASE_DEBUG_DEBUGGER_H |
michael@0 | 10 | #define BASE_DEBUG_DEBUGGER_H |
michael@0 | 11 | |
michael@0 | 12 | #include "base/base_export.h" |
michael@0 | 13 | |
michael@0 | 14 | namespace base { |
michael@0 | 15 | namespace debug { |
michael@0 | 16 | |
michael@0 | 17 | // Starts the registered system-wide JIT debugger to attach it to specified |
michael@0 | 18 | // process. |
michael@0 | 19 | BASE_EXPORT bool SpawnDebuggerOnProcess(unsigned process_id); |
michael@0 | 20 | |
michael@0 | 21 | // Waits wait_seconds seconds for a debugger to attach to the current process. |
michael@0 | 22 | // When silent is false, an exception is thrown when a debugger is detected. |
michael@0 | 23 | BASE_EXPORT bool WaitForDebugger(int wait_seconds, bool silent); |
michael@0 | 24 | |
michael@0 | 25 | // Returns true if the given process is being run under a debugger. |
michael@0 | 26 | // |
michael@0 | 27 | // On OS X, the underlying mechanism doesn't work when the sandbox is enabled. |
michael@0 | 28 | // To get around this, this function caches its value. |
michael@0 | 29 | // |
michael@0 | 30 | // WARNING: Because of this, on OS X, a call MUST be made to this function |
michael@0 | 31 | // BEFORE the sandbox is enabled. |
michael@0 | 32 | BASE_EXPORT bool BeingDebugged(); |
michael@0 | 33 | |
michael@0 | 34 | // Break into the debugger, assumes a debugger is present. |
michael@0 | 35 | BASE_EXPORT void BreakDebugger(); |
michael@0 | 36 | |
michael@0 | 37 | // Used in test code, this controls whether showing dialogs and breaking into |
michael@0 | 38 | // the debugger is suppressed for debug errors, even in debug mode (normally |
michael@0 | 39 | // release mode doesn't do this stuff -- this is controlled separately). |
michael@0 | 40 | // Normally UI is not suppressed. This is normally used when running automated |
michael@0 | 41 | // tests where we want a crash rather than a dialog or a debugger. |
michael@0 | 42 | BASE_EXPORT void SetSuppressDebugUI(bool suppress); |
michael@0 | 43 | BASE_EXPORT bool IsDebugUISuppressed(); |
michael@0 | 44 | |
michael@0 | 45 | } // namespace debug |
michael@0 | 46 | } // namespace base |
michael@0 | 47 | |
michael@0 | 48 | #endif // BASE_DEBUG_DEBUGGER_H |