Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Side by Side Diff: mojo/public/cpp/bindings/lib/router.cc

Issue 265133002: Mojo: Fix Router::HandleIncomingMessage(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698