crash_process.cc 955 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "remoting/host/crash_process.h"
  5. #include "base/check.h"
  6. #include "base/debug/alias.h"
  7. #include "base/location.h"
  8. #include "base/logging.h"
  9. #include "base/strings/string_util.h"
  10. namespace remoting {
  11. void CrashProcess(const base::Location& location) {
  12. CrashProcess(location.function_name(), location.file_name(),
  13. location.line_number());
  14. }
  15. void CrashProcess(const std::string& function_name,
  16. const std::string& file_name,
  17. int line_number) {
  18. char message[1024];
  19. base::snprintf(message, sizeof(message), "Requested by %s at %s, line %d.",
  20. function_name.c_str(), file_name.c_str(), line_number);
  21. base::debug::Alias(message);
  22. // Crash the process.
  23. CHECK(false) << message;
  24. }
  25. } // namespace remoting