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

Side by Side Diff: mojo/public/tests/bindings/simple_bindings_support.h

Issue 134253004: Mojo: AsyncWaiter and mojo/public/environment (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing files Created 6 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 | Annotate | Revision Log
OLDNEW
(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_TESTS_SIMPLE_BINDINGS_SUPPORT_H_
6 #define MOJO_PUBLIC_TESTS_SIMPLE_BINDINGS_SUPPORT_H_
7
8 #include <list>
9
10 #include "mojo/public/bindings/lib/bindings_support.h"
11
12 namespace mojo {
13 namespace test {
14
15 class SimpleBindingsSupport : public BindingsSupport {
16 public:
17 SimpleBindingsSupport();
18 virtual ~SimpleBindingsSupport();
19
20 virtual Buffer* SetCurrentBuffer(Buffer* buf) MOJO_OVERRIDE;
21 virtual Buffer* GetCurrentBuffer() MOJO_OVERRIDE;
22
23 virtual AsyncWaitID AsyncWait(const Handle& handle,
24 MojoWaitFlags flags,
25 AsyncWaitCallback* callback) MOJO_OVERRIDE;
26 virtual void CancelWait(AsyncWaitID async_wait_id) MOJO_OVERRIDE;
27
28 // This method is called by unit tests to check the status of any handles
29 // that we are asynchronously waiting on and to dispatch callbacks for any
30 // handles that are ready.
31 void Process();
32
33 private:
34 bool IsReady(const Handle& handle, MojoWaitFlags flags, MojoResult* result);
35
36 struct Waiter {
37 Handle handle;
38 MojoWaitFlags flags;
39 AsyncWaitCallback* callback;
40 };
41
42 typedef std::list<Waiter*> WaiterList;
43 WaiterList waiters_;
44
45 Buffer* buf_;
46 };
47
48 } // namespace test
49 } // namespace mojo
50
51 #endif // MOJO_PUBLIC_TESTS_SIMPLE_BINDINGS_SUPPORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698