OLD | NEW |
| (Empty) |
1 // Copyright 2013 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 MOJO_PUBLIC_UTILITY_BINDINGS_SUPPORT_IMPL_H_ | |
6 #define MOJO_PUBLIC_UTILITY_BINDINGS_SUPPORT_IMPL_H_ | |
7 | |
8 #include "mojo/public/bindings/lib/bindings_support.h" | |
9 #include "mojo/public/system/macros.h" | |
10 | |
11 namespace mojo { | |
12 namespace internal { | |
13 | |
14 // BindingsSupport implementation that uses RunLoop. Before using this you must | |
15 // have created a RunLoop on the current thread. | |
16 // You shouldn't create this directly, instead use Environment. | |
17 class BindingsSupportImpl : public BindingsSupport { | |
18 public: | |
19 BindingsSupportImpl(); | |
20 virtual ~BindingsSupportImpl(); | |
21 | |
22 // Sets up state needed for BindingsSupportImpl. This must be invoked before | |
23 // creating a BindingsSupportImpl. | |
24 static void SetUp(); | |
25 | |
26 // Cleans state created by Setup(). | |
27 static void TearDown(); | |
28 | |
29 // BindingsSupport methods: | |
30 virtual Buffer* GetCurrentBuffer() MOJO_OVERRIDE; | |
31 virtual Buffer* SetCurrentBuffer(Buffer* buf) MOJO_OVERRIDE; | |
32 virtual AsyncWaitID AsyncWait(const Handle& handle, | |
33 MojoWaitFlags flags, | |
34 AsyncWaitCallback* callback) MOJO_OVERRIDE; | |
35 virtual void CancelWait(AsyncWaitID async_wait_id) MOJO_OVERRIDE; | |
36 | |
37 private: | |
38 MOJO_DISALLOW_COPY_AND_ASSIGN(BindingsSupportImpl); | |
39 }; | |
40 | |
41 } // namespace internal | |
42 } // namespace mojo | |
43 | |
44 #endif // MOJO_PUBLIC_UTILITY_BINDINGS_SUPPORT_IMPL_H_ | |
OLD | NEW |