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

Unified Diff: services/resource_coordinator/public/cpp/coordination_unit_id.cc

Issue 2798713002: Global Resource Coordinator: Basic service internals (Closed)
Patch Set: Created 3 years, 8 months 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: services/resource_coordinator/public/cpp/coordination_unit_id.cc
diff --git a/services/resource_coordinator/public/cpp/coordination_unit_id.cc b/services/resource_coordinator/public/cpp/coordination_unit_id.cc
new file mode 100644
index 0000000000000000000000000000000000000000..52d4827622384ddb6bda993dd0967b312fc78e6a
--- /dev/null
+++ b/services/resource_coordinator/public/cpp/coordination_unit_id.cc
@@ -0,0 +1,21 @@
+// Copyright 2017 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 "services/resource_coordinator/public/cpp/coordination_unit_id.h"
+
+#include "base/hash.h"
+
+namespace resource_coordinator {
+
+namespace {} // namespace
Primiano Tucci (use gerrit) 2017/04/06 18:09:47 I guess this is a leftover?
oystein (OOO til 10th of July) 2017/04/10 20:03:00 Yep; done.
+
+CoordinationUnitID::CoordinationUnitID() = default;
Primiano Tucci (use gerrit) 2017/04/06 18:09:46 my ignorance: will the =Default ctor zero initiali
oystein (OOO til 10th of July) 2017/04/10 20:03:00 Nope; holdover from when id was an std::string.
+
+CoordinationUnitID::CoordinationUnitID(const CoordinationUnitType& type,
+ const std::string& new_id)
+ : type(type) {
+ id = base::Hash(new_id);
Primiano Tucci (use gerrit) 2017/04/06 18:09:46 I got very bitten by base::Hash in the past with m
oystein (OOO til 10th of July) 2017/04/10 20:03:00 Ah good to know. I switched to Murmur2. skyostil@
+}
+
+} // resource_coordinator

Powered by Google App Engine
This is Rietveld 408576698