1 // Copyright 2014 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "net/test/scoped_disable_exit_on_dfatal.h" 6 7 #include <string_view> 8 9 #include "base/functional/bind.h" 10 #include "base/functional/callback.h" 11 12 namespace net::test { 13 ScopedDisableExitOnDFatal()14ScopedDisableExitOnDFatal::ScopedDisableExitOnDFatal() 15 : assert_handler_(base::BindRepeating(LogAssertHandler)) {} 16 17 ScopedDisableExitOnDFatal::~ScopedDisableExitOnDFatal() = default; 18 19 // static LogAssertHandler(const char * file,int line,std::string_view message,std::string_view stack_trace)20void ScopedDisableExitOnDFatal::LogAssertHandler(const char* file, 21 int line, 22 std::string_view message, 23 std::string_view stack_trace) { 24 // Simply swallow the assert. 25 } 26 27 } // namespace net::test 28