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

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

Issue 1748503002: [mojo-edk] Add MojoWatch and MojoCancelWatch APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 10 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
Index: mojo/edk/system/handle_table.cc
diff --git a/mojo/edk/system/handle_table.cc b/mojo/edk/system/handle_table.cc
index 7aeca64110919325494ec0b6bd7331a814e9699d..296cf795588baa4c19a74d146bf6c2195d20381b 100644
--- a/mojo/edk/system/handle_table.cc
+++ b/mojo/edk/system/handle_table.cc
@@ -74,7 +74,8 @@ MojoResult HandleTable::GetAndRemoveDispatcher(
MojoResult HandleTable::BeginTransit(
const MojoHandle* handles,
uint32_t num_handles,
- std::vector<Dispatcher::DispatcherInTransit>* dispatchers) {
+ std::vector<Dispatcher::DispatcherInTransit>* dispatchers,
+ Dispatcher::RequestContext* request_context) {
dispatchers->clear();
dispatchers->reserve(num_handles);
for (size_t i = 0; i < num_handles; ++i) {
@@ -87,7 +88,7 @@ MojoResult HandleTable::BeginTransit(
Dispatcher::DispatcherInTransit d;
d.local_handle = handles[i];
d.dispatcher = it->second.dispatcher;
- if (!d.dispatcher->BeginTransit())
+ if (!d.dispatcher->BeginTransit(request_context))
return MOJO_RESULT_BUSY;
it->second.busy = true;
dispatchers->push_back(d);
@@ -96,22 +97,24 @@ MojoResult HandleTable::BeginTransit(
}
void HandleTable::CompleteTransitAndClose(
- const std::vector<Dispatcher::DispatcherInTransit>& dispatchers) {
+ const std::vector<Dispatcher::DispatcherInTransit>& dispatchers,
+ Dispatcher::RequestContext* request_context) {
for (const auto& dispatcher : dispatchers) {
auto it = handles_.find(dispatcher.local_handle);
DCHECK(it != handles_.end() && it->second.busy);
handles_.erase(it);
- dispatcher.dispatcher->CompleteTransitAndClose();
+ dispatcher.dispatcher->CompleteTransitAndClose(request_context);
}
}
void HandleTable::CancelTransit(
- const std::vector<Dispatcher::DispatcherInTransit>& dispatchers) {
+ const std::vector<Dispatcher::DispatcherInTransit>& dispatchers,
+ Dispatcher::RequestContext* request_context) {
for (const auto& dispatcher : dispatchers) {
auto it = handles_.find(dispatcher.local_handle);
DCHECK(it != handles_.end() && it->second.busy);
it->second.busy = false;
- dispatcher.dispatcher->CancelTransit();
+ dispatcher.dispatcher->CancelTransit(request_context);
}
}

Powered by Google App Engine
This is Rietveld 408576698