Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: third_party/WebKit/Source/core/mojo/MojoWatcher.h

Issue 2405093003: [WIP] Mojo native bindings interface.
Patch Set: custom visitDomWrapper Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MojoWatcher_h
6 #define MojoWatcher_h
7
8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "mojo/public/cpp/system/handle.h"
10
11 namespace blink {
12
13 class MojoWatchCallback;
14 class ScriptState;
15 class WebTaskRunner;
16
17 class MojoWatcher final : public GarbageCollectedFinalized<MojoWatcher>,
18 public ScriptWrappable {
19 DEFINE_WRAPPERTYPEINFO();
20
21 public:
22 static MojoWatcher* create(mojo::Handle,
23 MojoHandleSignals,
24 ScriptState*,
25 MojoWatchCallback*);
26 virtual ~MojoWatcher();
27
28 MojoResult cancel();
29
30 DECLARE_TRACE();
31
32 private:
33 friend class V8MojoWatcher;
34 class RunReadyCallbackTask;
35
36 MojoWatcher(mojo::Handle,
37 ScriptState*,
38 MojoWatchCallback*,
39 std::unique_ptr<WebTaskRunner>);
40 static void onHandleReady(uintptr_t,
41 MojoResult,
42 MojoHandleSignalsState,
43 MojoWatchNotificationFlags);
44 void runReadyCallback(MojoResult);
45
46 mojo::Handle m_handle;
47 RefPtr<ScriptState> m_scriptState;
48 Member<MojoWatchCallback> m_callback;
49 std::unique_ptr<WebTaskRunner> m_taskRunner;
50 };
51
52 } // namespace blink
53
54 #endif // MojoWatcher_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698