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

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

Issue 2547753002: [Extensions] Extension Port Ids and Initialization 2.0 (Closed)
Patch Set: rebase + unguessable token 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 base::UnguessableToken& context_id,
13 int port_number,
14 bool is_opener)
15 : context_id(context_id), port_number(port_number), is_opener(is_opener) {}
16 PortId::~PortId() {}
17 PortId::PortId(PortId&& other) = default;
18 PortId::PortId(const PortId& other) = default;
19 PortId& PortId::operator=(const PortId& other) = default;
20
21 bool PortId::operator==(const PortId& other) const {
22 return context_id == other.context_id && port_number == other.port_number &&
23 is_opener == other.is_opener;
24 }
25
26 bool PortId::operator<(const PortId& other) const {
27 return std::tie(context_id, port_number, is_opener) <
28 std::tie(other.context_id, other.port_number, other.is_opener);
29 }
30
31 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698