OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "extensions/common/api/messaging/port_id.h" |
| 6 |
| 7 #include <tuple> |
| 8 |
| 9 namespace extensions { |
| 10 |
| 11 PortId::PortId() {} |
| 12 PortId::PortId(const std::string& context_id, int port_number, bool is_opener) |
| 13 : context_id(context_id), port_number(port_number), is_opener(is_opener) {} |
| 14 PortId::~PortId() {} |
| 15 PortId::PortId(PortId&& other) = default; |
| 16 PortId::PortId(const PortId& other) = default; |
| 17 PortId& PortId::operator=(const PortId& other) = default; |
| 18 |
| 19 bool PortId::operator==(const PortId& other) const { |
| 20 return context_id == other.context_id && port_number == other.port_number && |
| 21 is_opener == other.is_opener; |
| 22 } |
| 23 |
| 24 bool PortId::operator<(const PortId& other) const { |
| 25 return std::tie(context_id, port_number, is_opener) < |
| 26 std::tie(other.context_id, other.port_number, other.is_opener); |
| 27 } |
| 28 |
| 29 } // namespace extensions |
OLD | NEW |