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

Side by Side Diff: chromeos/dbus/fake_update_engine_client.cc

Issue 2413963002: Replace FOR_EACH_OBSERVER in chromeos/ with range-based for (Closed)
Patch Set: Run the script again with '/mg' 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 | « chromeos/dbus/fake_shill_service_client.cc ('k') | chromeos/dbus/power_manager_client.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chromeos/dbus/fake_update_engine_client.h" 5 #include "chromeos/dbus/fake_update_engine_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/threading/thread_task_runner_handle.h" 8 #include "base/threading/thread_task_runner_handle.h"
9 9
10 namespace chromeos { 10 namespace chromeos {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 if (status_queue_.empty()) 59 if (status_queue_.empty())
60 return default_status_; 60 return default_status_;
61 61
62 UpdateEngineClient::Status last_status = status_queue_.front(); 62 UpdateEngineClient::Status last_status = status_queue_.front();
63 status_queue_.pop(); 63 status_queue_.pop();
64 return last_status; 64 return last_status;
65 } 65 }
66 66
67 void FakeUpdateEngineClient::NotifyObserversThatStatusChanged( 67 void FakeUpdateEngineClient::NotifyObserversThatStatusChanged(
68 const UpdateEngineClient::Status& status) { 68 const UpdateEngineClient::Status& status) {
69 FOR_EACH_OBSERVER(Observer, observers_, UpdateStatusChanged(status)); 69 for (auto& observer : observers_)
70 observer.UpdateStatusChanged(status);
70 } 71 }
71 72
72 void FakeUpdateEngineClient::SetChannel(const std::string& target_channel, 73 void FakeUpdateEngineClient::SetChannel(const std::string& target_channel,
73 bool is_powerwash_allowed) { 74 bool is_powerwash_allowed) {
74 } 75 }
75 76
76 void FakeUpdateEngineClient::GetChannel(bool get_current_channel, 77 void FakeUpdateEngineClient::GetChannel(bool get_current_channel,
77 const GetChannelCallback& callback) { 78 const GetChannelCallback& callback) {
78 base::ThreadTaskRunnerHandle::Get()->PostTask( 79 base::ThreadTaskRunnerHandle::Get()->PostTask(
79 FROM_HERE, base::Bind(callback, std::string())); 80 FROM_HERE, base::Bind(callback, std::string()));
(...skipping 10 matching lines...) Expand all
90 const UpdateEngineClient::Status& status) { 91 const UpdateEngineClient::Status& status) {
91 default_status_ = status; 92 default_status_ = status;
92 } 93 }
93 94
94 void FakeUpdateEngineClient::set_update_check_result( 95 void FakeUpdateEngineClient::set_update_check_result(
95 const UpdateEngineClient::UpdateCheckResult& result) { 96 const UpdateEngineClient::UpdateCheckResult& result) {
96 update_check_result_ = result; 97 update_check_result_ = result;
97 } 98 }
98 99
99 } // namespace chromeos 100 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_shill_service_client.cc ('k') | chromeos/dbus/power_manager_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698