#include "mojo/public/cpp/system/simple_watcher.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/synchronization/lock.h"
#include "base/task/common/task_annotator.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/trace_event/heap_profiler.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "mojo/public/c/system/trap.h"
#include "third_party/perfetto/protos/perfetto/trace/track_event/chrome_mojo_event_info.pbzero.h"
namespace mojo {
class SimpleWatcher::Context : public base::RefCountedThreadSafe<Context> { … };
SimpleWatcher::SimpleWatcher(const base::Location& from_here,
ArmingPolicy arming_policy,
scoped_refptr<base::SequencedTaskRunner> runner,
const char* handler_tag)
: … { … }
SimpleWatcher::~SimpleWatcher() { … }
bool SimpleWatcher::IsWatching() const { … }
MojoResult SimpleWatcher::Watch(Handle handle,
MojoHandleSignals signals,
MojoTriggerCondition condition,
ReadyCallbackWithState callback) { … }
void SimpleWatcher::Cancel() { … }
MojoResult SimpleWatcher::Arm(MojoResult* ready_result,
HandleSignalsState* ready_state) { … }
void SimpleWatcher::ArmOrNotify() { … }
void SimpleWatcher::OnHandleReady(int watch_id,
MojoResult result,
const HandleSignalsState& state) { … }
}