// Copyright 2017 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef MOJO_PUBLIC_CPP_SYSTEM_SIMPLE_WATCHER_H_ #define MOJO_PUBLIC_CPP_SYSTEM_SIMPLE_WATCHER_H_ #include "base/functional/bind.h" #include "base/functional/callback.h" #include "base/location.h" #include "base/memory/scoped_refptr.h" #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" #include "base/task/sequenced_task_runner.h" #include "mojo/public/c/system/types.h" #include "mojo/public/cpp/system/handle_signals_state.h" #include "mojo/public/cpp/system/system_export.h" #include "mojo/public/cpp/system/trap.h" namespace base { class SequencedTaskRunner; } namespace mojo { // This provides a convenient sequence-bound watcher implementation to safely // watch a single handle, dispatching state change notifications to an arbitrary // SequencedTaskRunner running on the same sequence as the SimpleWatcher. // // SimpleWatcher exposes the concept of "arming" from the low-level Watcher API. // In general, a SimpleWatcher must be "armed" in order to dispatch a single // notification, and must then be rearmed before it will dispatch another. For // more details, see the documentation for ArmingPolicy and the Arm() and // ArmOrNotify() methods below. class MOJO_CPP_SYSTEM_EXPORT SimpleWatcher { … }; } // namespace mojo #endif // MOJO_PUBLIC_CPP_SYSTEM_SIMPLE_WATCHER_H_