OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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_CPP_BINDINGS_LIB_INTERFACE_ENDPOINT_CONTROLLER_H_ |
| 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_ENDPOINT_CONTROLLER_H_ |
| 7 |
| 8 namespace mojo { |
| 9 |
| 10 class Message; |
| 11 |
| 12 namespace internal { |
| 13 |
| 14 // A control interface exposed by MultiplexRouter for interface endpoints. |
| 15 class InterfaceEndpointController { |
| 16 public: |
| 17 virtual ~InterfaceEndpointController() {} |
| 18 |
| 19 virtual bool SendMessage(Message* message) = 0; |
| 20 |
| 21 // Allows the interface endpoint to watch for incoming sync messages while |
| 22 // others perform sync handle watching on the same thread. Please see comments |
| 23 // of SyncHandleWatcher::AllowWokenUpBySyncWatchOnSameThread(). |
| 24 virtual void AllowWokenUpBySyncWatchOnSameThread() = 0; |
| 25 |
| 26 // Watches the interface endpoint for incoming sync messages. (It also watches |
| 27 // other other handles registered to be watched together.) |
| 28 // This method: |
| 29 // - returns true when |should_stop| is set to true; |
| 30 // - return false otherwise, including |
| 31 // MultiplexRouter::DetachEndpointClient() being called for the same |
| 32 // interface endpoint. |
| 33 virtual bool SyncWatch(const bool* should_stop) = 0; |
| 34 }; |
| 35 |
| 36 } // namespace internal |
| 37 } // namespace mojo |
| 38 |
| 39 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_ENDPOINT_CONTROLLER_H_ |
OLD | NEW |