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..5a1c46e72c332fcaae5f6b0ebe8f0d8e4fa75698 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/mojo/MojoWatcher.h |
| @@ -0,0 +1,54 @@ |
| +// 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 MojoWatchCallback; |
| +class ScriptState; |
| +class WebTaskRunner; |
| + |
| +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; |
|
esprehn
2016/10/25 03:34:06
Why friends?
alokp
2016/10/25 05:01:37
V8MojoWatcher accesses m_callback to call setWrapp
|
| + class RunReadyCallbackTask; |
| + |
| + MojoWatcher(mojo::Handle, |
| + ScriptState*, |
| + MojoWatchCallback*, |
| + std::unique_ptr<WebTaskRunner>); |
| + static void onHandleReady(uintptr_t, |
|
esprehn
2016/10/25 03:34:07
add argument names for primitive types
alokp
2016/10/25 05:01:37
Done.
|
| + MojoResult, |
| + MojoHandleSignalsState, |
| + MojoWatchNotificationFlags); |
| + void runReadyCallback(MojoResult); |
| + |
| + mojo::Handle m_handle; |
|
esprehn
2016/10/25 03:34:06
Hmm, you use mojo::ScopedHandle in Handle, but jus
alokp
2016/10/25 05:01:37
Because blink::MojoHandle owns mojo::Handle (close
|
| + RefPtr<ScriptState> m_scriptState; |
| + Member<MojoWatchCallback> m_callback; |
| + std::unique_ptr<WebTaskRunner> m_taskRunner; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // MojoWatcher_h |