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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: extensions/common/consumer.cc
diff --git a/extensions/common/consumer.cc b/extensions/common/consumer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b91d891a0975b027f17b7a7bd603ecd02ea5f8d2
--- /dev/null
+++ b/extensions/common/consumer.cc
@@ -0,0 +1,35 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "extensions/common/consumer.h"
+
+const int ConsumerID::kDefaultInstanceID = 0;
+
+ConsumerID::ConsumerID() : host_id(std::string()) {
+}
+
+ConsumerID::ConsumerID(HostType host_type,
+ const std::string& host_id,
+ InstanceType instance_type,
+ int instance_id)
+ : host_type(host_type),
+ host_id(host_id),
+ instance_type(instance_type),
+ instance_id(instance_id) {
+}
+
+bool ConsumerID::operator<(const ConsumerID& id) const {
+ return host_type < id.host_type ||
+ (host_type == id.host_type && host_id.compare(id.host_id) < 0) ||
+ (host_type == id.host_type && host_id.compare(id.host_id) == 0 &&
+ instance_type < id.instance_type) ||
+ (host_type == id.host_type && host_id.compare(id.host_id) == 0 &&
+ instance_type == id.instance_type && instance_id < id.instance_id);
+}
+
+Consumer::Consumer() {
+}
+
+Consumer::~Consumer() {
+}

Powered by Google App Engine
This is Rietveld 408576698