#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "mojo/public/cpp/bindings/sync_handle_registry.h"
#include <algorithm>
#include <map>
#include <utility>
#include "base/auto_reset.h"
#include "base/check_op.h"
#include "base/containers/contains.h"
#include "base/memory/scoped_refptr.h"
#include "base/not_fatal_until.h"
#include "base/synchronization/waitable_event.h"
#include "base/task/sequenced_task_runner.h"
#include "base/threading/sequence_local_storage_slot.h"
#include "base/types/pass_key.h"
#include "mojo/public/c/system/core.h"
namespace mojo {
SyncHandleRegistry::Subscription::Subscription(base::OnceClosure remove_closure,
EventCallbackList* callbacks,
EventCallback event_callback)
: … { … }
SyncHandleRegistry::Subscription::Subscription(Subscription&&) = default;
SyncHandleRegistry::Subscription& SyncHandleRegistry::Subscription::operator=(
Subscription&&) = default;
SyncHandleRegistry::Subscription::~Subscription() = default;
scoped_refptr<SyncHandleRegistry> SyncHandleRegistry::current() { … }
SyncHandleRegistry::SyncHandleRegistry(base::PassKey<SyncHandleRegistry>) { … }
bool SyncHandleRegistry::RegisterHandle(const Handle& handle,
MojoHandleSignals handle_signals,
HandleCallback callback) { … }
void SyncHandleRegistry::UnregisterHandle(const Handle& handle) { … }
SyncHandleRegistry::EventCallbackSubscription SyncHandleRegistry::RegisterEvent(
base::WaitableEvent* event,
EventCallback callback) { … }
bool SyncHandleRegistry::Wait(const bool* should_stop[], size_t count) { … }
SyncHandleRegistry::~SyncHandleRegistry() = default;
}