Chromium Code Reviews| 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..deb6f42fa7df7780b40465f88ae6e5f2c36ff4c5 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/mojo/MojoWatcher.h |
| @@ -0,0 +1,50 @@ |
| +// Copyright 2016 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/ScriptWrappable.h" |
| +#include "mojo/public/cpp/system/handle.h" |
| + |
| +namespace blink { |
| + |
| +class ExecutionContext; |
| +class MojoWatchCallback; |
| +class ScriptState; |
| + |
| +class MojoWatcher final : public GarbageCollectedFinalized<MojoWatcher>, |
| + public ScriptWrappable { |
| + DEFINE_WRAPPERTYPEINFO(); |
| + |
| + public: |
| + static MojoWatcher* create(mojo::Handle, |
| + MojoHandleSignals, |
| + ScriptState*, |
| + MojoWatchCallback*); |
| + virtual ~MojoWatcher(); |
| + |
| + MojoResult cancel(); |
| + |
| + DECLARE_TRACE(); |
| + |
| + private: |
| + friend class V8MojoWatcher; |
| + |
| + MojoWatcher(mojo::Handle, ScriptState*, MojoWatchCallback*); |
| + static void onHandleReady(uintptr_t context, |
| + MojoResult, |
| + MojoHandleSignalsState, |
| + MojoWatchNotificationFlags); |
| + void runReadyCallback(MojoResult); |
| + |
| + mojo::Handle m_handle; |
| + ScriptState* m_scriptState; |
| + Member<MojoWatchCallback> m_callback; |
|
jbroman
2016/12/20 23:21:57
This should be a TraceWrapperMember, because if Tr
alokp
2017/01/09 23:33:10
Done.
|
| + CrossThreadWeakPersistent<ExecutionContext> m_taskRunner; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // MojoWatcher_h |