| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <queue> | 11 #include <queue> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
| 17 #include "mojo/public/cpp/bindings/callback.h" | 17 #include "mojo/public/cpp/bindings/callback.h" |
| 18 #include "mojo/public/cpp/bindings/lib/connector.h" | 18 #include "mojo/public/cpp/bindings/lib/connector.h" |
| 19 #include "mojo/public/cpp/bindings/lib/filter_chain.h" | 19 #include "mojo/public/cpp/bindings/lib/filter_chain.h" |
| 20 | 20 |
| 21 namespace mojo { | 21 namespace mojo { |
| 22 namespace internal { | 22 namespace internal { |
| 23 | 23 |
| 24 // TODO(yzshen): Consider removing this class and use MultiplexRouter in all |
| 25 // cases. crbug.com/594244 |
| 24 class Router : public MessageReceiverWithResponder { | 26 class Router : public MessageReceiverWithResponder { |
| 25 public: | 27 public: |
| 26 Router(ScopedMessagePipeHandle message_pipe, | 28 Router(ScopedMessagePipeHandle message_pipe, |
| 27 FilterChain filters, | 29 FilterChain filters, |
| 28 bool expects_sync_requests); | 30 bool expects_sync_requests); |
| 29 ~Router() override; | 31 ~Router() override; |
| 30 | 32 |
| 31 // Sets the receiver to handle messages read from the message pipe that do | 33 // Sets the receiver to handle messages read from the message pipe that do |
| 32 // not have the kMessageIsResponse flag set. | 34 // not have the kMessageIsResponse flag set. |
| 33 void set_incoming_receiver(MessageReceiverWithResponderStatus* receiver) { | 35 void set_incoming_receiver(MessageReceiverWithResponderStatus* receiver) { |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 bool encountered_error_; | 164 bool encountered_error_; |
| 163 Closure error_handler_; | 165 Closure error_handler_; |
| 164 base::ThreadChecker thread_checker_; | 166 base::ThreadChecker thread_checker_; |
| 165 base::WeakPtrFactory<Router> weak_factory_; | 167 base::WeakPtrFactory<Router> weak_factory_; |
| 166 }; | 168 }; |
| 167 | 169 |
| 168 } // namespace internal | 170 } // namespace internal |
| 169 } // namespace mojo | 171 } // namespace mojo |
| 170 | 172 |
| 171 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ROUTER_H_ | 173 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ROUTER_H_ |
| OLD | NEW |