Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: components/arc/arc_bridge_service.cc

Issue 2416633002: Remove FOR_EACH_OBSERVER from arc/ since it's being deprecated (Closed)
Patch Set: remove braces Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/arc/arc_bridge_bootstrap.cc ('k') | components/arc/instance_holder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 void ArcBridgeService::RemoveObserver(Observer* observer) { 66 void ArcBridgeService::RemoveObserver(Observer* observer) {
67 DCHECK(CalledOnValidThread()); 67 DCHECK(CalledOnValidThread());
68 observer_list_.RemoveObserver(observer); 68 observer_list_.RemoveObserver(observer);
69 } 69 }
70 70
71 void ArcBridgeService::SetState(State state) { 71 void ArcBridgeService::SetState(State state) {
72 DCHECK(CalledOnValidThread()); 72 DCHECK(CalledOnValidThread());
73 DCHECK_NE(state_, state); 73 DCHECK_NE(state_, state);
74 state_ = state; 74 state_ = state;
75 VLOG(2) << "State: " << static_cast<uint32_t>(state_); 75 VLOG(2) << "State: " << static_cast<uint32_t>(state_);
76 if (state_ == State::READY) 76 if (state_ == State::READY) {
77 FOR_EACH_OBSERVER(Observer, observer_list(), OnBridgeReady()); 77 for (auto& observer : observer_list())
78 else if (state == State::STOPPED) 78 observer.OnBridgeReady();
79 FOR_EACH_OBSERVER(Observer, observer_list(), OnBridgeStopped(stop_reason_)); 79 } else if (state == State::STOPPED) {
80 for (auto& observer : observer_list())
Yusuke Sato 2016/10/12 18:30:35 Added <LF> since line 80-81 does not fit in one li
81 observer.OnBridgeStopped(stop_reason_);
82 }
80 } 83 }
81 84
82 void ArcBridgeService::SetStopReason(StopReason stop_reason) { 85 void ArcBridgeService::SetStopReason(StopReason stop_reason) {
83 DCHECK(CalledOnValidThread()); 86 DCHECK(CalledOnValidThread());
84 stop_reason_ = stop_reason; 87 stop_reason_ = stop_reason;
85 } 88 }
86 89
87 bool ArcBridgeService::CalledOnValidThread() { 90 bool ArcBridgeService::CalledOnValidThread() {
88 return thread_checker_.CalledOnValidThread(); 91 return thread_checker_.CalledOnValidThread();
89 } 92 }
(...skipping 10 matching lines...) Expand all
100 CASE_IMPL(LOW_DISK_SPACE); 103 CASE_IMPL(LOW_DISK_SPACE);
101 CASE_IMPL(CRASH); 104 CASE_IMPL(CRASH);
102 #undef CASE_IMPL 105 #undef CASE_IMPL
103 } 106 }
104 107
105 // In case of unexpected value, output the int value. 108 // In case of unexpected value, output the int value.
106 return os << "StopReason(" << static_cast<int>(reason) << ")"; 109 return os << "StopReason(" << static_cast<int>(reason) << ")";
107 } 110 }
108 111
109 } // namespace arc 112 } // namespace arc
OLDNEW
« no previous file with comments | « components/arc/arc_bridge_bootstrap.cc ('k') | components/arc/instance_holder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698