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

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: rebase + fix error in sample_service.h 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
« no previous file with comments | « mojo/public/tests/mojom/math_calculator_internal.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a59a66e81d78cc8d92ac6827546afae3915baeec..d8b079ce9ddd8e2d56f4c238ddc27f44a9a3f7ad 100644
--- a/mojo/public/tests/simple_bindings_support.cc
+++ b/mojo/public/tests/simple_bindings_support.cc
@@ -49,27 +49,31 @@ void SimpleBindingsSupport::CancelWait(AsyncWaitID async_wait_id) {
}
void SimpleBindingsSupport::Process() {
- typedef std::pair<AsyncWaitCallback*, MojoResult> Result;
- std::list<Result> results;
+ for (;;) {
+ typedef std::pair<AsyncWaitCallback*, MojoResult> Result;
+ std::list<Result> results;
- WaiterList::iterator it = waiters_.begin();
- while (it != waiters_.end()) {
- Waiter* waiter = *it;
- MojoResult result;
- if (IsReady(waiter->handle, waiter->flags, &result)) {
- results.push_back(std::make_pair(waiter->callback, result));
- WaiterList::iterator doomed = it++;
- waiters_.erase(doomed);
- delete waiter;
- } else {
- ++it;
+ WaiterList::iterator it = waiters_.begin();
+ while (it != waiters_.end()) {
+ Waiter* waiter = *it;
+ MojoResult result;
+ if (IsReady(waiter->handle, waiter->flags, &result)) {
+ results.push_back(std::make_pair(waiter->callback, result));
+ WaiterList::iterator doomed = it++;
+ waiters_.erase(doomed);
+ delete waiter;
+ } 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;
}
}
« no previous file with comments | « mojo/public/tests/mojom/math_calculator_internal.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698