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

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

Issue 1676803002: [mojo-edk] Minor clean-up in the ports layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/ports/event.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 "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 port_descriptor->peer_node_name = port->peer_node_name; 784 port_descriptor->peer_node_name = port->peer_node_name;
785 port_descriptor->peer_port_name = port->peer_port_name; 785 port_descriptor->peer_port_name = port->peer_port_name;
786 port_descriptor->referring_node_name = name_; 786 port_descriptor->referring_node_name = name_;
787 port_descriptor->referring_port_name = local_port_name; 787 port_descriptor->referring_port_name = local_port_name;
788 port_descriptor->next_sequence_num_to_send = port->next_sequence_num_to_send; 788 port_descriptor->next_sequence_num_to_send = port->next_sequence_num_to_send;
789 port_descriptor->next_sequence_num_to_receive = 789 port_descriptor->next_sequence_num_to_receive =
790 port->message_queue.next_sequence_num(); 790 port->message_queue.next_sequence_num();
791 port_descriptor->last_sequence_num_to_receive = 791 port_descriptor->last_sequence_num_to_receive =
792 port->last_sequence_num_to_receive; 792 port->last_sequence_num_to_receive;
793 port_descriptor->peer_closed = port->peer_closed; 793 port_descriptor->peer_closed = port->peer_closed;
794 port_descriptor->padding0 = 0;
795 port_descriptor->padding1 = 0;
796 port_descriptor->padding2 = 0;
794 797
795 // Configure the local port to point to the new port. 798 // Configure the local port to point to the new port.
796 port->peer_node_name = to_node_name; 799 port->peer_node_name = to_node_name;
797 port->peer_port_name = new_port_name; 800 port->peer_port_name = new_port_name;
798 } 801 }
799 802
800 int Node::AcceptPort(const PortName& port_name, 803 int Node::AcceptPort(const PortName& port_name,
801 const PortDescriptor& port_descriptor) { 804 const PortDescriptor& port_descriptor) {
802 scoped_refptr<Port> port = make_scoped_refptr( 805 scoped_refptr<Port> port = make_scoped_refptr(
803 new Port(port_descriptor.next_sequence_num_to_send, 806 new Port(port_descriptor.next_sequence_num_to_send,
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 992
990 if (num_data_bytes) 993 if (num_data_bytes)
991 memcpy(header + 1, data, num_data_bytes); 994 memcpy(header + 1, data, num_data_bytes);
992 995
993 return message; 996 return message;
994 } 997 }
995 998
996 } // namespace ports 999 } // namespace ports
997 } // namespace edk 1000 } // namespace edk
998 } // namespace mojo 1001 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/ports/event.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698