| Index: third_party/WebKit/Source/core/mojo/MojoWatcher.h
|
| diff --git a/third_party/WebKit/Source/core/mojo/MojoWatcher.h b/third_party/WebKit/Source/core/mojo/MojoWatcher.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8cdf1ffd9605995e7680e0720f5fc81ae9b6377d
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/mojo/MojoWatcher.h
|
| @@ -0,0 +1,62 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef MojoWatcher_h
|
| +#define MojoWatcher_h
|
| +
|
| +#include "bindings/core/v8/ActiveScriptWrappable.h"
|
| +#include "bindings/core/v8/ScriptWrappable.h"
|
| +#include "bindings/core/v8/TraceWrapperMember.h"
|
| +#include "core/dom/ContextLifecycleObserver.h"
|
| +#include "mojo/public/cpp/system/handle.h"
|
| +
|
| +namespace blink {
|
| +
|
| +class ExecutionContext;
|
| +class MojoHandleSignals;
|
| +class MojoWatchCallback;
|
| +
|
| +class MojoWatcher final : public GarbageCollectedFinalized<MojoWatcher>,
|
| + public ActiveScriptWrappable<MojoWatcher>,
|
| + public ScriptWrappable,
|
| + public ContextLifecycleObserver {
|
| + DEFINE_WRAPPERTYPEINFO();
|
| + USING_GARBAGE_COLLECTED_MIXIN(MojoWatcher);
|
| +
|
| + public:
|
| + static MojoWatcher* create(mojo::Handle,
|
| + const MojoHandleSignals&,
|
| + MojoWatchCallback*,
|
| + ExecutionContext*);
|
| + ~MojoWatcher();
|
| +
|
| + MojoResult cancel();
|
| +
|
| + DECLARE_TRACE();
|
| + DECLARE_TRACE_WRAPPERS();
|
| +
|
| + // ActiveScriptWrappable
|
| + bool hasPendingActivity() const final;
|
| +
|
| + // ContextLifecycleObserver
|
| + void contextDestroyed(ExecutionContext*) final;
|
| +
|
| + private:
|
| + friend class V8MojoWatcher;
|
| +
|
| + MojoWatcher(mojo::Handle, MojoWatchCallback*, ExecutionContext*);
|
| + static void onHandleReady(uintptr_t context,
|
| + MojoResult,
|
| + MojoHandleSignalsState,
|
| + MojoWatchNotificationFlags);
|
| + void runReadyCallback(MojoResult);
|
| +
|
| + mojo::Handle m_handle;
|
| + TraceWrapperMember<MojoWatchCallback> m_callback;
|
| + RefPtr<WebTaskRunner> m_taskRunner;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // MojoWatcher_h
|
|
|