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

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

Issue 2400563002: Adds Mojo IDL. (Closed)
Patch Set: removes visitDOMWrapper Created 3 years, 10 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 2017 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/ActiveScriptWrappable.h"
9 #include "bindings/core/v8/ScriptWrappable.h"
10 #include "bindings/core/v8/TraceWrapperMember.h"
11 #include "core/dom/ContextLifecycleObserver.h"
12 #include "mojo/public/cpp/system/handle.h"
13
14 namespace blink {
15
16 class ExecutionContext;
17 class MojoHandleSignals;
18 class MojoWatchCallback;
19
20 class MojoWatcher final : public GarbageCollectedFinalized<MojoWatcher>,
21 public ActiveScriptWrappable<MojoWatcher>,
22 public ScriptWrappable,
23 public ContextLifecycleObserver {
24 DEFINE_WRAPPERTYPEINFO();
25 USING_GARBAGE_COLLECTED_MIXIN(MojoWatcher);
26
27 public:
28 static MojoWatcher* create(mojo::Handle,
29 const MojoHandleSignals&,
30 MojoWatchCallback*,
31 ExecutionContext*);
32 ~MojoWatcher();
33
34 MojoResult cancel();
35
36 DECLARE_TRACE();
37 DECLARE_TRACE_WRAPPERS();
38
39 // ActiveScriptWrappable
40 bool hasPendingActivity() const final;
41
42 // ContextLifecycleObserver
43 void contextDestroyed(ExecutionContext*) final;
44
45 private:
46 friend class V8MojoWatcher;
47
48 MojoWatcher(ExecutionContext*, MojoWatchCallback*);
49 MojoResult watch(mojo::Handle, const MojoHandleSignals&);
50
51 static void onHandleReady(uintptr_t context,
52 MojoResult,
53 MojoHandleSignalsState,
54 MojoWatchNotificationFlags);
55 void runReadyCallback(MojoResult);
56
57 RefPtr<WebTaskRunner> m_taskRunner;
58 TraceWrapperMember<MojoWatchCallback> m_callback;
59 mojo::Handle m_handle;
60 };
61
62 } // namespace blink
63
64 #endif // MojoWatcher_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698