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(HostType host_type, |
| 13 const std::string& host_id, |
| 14 InstanceType instance_type, |
| 15 int instance_id) |
| 16 : host_type(host_type), |
| 17 host_id(host_id), |
| 18 instance_type(instance_type), |
| 19 instance_id(instance_id) { |
| 20 } |
| 21 |
| 22 bool ConsumerID::operator<(const ConsumerID& id) const { |
| 23 return host_type < id.host_type || |
| 24 (host_type == id.host_type && host_id.compare(id.host_id) < 0) || |
| 25 (host_type == id.host_type && host_id.compare(id.host_id) == 0 && |
| 26 instance_type < id.instance_type) || |
| 27 (host_type == id.host_type && host_id.compare(id.host_id) == 0 && |
| 28 instance_type == id.instance_type && instance_id < id.instance_id); |
| 29 } |
| 30 |
| 31 Consumer::Consumer() { |
| 32 } |
| 33 |
| 34 Consumer::~Consumer() { |
| 35 } |
OLD | NEW |