summaryrefslogtreecommitdiff
path: root/chromium/content/public/browser/child_process_termination_info.h
blob: 0331f00b95dfb018fd0026b6c96629c6303ac1aa (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright 2018 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.

#ifndef CONTENT_PUBLIC_BROWSER_CHILD_PROCESS_TERMINATION_INFO_H_
#define CONTENT_PUBLIC_BROWSER_CHILD_PROCESS_TERMINATION_INFO_H_

#include "base/process/kill.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "content/public/common/result_codes.h"

#if defined(OS_ANDROID)
#include "base/android/child_process_binding_types.h"
#endif

namespace content {

struct ChildProcessTerminationInfo {
  base::TerminationStatus status = base::TERMINATION_STATUS_NORMAL_TERMINATION;

  // If |status| is TERMINATION_STATUS_LAUNCH_FAILED then |exit_code| will
  // contain a platform specific launch failure error code. Otherwise, it will
  // contain the exit code for the process (e.g. status from waitpid if on
  // posix, from GetExitCodeProcess on Windows).
  int exit_code = service_manager::RESULT_CODE_NORMAL_EXIT;

  // Time delta between 1) the process start and 2) the time when
  // ChildProcessTerminationInfo is computed.
  base::TimeDelta uptime = base::TimeDelta::Max();

#if defined(OS_ANDROID)
  // True if child service has strong or moderate binding at time of death.
  base::android::ChildBindingState binding_state =
      base::android::ChildBindingState::UNBOUND;

  // True if child service was explicitly killed by browser.
  bool was_killed_intentionally_by_browser = false;

  // True if the child shut itself down cleanly by quitting the main runloop.
  bool clean_exit = false;

  // Counts of remaining child processes with corresponding binding.
  int remaining_process_with_strong_binding = 0;
  int remaining_process_with_moderate_binding = 0;
  int remaining_process_with_waived_binding = 0;
#endif
};

}  // namespace content

#endif  // CONTENT_PUBLIC_BROWSER_CHILD_PROCESS_TERMINATION_INFO_H_