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

Side by Side Diff: services/media/factory_service/event.cc

Issue 1822333002: Motown: wholesale clang-format (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: dalesat Created 4 years, 9 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <list> 5 #include <list>
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "services/media/factory_service/event.h" 8 #include "services/media/factory_service/event.h"
9 9
10 namespace mojo { 10 namespace mojo {
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 162 }
163 163
164 void FirstEventImpl::Init() { 164 void FirstEventImpl::Init() {
165 for (Event& precursor : precursors_) { 165 for (Event& precursor : precursors_) {
166 if (precursor.occurred()) { 166 if (precursor.occurred()) {
167 Finished(); 167 Finished();
168 return; 168 return;
169 } 169 }
170 } 170 }
171 171
172 std::function<void()> consequence = [this]() { 172 std::function<void()> consequence = [this]() { Finished(); };
173 Finished();
174 };
175 173
176 for (Event& precursor : precursors_) { 174 for (Event& precursor : precursors_) {
177 precursor.When(consequence); 175 precursor.When(consequence);
178 } 176 }
179 } 177 }
180 178
181 FirstEventImpl::~FirstEventImpl() { 179 FirstEventImpl::~FirstEventImpl() {
182 for (Event& precursor : precursors_) { 180 for (Event& precursor : precursors_) {
183 precursor.Cancel(); 181 precursor.Cancel();
184 } 182 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 precursors_.back().When(consequence_); 214 precursors_.back().When(consequence_);
217 return; 215 return;
218 } 216 }
219 } 217 }
220 218
221 Occur(); 219 Occur();
222 } 220 }
223 221
224 } // namespace media 222 } // namespace media
225 } // namespace mojo 223 } // namespace mojo
OLDNEW
« no previous file with comments | « services/media/factory_service/event.h ('k') | services/media/factory_service/factory_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698