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

Unified Diff: mojo/public/tests/simple_bindings_support.cc

Issue 66353002: Mojo: RemotePtr<S> + bindings changes for Peer attribute. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move forward declarations to interface_declaration Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: mojo/public/tests/simple_bindings_support.cc
diff --git a/mojo/public/tests/simple_bindings_support.cc b/mojo/public/tests/simple_bindings_support.cc
index 979474dfe5acf289d3e42fc8742b5f13d54eecd8..865099b65ed4336733c8c1a3f82ca0a1756dff79 100644
--- a/mojo/public/tests/simple_bindings_support.cc
+++ b/mojo/public/tests/simple_bindings_support.cc
@@ -43,28 +43,32 @@ void SimpleBindingsSupport::CancelWait(AsyncWaitCallback* callback) {
}
void SimpleBindingsSupport::Process() {
- typedef std::pair<AsyncWaitCallback*, MojoResult> Result;
- std::list<Result> results;
+ for (;;) {
+ typedef std::pair<AsyncWaitCallback*, MojoResult> Result;
+ std::list<Result> results;
- // TODO(darin): Honor given deadline.
+ // TODO(darin): Honor given deadline.
- std::list<Waiter>::iterator it = waiters_.begin();
- while (it != waiters_.end()) {
- const Waiter& waiter = *it;
- MojoResult result;
- if (IsReady(waiter.handle, waiter.flags, &result)) {
- results.push_back(std::make_pair(waiter.callback, result));
- std::list<Waiter>::iterator doomed = it++;
- waiters_.erase(doomed);
- } else {
- ++it;
+ std::list<Waiter>::iterator it = waiters_.begin();
+ while (it != waiters_.end()) {
+ const Waiter& waiter = *it;
+ MojoResult result;
+ if (IsReady(waiter.handle, waiter.flags, &result)) {
+ results.push_back(std::make_pair(waiter.callback, result));
+ std::list<Waiter>::iterator doomed = it++;
+ waiters_.erase(doomed);
+ } else {
+ ++it;
+ }
}
- }
- for (std::list<Result>::const_iterator it = results.begin();
- it != results.end();
- ++it) {
- it->first->OnHandleReady(it->second);
+ for (std::list<Result>::const_iterator it = results.begin();
+ it != results.end();
+ ++it) {
+ it->first->OnHandleReady(it->second);
+ }
+ if (results.empty())
+ break;
}
}
« mojo/public/tests/math_calculator.idl ('K') | « mojo/public/tests/math_calculator.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698