OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_ROUTER_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_ROUTER_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_ROUTER_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_ROUTER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "mojo/public/cpp/bindings/lib/connector.h" | 10 #include "mojo/public/cpp/bindings/lib/connector.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 } | 41 } |
42 | 42 |
43 // Returns true if an error was encountered while reading from the pipe or | 43 // Returns true if an error was encountered while reading from the pipe or |
44 // waiting to read from the pipe. | 44 // waiting to read from the pipe. |
45 bool encountered_error() const { return connector_.encountered_error(); } | 45 bool encountered_error() const { return connector_.encountered_error(); } |
46 | 46 |
47 void CloseMessagePipe() { | 47 void CloseMessagePipe() { |
48 connector_.CloseMessagePipe(); | 48 connector_.CloseMessagePipe(); |
49 } | 49 } |
50 | 50 |
51 ScopedMessagePipeHandle ReleaseMessagePipe() { | 51 ScopedMessagePipeHandle PassMessagePipe() { |
52 return connector_.ReleaseMessagePipe(); | 52 return connector_.PassMessagePipe(); |
53 } | 53 } |
54 | 54 |
55 // MessageReceiver implementation: | 55 // MessageReceiver implementation: |
56 virtual bool Accept(Message* message) MOJO_OVERRIDE; | 56 virtual bool Accept(Message* message) MOJO_OVERRIDE; |
57 virtual bool AcceptWithResponder(Message* message, MessageReceiver* responder) | 57 virtual bool AcceptWithResponder(Message* message, MessageReceiver* responder) |
58 MOJO_OVERRIDE; | 58 MOJO_OVERRIDE; |
59 | 59 |
60 private: | 60 private: |
61 typedef std::map<uint64_t, MessageReceiver*> ResponderMap; | 61 typedef std::map<uint64_t, MessageReceiver*> ResponderMap; |
62 | 62 |
(...skipping 17 matching lines...) Expand all Loading... |
80 SharedData<Router*> weak_self_; | 80 SharedData<Router*> weak_self_; |
81 MessageReceiverWithResponder* incoming_receiver_; | 81 MessageReceiverWithResponder* incoming_receiver_; |
82 ResponderMap responders_; | 82 ResponderMap responders_; |
83 uint64_t next_request_id_; | 83 uint64_t next_request_id_; |
84 }; | 84 }; |
85 | 85 |
86 } // namespace internal | 86 } // namespace internal |
87 } // namespace mojo | 87 } // namespace mojo |
88 | 88 |
89 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ROUTER_H_ | 89 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ROUTER_H_ |
OLD | NEW |