summaryrefslogtreecommitdiff
path: root/chromium/net/test/scoped_disable_exit_on_dfatal.cc
blob: 6e81cab2187b6a786c486bad8c5f527c6b9fa466 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "net/test/scoped_disable_exit_on_dfatal.h"

#include "base/bind.h"
#include "base/callback.h"
#include "base/strings/string_piece.h"

namespace net::test {

ScopedDisableExitOnDFatal::ScopedDisableExitOnDFatal()
    : assert_handler_(base::BindRepeating(LogAssertHandler)) {}

ScopedDisableExitOnDFatal::~ScopedDisableExitOnDFatal() = default;

// static
void ScopedDisableExitOnDFatal::LogAssertHandler(
    const char* file,
    int line,
    const base::StringPiece message,
    const base::StringPiece stack_trace) {
  // Simply swallow the assert.
}

}  // namespace net::test