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

Side by Side Diff: mojo/edk/system/ports/node.cc

Issue 2063113002: [mojo-edk] Reset Port::send_on_proxy_removal after sending message. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « mojo/edk/system/node_controller.cc ('k') | 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/edk/system/ports/node.h" 5 #include "mojo/edk/system/ports/node.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1263 1263
1264 if (!CanAcceptMoreMessages(port.get())) { 1264 if (!CanAcceptMoreMessages(port.get())) {
1265 // This proxy port is done. We can now remove it! 1265 // This proxy port is done. We can now remove it!
1266 ErasePort_Locked(port_name); 1266 ErasePort_Locked(port_name);
1267 1267
1268 if (port->send_on_proxy_removal) { 1268 if (port->send_on_proxy_removal) {
1269 NodeName to_node = port->send_on_proxy_removal->first; 1269 NodeName to_node = port->send_on_proxy_removal->first;
1270 ScopedMessage& message = port->send_on_proxy_removal->second; 1270 ScopedMessage& message = port->send_on_proxy_removal->second;
1271 1271
1272 delegate_->ForwardMessage(to_node, std::move(message)); 1272 delegate_->ForwardMessage(to_node, std::move(message));
1273 port->send_on_proxy_removal.reset();
1273 } 1274 }
1274 } else { 1275 } else {
1275 DVLOG(2) << "Cannot remove port " << port_name << "@" << name_ 1276 DVLOG(2) << "Cannot remove port " << port_name << "@" << name_
1276 << " now; waiting for more messages"; 1277 << " now; waiting for more messages";
1277 } 1278 }
1278 } 1279 }
1279 1280
1280 void Node::TryRemoveProxy(PortRef port_ref) { 1281 void Node::TryRemoveProxy(PortRef port_ref) {
1281 Port* port = port_ref.port(); 1282 Port* port = port_ref.port();
1282 bool should_erase = false; 1283 bool should_erase = false;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1331 1332
1332 if (num_data_bytes) 1333 if (num_data_bytes)
1333 memcpy(header + 1, data, num_data_bytes); 1334 memcpy(header + 1, data, num_data_bytes);
1334 1335
1335 return message; 1336 return message;
1336 } 1337 }
1337 1338
1338 } // namespace ports 1339 } // namespace ports
1339 } // namespace edk 1340 } // namespace edk
1340 } // namespace mojo 1341 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/node_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698