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

Side by Side Diff: mojo/public/utility/run_loop.h

Issue 126883002: Make RunLoop remove handle when a timeout is notified (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add const to HasHandler() 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
« no previous file with comments | « no previous file | mojo/public/utility/run_loop.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_PUBLIC_UTILITY_RUN_LOOP_H_ 5 #ifndef MOJO_PUBLIC_UTILITY_RUN_LOOP_H_
6 #define MOJO_PUBLIC_UTILITY_RUN_LOOP_H_ 6 #define MOJO_PUBLIC_UTILITY_RUN_LOOP_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "mojo/public/system/core_cpp.h" 10 #include "mojo/public/system/core_cpp.h"
(...skipping 19 matching lines...) Expand all
30 // created. 30 // created.
31 static RunLoop* current(); 31 static RunLoop* current();
32 32
33 // Registers a RunLoopHandler for the specified handle. Only one handler can 33 // Registers a RunLoopHandler for the specified handle. Only one handler can
34 // be registered for a specified handle. 34 // be registered for a specified handle.
35 void AddHandler(RunLoopHandler* handler, 35 void AddHandler(RunLoopHandler* handler,
36 const Handle& handle, 36 const Handle& handle,
37 MojoWaitFlags wait_flags, 37 MojoWaitFlags wait_flags,
38 MojoDeadline deadline); 38 MojoDeadline deadline);
39 void RemoveHandler(const Handle& handle); 39 void RemoveHandler(const Handle& handle);
40 bool HasHandler(const Handle& handle) const;
40 41
41 // Runs the loop servicing handles as they are ready. This returns when Quit() 42 // Runs the loop servicing handles as they are ready. This returns when Quit()
42 // is invoked, or there no more handles. 43 // is invoked, or there no more handles.
43 void Run(); 44 void Run();
44 void Quit(); 45 void Quit();
45 46
46 private: 47 private:
47 struct RunState; 48 struct RunState;
48 struct WaitState; 49 struct WaitState;
49 50
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // notify it. 92 // notify it.
92 int next_handler_id_; 93 int next_handler_id_;
93 94
94 MOJO_DISALLOW_COPY_AND_ASSIGN(RunLoop); 95 MOJO_DISALLOW_COPY_AND_ASSIGN(RunLoop);
95 }; 96 };
96 97
97 } // namespace utility 98 } // namespace utility
98 } // namespace mojo 99 } // namespace mojo
99 100
100 #endif // MOJO_PUBLIC_UTILITY_RUN_LOOP_H_ 101 #endif // MOJO_PUBLIC_UTILITY_RUN_LOOP_H_
OLDNEW
« no previous file with comments | « no previous file | mojo/public/utility/run_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698