| Index: extensions/common/api/messaging/port_id.cc
|
| diff --git a/extensions/common/api/messaging/port_id.cc b/extensions/common/api/messaging/port_id.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d5fb017418365a92ed6570409bd7ea4a2c901b24
|
| --- /dev/null
|
| +++ b/extensions/common/api/messaging/port_id.cc
|
| @@ -0,0 +1,29 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "extensions/common/api/messaging/port_id.h"
|
| +
|
| +#include <tuple>
|
| +
|
| +namespace extensions {
|
| +
|
| +PortId::PortId() {}
|
| +PortId::PortId(const std::string& context_id, int port_number, bool is_opener)
|
| + : context_id(context_id), port_number(port_number), is_opener(is_opener) {}
|
| +PortId::~PortId() {}
|
| +PortId::PortId(PortId&& other) = default;
|
| +PortId::PortId(const PortId& other) = default;
|
| +PortId& PortId::operator=(const PortId& other) = default;
|
| +
|
| +bool PortId::operator==(const PortId& other) const {
|
| + return context_id == other.context_id && port_number == other.port_number &&
|
| + is_opener == other.is_opener;
|
| +}
|
| +
|
| +bool PortId::operator<(const PortId& other) const {
|
| + return std::tie(context_id, port_number, is_opener) <
|
| + std::tie(other.context_id, other.port_number, other.is_opener);
|
| +}
|
| +
|
| +} // namespace extensions
|
|
|