OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MojoWatcher_h | 5 #ifndef MojoWatcher_h |
6 #define MojoWatcher_h | 6 #define MojoWatcher_h |
7 | 7 |
8 #include "bindings/core/v8/ActiveScriptWrappable.h" | 8 #include "bindings/core/v8/ActiveScriptWrappable.h" |
9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
10 #include "bindings/core/v8/TraceWrapperMember.h" | 10 #include "bindings/core/v8/TraceWrapperMember.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 bool hasPendingActivity() const final; | 40 bool hasPendingActivity() const final; |
41 | 41 |
42 // ContextLifecycleObserver | 42 // ContextLifecycleObserver |
43 void contextDestroyed(ExecutionContext*) final; | 43 void contextDestroyed(ExecutionContext*) final; |
44 | 44 |
45 private: | 45 private: |
46 friend class V8MojoWatcher; | 46 friend class V8MojoWatcher; |
47 | 47 |
48 MojoWatcher(ExecutionContext*, MojoWatchCallback*); | 48 MojoWatcher(ExecutionContext*, MojoWatchCallback*); |
49 MojoResult watch(mojo::Handle, const MojoHandleSignals&); | 49 MojoResult watch(mojo::Handle, const MojoHandleSignals&); |
| 50 void arm(); |
50 | 51 |
51 static void onHandleReady(uintptr_t context, | 52 static void onHandleReady(uintptr_t context, |
52 MojoResult, | 53 MojoResult, |
53 MojoHandleSignalsState, | 54 MojoHandleSignalsState, |
54 MojoWatchNotificationFlags); | 55 MojoWatchNotificationFlags); |
55 void runReadyCallback(MojoResult); | 56 void runReadyCallback(MojoResult); |
56 | 57 |
57 RefPtr<WebTaskRunner> m_taskRunner; | 58 RefPtr<WebTaskRunner> m_taskRunner; |
58 TraceWrapperMember<MojoWatchCallback> m_callback; | 59 TraceWrapperMember<MojoWatchCallback> m_callback; |
59 mojo::Handle m_handle; | 60 mojo::Handle m_handle; |
60 }; | 61 }; |
61 | 62 |
62 } // namespace blink | 63 } // namespace blink |
63 | 64 |
64 #endif // MojoWatcher_h | 65 #endif // MojoWatcher_h |
OLD | NEW |