unresponsive_suppressor.cc 509 B

123456789101112131415161718192021222324252627
  1. // Copyright (c) 2016 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #include "atom/browser/unresponsive_suppressor.h"
  5. namespace atom {
  6. namespace {
  7. int g_suppress_level = 0;
  8. } // namespace
  9. bool IsUnresponsiveEventSuppressed() {
  10. return g_suppress_level > 0;
  11. }
  12. UnresponsiveSuppressor::UnresponsiveSuppressor() {
  13. g_suppress_level++;
  14. }
  15. UnresponsiveSuppressor::~UnresponsiveSuppressor() {
  16. g_suppress_level--;
  17. }
  18. } // namespace atom