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" |
11 #include "mojo/public/cpp/bindings/lib/filter_chain.h" | 11 #include "mojo/public/cpp/bindings/lib/filter_chain.h" |
12 #include "mojo/public/cpp/bindings/lib/shared_data.h" | 12 #include "mojo/public/cpp/bindings/lib/shared_data.h" |
| 13 #include "mojo/public/cpp/environment/environment.h" |
13 | 14 |
14 namespace mojo { | 15 namespace mojo { |
15 namespace internal { | 16 namespace internal { |
16 | 17 |
17 class Router : public MessageReceiverWithResponder { | 18 class Router : public MessageReceiverWithResponder { |
18 public: | 19 public: |
19 Router(ScopedMessagePipeHandle message_pipe, | 20 Router(ScopedMessagePipeHandle message_pipe, |
20 FilterChain filters, | 21 FilterChain filters, |
21 const MojoAsyncWaiter* waiter = GetDefaultAsyncWaiter()); | 22 const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()); |
22 virtual ~Router(); | 23 virtual ~Router(); |
23 | 24 |
24 // Sets the receiver to handle messages read from the message pipe that do | 25 // Sets the receiver to handle messages read from the message pipe that do |
25 // not have the kMessageIsResponse flag set. | 26 // not have the kMessageIsResponse flag set. |
26 void set_incoming_receiver(MessageReceiverWithResponder* receiver) { | 27 void set_incoming_receiver(MessageReceiverWithResponder* receiver) { |
27 incoming_receiver_ = receiver; | 28 incoming_receiver_ = receiver; |
28 } | 29 } |
29 | 30 |
30 // Sets the error handler to receive notifications when an error is | 31 // Sets the error handler to receive notifications when an error is |
31 // encountered while reading from the pipe or waiting to read from the pipe. | 32 // encountered while reading from the pipe or waiting to read from the pipe. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 MessageReceiverWithResponder* incoming_receiver_; | 82 MessageReceiverWithResponder* incoming_receiver_; |
82 ResponderMap responders_; | 83 ResponderMap responders_; |
83 uint64_t next_request_id_; | 84 uint64_t next_request_id_; |
84 bool testing_mode_; | 85 bool testing_mode_; |
85 }; | 86 }; |
86 | 87 |
87 } // namespace internal | 88 } // namespace internal |
88 } // namespace mojo | 89 } // namespace mojo |
89 | 90 |
90 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ROUTER_H_ | 91 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ROUTER_H_ |
OLD | NEW |