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

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

Issue 2405093003: [WIP] Mojo native bindings interface.
Patch Set: cleanup 2 Created 4 years, 2 months 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 class RunReadyCallbackTask;
34
35 MojoWatcher(mojo::Handle,
36 ScriptState*,
37 MojoWatchCallback*,
38 std::unique_ptr<WebTaskRunner>);
39 static void onHandleReady(uintptr_t,
40 MojoResult,
41 MojoHandleSignalsState,
42 MojoWatchNotificationFlags);
43 void runReadyCallback(MojoResult);
44
45 mojo::Handle m_handle;
46 RefPtr<ScriptState> m_scriptState;
47 Member<MojoWatchCallback> m_callback;
48 std::unique_ptr<WebTaskRunner> m_taskRunner;
49 };
50
51 } // namespace blink
52
53 #endif // MojoWatcher_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698