| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/arc/arc_bridge_service.h" | 5 #include "components/arc/arc_bridge_service.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 void ArcBridgeService::SetStopReason(StopReason stop_reason) { | 82 void ArcBridgeService::SetStopReason(StopReason stop_reason) { |
| 83 DCHECK(CalledOnValidThread()); | 83 DCHECK(CalledOnValidThread()); |
| 84 stop_reason_ = stop_reason; | 84 stop_reason_ = stop_reason; |
| 85 } | 85 } |
| 86 | 86 |
| 87 bool ArcBridgeService::CalledOnValidThread() { | 87 bool ArcBridgeService::CalledOnValidThread() { |
| 88 return thread_checker_.CalledOnValidThread(); | 88 return thread_checker_.CalledOnValidThread(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 std::ostream& operator<<( |
| 92 std::ostream& os, ArcBridgeService::StopReason reason) { |
| 93 switch (reason) { |
| 94 #define CASE_IMPL(val) \ |
| 95 case ArcBridgeService::StopReason::val: \ |
| 96 return os << #val |
| 97 |
| 98 CASE_IMPL(SHUTDOWN); |
| 99 CASE_IMPL(GENERIC_BOOT_FAILURE); |
| 100 CASE_IMPL(LOW_DISK_SPACE); |
| 101 CASE_IMPL(CRASH); |
| 102 #undef CASE_IMPL |
| 103 } |
| 104 |
| 105 // In case of unexpected value, output the int value. |
| 106 return os << "StopReason(" << static_cast<int>(reason) << ")"; |
| 107 } |
| 108 |
| 91 } // namespace arc | 109 } // namespace arc |
| OLD | NEW |