| Index: mojo/edk/system/watcher_set.cc
|
| diff --git a/mojo/edk/system/watcher_set.cc b/mojo/edk/system/watcher_set.cc
|
| index 878f29a54b2987b6bc956820aa7619777d0f33a7..2b10040429fcb1091c79808834c23eab4523f8c5 100644
|
| --- a/mojo/edk/system/watcher_set.cc
|
| +++ b/mojo/edk/system/watcher_set.cc
|
| @@ -14,9 +14,9 @@ WatcherSet::WatcherSet() {}
|
|
|
| WatcherSet::~WatcherSet() {}
|
|
|
| -void WatcherSet::NotifyForStateChange(const HandleSignalsState& state) {
|
| +void WatcherSet::NotifyState(const HandleSignalsState& state) {
|
| for (const auto& entry : watchers_)
|
| - entry.second->NotifyForStateChange(state);
|
| + entry.second->NotifyState(state);
|
| }
|
|
|
| void WatcherSet::NotifyClosed() {
|
| @@ -38,11 +38,18 @@ MojoResult WatcherSet::Add(MojoHandleSignals signals,
|
| scoped_refptr<Watcher> watcher(new Watcher(signals, callback));
|
| watchers_.insert(std::make_pair(context, watcher));
|
|
|
| - watcher->NotifyForStateChange(current_state);
|
| -
|
| return MOJO_RESULT_OK;
|
| }
|
|
|
| +MojoResult WatcherSet::Arm(uintptr_t context,
|
| + const HandleSignalsState& current_state) {
|
| + auto it = watchers_.find(context);
|
| + if (it == watchers_.end())
|
| + return MOJO_RESULT_INVALID_ARGUMENT;
|
| +
|
| + return it->second->Arm(current_state);
|
| +}
|
| +
|
| MojoResult WatcherSet::Remove(uintptr_t context) {
|
| auto it = watchers_.find(context);
|
| if (it == watchers_.end())
|
|
|