OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "extensions/common/consumer.h" |
| 6 |
| 7 const int ConsumerID::kDefaultInstanceID = 0; |
| 8 |
| 9 ConsumerID::ConsumerID() : host_id_(std::string()) { |
| 10 } |
| 11 |
| 12 ConsumerID::ConsumerID(const ConsumerID& other) |
| 13 : host_type_(other.host_type()), |
| 14 host_id_(other.host_id()), |
| 15 instance_type_(other.instance_type()), |
| 16 instance_id_(other.instance_id()) { |
| 17 } |
| 18 |
| 19 ConsumerID::ConsumerID(HostType host_type, |
| 20 const std::string& host_id, |
| 21 InstanceType instance_type, |
| 22 int instance_id) |
| 23 : host_type_(host_type), |
| 24 host_id_(host_id), |
| 25 instance_type_(instance_type), |
| 26 instance_id_(instance_id) { |
| 27 } |
| 28 |
| 29 bool ConsumerID::operator<(const ConsumerID& id) const { |
| 30 return host_type_ < id.host_type() || |
| 31 (host_type_ == id.host_type() && host_id_.compare(id.host_id()) < 0) || |
| 32 (host_type_ == id.host_type() && host_id_.compare(id.host_id()) == 0 && |
| 33 instance_type_ < id.instance_type()) || |
| 34 (host_type_ == id.host_type() && host_id_.compare(id.host_id()) == 0 && |
| 35 instance_type_ == id.instance_type() && |
| 36 instance_id_ < id.instance_id()); |
| 37 } |
| 38 |
| 39 ConsumerID::~ConsumerID() { |
| 40 } |
| 41 |
| 42 Consumer::Consumer() { |
| 43 } |
| 44 |
| 45 Consumer::~Consumer() { |
| 46 } |
OLD | NEW |