| OLD | NEW |
| 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_COMMON_MESSAGE_PUMP_MOJO_H_ | 5 #ifndef MOJO_COMMON_MESSAGE_PUMP_MOJO_H_ |
| 6 #define MOJO_COMMON_MESSAGE_PUMP_MOJO_H_ | 6 #define MOJO_COMMON_MESSAGE_PUMP_MOJO_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 typedef std::map<Handle, Handler> HandleToHandler; | 84 typedef std::map<Handle, Handler> HandleToHandler; |
| 85 | 85 |
| 86 // Implementation of Run(). | 86 // Implementation of Run(). |
| 87 void DoRunLoop(RunState* run_state, Delegate* delegate); | 87 void DoRunLoop(RunState* run_state, Delegate* delegate); |
| 88 | 88 |
| 89 // Services the set of handles ready. If |block| is true this waits for a | 89 // Services the set of handles ready. If |block| is true this waits for a |
| 90 // handle to become ready, otherwise this does not block. Returns |true| if a | 90 // handle to become ready, otherwise this does not block. Returns |true| if a |
| 91 // handle has become ready, |false| otherwise. | 91 // handle has become ready, |false| otherwise. |
| 92 bool DoInternalWork(const RunState& run_state, bool block); | 92 bool DoInternalWork(const RunState& run_state, bool block); |
| 93 | 93 |
| 94 // Removes the first invalid handle. This is called if MojoWaitMany finds an | 94 // Removes the given invalid handle. This is called if MojoWaitMany finds an |
| 95 // invalid handle. | 95 // invalid handle. |
| 96 void RemoveFirstInvalidHandle(const WaitState& wait_state); | 96 void RemoveInvalidHandle(const WaitState& wait_state, |
| 97 MojoResult result, |
| 98 uint32_t result_index); |
| 97 | 99 |
| 98 void SignalControlPipe(const RunState& run_state); | 100 void SignalControlPipe(const RunState& run_state); |
| 99 | 101 |
| 100 WaitState GetWaitState(const RunState& run_state) const; | 102 WaitState GetWaitState(const RunState& run_state) const; |
| 101 | 103 |
| 102 // Returns the deadline for the call to MojoWaitMany(). | 104 // Returns the deadline for the call to MojoWaitMany(). |
| 103 MojoDeadline GetDeadlineForWait(const RunState& run_state) const; | 105 MojoDeadline GetDeadlineForWait(const RunState& run_state) const; |
| 104 | 106 |
| 105 void WillSignalHandler(); | 107 void WillSignalHandler(); |
| 106 void DidSignalHandler(); | 108 void DidSignalHandler(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 125 | 127 |
| 126 ObserverList<Observer> observers_; | 128 ObserverList<Observer> observers_; |
| 127 | 129 |
| 128 DISALLOW_COPY_AND_ASSIGN(MessagePumpMojo); | 130 DISALLOW_COPY_AND_ASSIGN(MessagePumpMojo); |
| 129 }; | 131 }; |
| 130 | 132 |
| 131 } // namespace common | 133 } // namespace common |
| 132 } // namespace mojo | 134 } // namespace mojo |
| 133 | 135 |
| 134 #endif // MOJO_COMMON_MESSAGE_PUMP_MOJO_H_ | 136 #endif // MOJO_COMMON_MESSAGE_PUMP_MOJO_H_ |
| OLD | NEW |