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

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

Issue 2060943007: Make it possible to remove an Awakable with a specific "context" from a Dispatcher. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 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/edk/system/core_test_base.h ('k') | mojo/edk/system/data_pipe.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/core_test_base.cc
diff --git a/mojo/edk/system/core_test_base.cc b/mojo/edk/system/core_test_base.cc
index 5c5795277db2573cf065db731b58005e01ee8da0..f56f3fd66803cb409081fba129204ba051fca951 100644
--- a/mojo/edk/system/core_test_base.cc
+++ b/mojo/edk/system/core_test_base.cc
@@ -195,6 +195,16 @@ class MockDispatcher : public Dispatcher {
*signals_state = HandleSignalsState();
}
+ void RemoveAwakableWithContextImplNoLock(
+ Awakable* /*awakable*/,
+ uint64_t /*context*/,
+ HandleSignalsState* signals_state) override {
+ info_->IncrementRemoveAwakableWithContextCallCount();
+ mutex().AssertHeld();
+ if (signals_state)
+ *signals_state = HandleSignalsState();
+ }
+
void CancelAllStateNoLock() override {
info_->IncrementCancelAllStateCallCount();
mutex().AssertHeld();
@@ -340,6 +350,12 @@ unsigned CoreTestBase_MockHandleInfo::GetRemoveAwakableCallCount() const {
return remove_awakable_call_count_;
}
+unsigned CoreTestBase_MockHandleInfo::GetRemoveAwakableWithContextCallCount()
+ const {
+ MutexLocker locker(&mutex_);
+ return remove_awakable_with_context_call_count_;
+}
+
unsigned CoreTestBase_MockHandleInfo::GetCancelAllStateCallCount() const {
MutexLocker locker(&mutex_);
return cancel_all_awakables_call_count_;
@@ -440,6 +456,12 @@ void CoreTestBase_MockHandleInfo::IncrementRemoveAwakableCallCount() {
remove_awakable_call_count_++;
}
+void CoreTestBase_MockHandleInfo::
+ IncrementRemoveAwakableWithContextCallCount() {
+ MutexLocker locker(&mutex_);
+ remove_awakable_with_context_call_count_++;
+}
+
void CoreTestBase_MockHandleInfo::IncrementCancelAllStateCallCount() {
MutexLocker locker(&mutex_);
cancel_all_awakables_call_count_++;
« no previous file with comments | « mojo/edk/system/core_test_base.h ('k') | mojo/edk/system/data_pipe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698