| Index: components/arc/arc_session_observer.cc
|
| diff --git a/components/arc/arc_session_observer.cc b/components/arc/arc_session_observer.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..eca089cdf4df6e5ffd4b0cf2c14e8bdb8bbb04b6
|
| --- /dev/null
|
| +++ b/components/arc/arc_session_observer.cc
|
| @@ -0,0 +1,27 @@
|
| +// Copyright 2016 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_session_observer.h"
|
| +
|
| +namespace arc {
|
| +
|
| +std::ostream& operator<<(std::ostream& os,
|
| + ArcSessionObserver::StopReason reason) {
|
| + switch (reason) {
|
| +#define CASE_IMPL(val) \
|
| + case ArcSessionObserver::StopReason::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 << "StopReason(" << static_cast<int>(reason) << ")";
|
| +}
|
| +
|
| +} // namespace arc
|
|
|