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

Side by Side Diff: extensions/common/api/messaging/port_id.cc

Issue 2547753002: [Extensions] Extension Port Ids and Initialization 2.0 (Closed)
Patch Set: Rob's test Created 4 years 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
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698