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

Side by Side Diff: extensions/common/consumer.cc

Issue 822453002: Introduce HostID and de-couple Extensions from "script injection System" [browser side] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698