#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "mojo/public/cpp/system/wait_set.h"
#include <algorithm>
#include <limits>
#include <map>
#include <set>
#include <vector>
#include "base/check_op.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/not_fatal_until.h"
#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h"
#include "mojo/public/cpp/system/trap.h"
#include "third_party/abseil-cpp/absl/container/inlined_vector.h"
namespace mojo {
class WaitSet::State : public base::RefCountedThreadSafe<State> { … };
WaitSet::WaitSet() : … { … }
WaitSet::~WaitSet() { … }
MojoResult WaitSet::AddEvent(base::WaitableEvent* event) { … }
MojoResult WaitSet::RemoveEvent(base::WaitableEvent* event) { … }
MojoResult WaitSet::AddHandle(Handle handle, MojoHandleSignals signals) { … }
MojoResult WaitSet::RemoveHandle(Handle handle) { … }
void WaitSet::Wait(base::WaitableEvent** ready_event,
size_t* num_ready_handles,
Handle* ready_handles,
MojoResult* ready_results,
MojoHandleSignalsState* signals_states) { … }
}