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

Unified Diff: mojo/system/waiter_list.cc

Issue 325213004: Mojo: Wrap the satisfied/unsatisfied wait flags state in a single object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/system/waiter_list.h ('k') | mojo/system/waiter_list_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/waiter_list.cc
diff --git a/mojo/system/waiter_list.cc b/mojo/system/waiter_list.cc
index 6f2c44411eb10d89fef8229a30fa51e3b3b73665..c398c8439d2d6f95e77fa1b75533503296968325 100644
--- a/mojo/system/waiter_list.cc
+++ b/mojo/system/waiter_list.cc
@@ -5,6 +5,7 @@
#include "mojo/system/waiter_list.h"
#include "base/logging.h"
+#include "mojo/system/wait_flags_state.h"
#include "mojo/system/waiter.h"
namespace mojo {
@@ -17,6 +18,17 @@ WaiterList::~WaiterList() {
DCHECK(waiters_.empty());
}
+void WaiterList::AwakeWaitersForStateChange(const WaitFlagsState& state) {
+ for (WaiterInfoList::iterator it = waiters_.begin(); it != waiters_.end();
+ ++it) {
+ if (state.satisfies(it->flags))
+ it->waiter->Awake(it->wake_result);
+ else if (!state.can_satisfy(it->flags))
+ it->waiter->Awake(MOJO_RESULT_FAILED_PRECONDITION);
+ }
+}
+
+//FIXME Remove:
void WaiterList::AwakeWaitersForStateChange(MojoWaitFlags satisfied_flags,
MojoWaitFlags satisfiable_flags) {
for (WaiterInfoList::iterator it = waiters_.begin(); it != waiters_.end();
« no previous file with comments | « mojo/system/waiter_list.h ('k') | mojo/system/waiter_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698