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 #include "mojo/public/cpp/bindings/lib/router.h" | 5 #include "mojo/public/cpp/bindings/lib/router.h" |
6 | 6 |
7 namespace mojo { | 7 namespace mojo { |
8 namespace internal { | 8 namespace internal { |
9 | 9 |
10 // ---------------------------------------------------------------------------- | 10 // ---------------------------------------------------------------------------- |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 connector_.CloseMessagePipe(); | 118 connector_.CloseMessagePipe(); |
119 } else if (message->has_flag(kMessageIsResponse)) { | 119 } else if (message->has_flag(kMessageIsResponse)) { |
120 uint64_t request_id = message->request_id(); | 120 uint64_t request_id = message->request_id(); |
121 ResponderMap::iterator it = responders_.find(request_id); | 121 ResponderMap::iterator it = responders_.find(request_id); |
122 if (it == responders_.end()) { | 122 if (it == responders_.end()) { |
123 assert(false); | 123 assert(false); |
124 return false; | 124 return false; |
125 } | 125 } |
126 MessageReceiver* responder = it->second; | 126 MessageReceiver* responder = it->second; |
127 responders_.erase(it); | 127 responders_.erase(it); |
128 responder->Accept(message); | 128 bool ok = responder->Accept(message); |
129 delete responder; | 129 delete responder; |
| 130 return ok; |
130 } else { | 131 } else { |
131 if (incoming_receiver_) | 132 if (incoming_receiver_) |
132 return incoming_receiver_->Accept(message); | 133 return incoming_receiver_->Accept(message); |
133 // OK to drop message on the floor. | 134 // OK to drop message on the floor. |
134 } | 135 } |
135 | 136 |
136 return false; | 137 return false; |
137 } | 138 } |
138 | 139 |
139 // ---------------------------------------------------------------------------- | 140 // ---------------------------------------------------------------------------- |
140 | 141 |
141 } // namespace internal | 142 } // namespace internal |
142 } // namespace mojo | 143 } // namespace mojo |
OLD | NEW |