| 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_PUBLIC_CPP_BINDINGS_LIB_CONNECTOR_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_CONNECTOR_H_ |
| 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_CONNECTOR_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_CONNECTOR_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 // Waits for the next message on the pipe, blocking until one arrives, | 105 // Waits for the next message on the pipe, blocking until one arrives, |
| 106 // |deadline| elapses, or an error happens. Returns |true| if a message has | 106 // |deadline| elapses, or an error happens. Returns |true| if a message has |
| 107 // been delivered, |false| otherwise. | 107 // been delivered, |false| otherwise. |
| 108 bool WaitForIncomingMessage(MojoDeadline deadline); | 108 bool WaitForIncomingMessage(MojoDeadline deadline); |
| 109 | 109 |
| 110 // See Binding for details of pause/resume. | 110 // See Binding for details of pause/resume. |
| 111 void PauseIncomingMethodCallProcessing(); | 111 void PauseIncomingMethodCallProcessing(); |
| 112 void ResumeIncomingMethodCallProcessing(); | 112 void ResumeIncomingMethodCallProcessing(); |
| 113 | 113 |
| 114 // See Binding for comments. |
| 115 void SetAllowSyncDispatch(bool allowed); |
| 116 |
| 114 // MessageReceiver implementation: | 117 // MessageReceiver implementation: |
| 115 bool Accept(Message* message) override; | 118 bool Accept(Message* message) override; |
| 116 | 119 |
| 117 MessagePipeHandle handle() const { | 120 MessagePipeHandle handle() const { |
| 118 DCHECK(thread_checker_.CalledOnValidThread()); | 121 DCHECK(thread_checker_.CalledOnValidThread()); |
| 119 return message_pipe_.get(); | 122 return message_pipe_.get(); |
| 120 } | 123 } |
| 121 | 124 |
| 122 // Requests to register |message_pipe_| with SyncHandleWatcher whenever this | 125 // Requests to register |message_pipe_| with SyncHandleWatcher whenever this |
| 123 // instance is expecting incoming messages. | 126 // instance is expecting incoming messages. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 base::WeakPtr<Connector> weak_self_; | 200 base::WeakPtr<Connector> weak_self_; |
| 198 base::WeakPtrFactory<Connector> weak_factory_; | 201 base::WeakPtrFactory<Connector> weak_factory_; |
| 199 | 202 |
| 200 DISALLOW_COPY_AND_ASSIGN(Connector); | 203 DISALLOW_COPY_AND_ASSIGN(Connector); |
| 201 }; | 204 }; |
| 202 | 205 |
| 203 } // namespace internal | 206 } // namespace internal |
| 204 } // namespace mojo | 207 } // namespace mojo |
| 205 | 208 |
| 206 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_CONNECTOR_H_ | 209 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_CONNECTOR_H_ |
| OLD | NEW |