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

Unified Diff: mojo/edk/system/awakable_list.cc

Issue 799113004: Update mojo sdk to rev 59145288bae55b0fce4276b017df6a1117bcf00f (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add mojo's ply to checklicenses whitelist Created 6 years 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/edk/system/awakable.h ('k') | mojo/edk/system/awakable_list_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/awakable_list.cc
diff --git a/mojo/edk/system/awakable_list.cc b/mojo/edk/system/awakable_list.cc
index 6af305b4420e2799ede060085e9ae914c03d22e4..e74e2c02869f5648b3a385db92c01b19f7d031c5 100644
--- a/mojo/edk/system/awakable_list.cc
+++ b/mojo/edk/system/awakable_list.cc
@@ -19,12 +19,18 @@ AwakableList::~AwakableList() {
}
void AwakableList::AwakeForStateChange(const HandleSignalsState& state) {
- for (AwakeInfoList::iterator it = awakables_.begin(); it != awakables_.end();
- ++it) {
+ for (AwakeInfoList::iterator it = awakables_.begin();
+ it != awakables_.end();) {
+ bool keep = true;
if (state.satisfies(it->signals))
- it->awakable->Awake(MOJO_RESULT_OK, it->context);
+ keep = it->awakable->Awake(MOJO_RESULT_OK, it->context);
else if (!state.can_satisfy(it->signals))
- it->awakable->Awake(MOJO_RESULT_FAILED_PRECONDITION, it->context);
+ keep = it->awakable->Awake(MOJO_RESULT_FAILED_PRECONDITION, it->context);
+ AwakeInfoList::iterator maybe_delete = it;
+ ++it;
+
+ if (!keep)
+ awakables_.erase(maybe_delete);
}
}
« no previous file with comments | « mojo/edk/system/awakable.h ('k') | mojo/edk/system/awakable_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698