• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "base/functional/bind.h"
8 #include "base/functional/callback.h"
9 #include "base/strings/string_piece.h"
10 
11 namespace net::test {
12 
ScopedDisableExitOnDFatal()13 ScopedDisableExitOnDFatal::ScopedDisableExitOnDFatal()
14     : assert_handler_(base::BindRepeating(LogAssertHandler)) {}
15 
16 ScopedDisableExitOnDFatal::~ScopedDisableExitOnDFatal() = default;
17 
18 // static
LogAssertHandler(const char * file,int line,const base::StringPiece message,const base::StringPiece stack_trace)19 void ScopedDisableExitOnDFatal::LogAssertHandler(
20     const char* file,
21     int line,
22     const base::StringPiece message,
23     const base::StringPiece stack_trace) {
24   // Simply swallow the assert.
25 }
26 
27 }  // namespace net::test
28