| 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/edk/system/endpoint_relayer.h" | 5 #include "mojo/edk/system/endpoint_relayer.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "mojo/edk/system/channel_endpoint.h" | 10 #include "mojo/edk/system/channel_endpoint.h" |
| 11 #include "mojo/edk/system/message_in_transit.h" | 11 #include "mojo/edk/system/message_in_transit.h" |
| 12 | 12 |
| 13 using mojo::util::RefPtr; |
| 14 |
| 13 namespace mojo { | 15 namespace mojo { |
| 14 namespace system { | 16 namespace system { |
| 15 | 17 |
| 16 // static | 18 // static |
| 17 unsigned EndpointRelayer::GetPeerPort(unsigned port) { | 19 unsigned EndpointRelayer::GetPeerPort(unsigned port) { |
| 18 DCHECK(port == 0 || port == 1); | 20 DCHECK(port == 0 || port == 1); |
| 19 return port ^ 1; | 21 return port ^ 1; |
| 20 } | 22 } |
| 21 | 23 |
| 22 void EndpointRelayer::Init(RefPtr<ChannelEndpoint>&& endpoint0, | 24 void EndpointRelayer::Init(RefPtr<ChannelEndpoint>&& endpoint0, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 78 |
| 77 EndpointRelayer::EndpointRelayer() {} | 79 EndpointRelayer::EndpointRelayer() {} |
| 78 | 80 |
| 79 EndpointRelayer::~EndpointRelayer() { | 81 EndpointRelayer::~EndpointRelayer() { |
| 80 DCHECK(!endpoints_[0]); | 82 DCHECK(!endpoints_[0]); |
| 81 DCHECK(!endpoints_[1]); | 83 DCHECK(!endpoints_[1]); |
| 82 } | 84 } |
| 83 | 85 |
| 84 } // namespace system | 86 } // namespace system |
| 85 } // namespace mojo | 87 } // namespace mojo |
| OLD | NEW |