summaryrefslogtreecommitdiff
path: root/chromium/components/arc/arc_stop_reason.cc
blob: 8f04a3627419f288ad3a0effe9ed301e96b3c072 (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
// Copyright 2017 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 "components/arc/arc_stop_reason.h"

namespace arc {

std::ostream& operator<<(std::ostream& os, ArcStopReason reason) {
  switch (reason) {
#define CASE_IMPL(val)     \
  case ArcStopReason::val: \
    return os << #val

    CASE_IMPL(SHUTDOWN);
    CASE_IMPL(GENERIC_BOOT_FAILURE);
    CASE_IMPL(LOW_DISK_SPACE);
    CASE_IMPL(CRASH);
#undef CASE_IMPL
  }

  // In case of unexpected value, output the int value.
  return os << "ArcStopReason(" << static_cast<int>(reason) << ")";
}

}  // namespace arc