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

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

Issue 2400563002: Adds Mojo IDL. (Closed)
Patch Set: addressed comments Created 3 years, 11 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 "bindings/core/v8/TraceWrapperMember.h"
10 #include "mojo/public/cpp/system/handle.h"
11
12 namespace blink {
13
14 class ExecutionContext;
15 class MojoWatchCallback;
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 MojoWatchCallback*,
25 ExecutionContext*);
26 ~MojoWatcher();
27
28 MojoResult cancel();
29
30 DEFINE_INLINE_TRACE() {}
31 DECLARE_TRACE_WRAPPERS();
32
33 private:
34 friend class V8MojoWatcher;
35
36 MojoWatcher(mojo::Handle, MojoWatchCallback*, ExecutionContext*);
37 static void onHandleReady(uintptr_t context,
38 MojoResult,
39 MojoHandleSignalsState,
40 MojoWatchNotificationFlags);
41 void runReadyCallback(MojoResult);
42
43 mojo::Handle m_handle;
44 TraceWrapperMember<MojoWatchCallback> m_callback;
45 CrossThreadWeakPersistent<ExecutionContext> m_taskRunner;
46 };
47
48 } // namespace blink
49
50 #endif // MojoWatcher_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698