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

Side by Side Diff: services/resource_coordinator/public/cpp/coordination_unit_id.cc

Issue 2798713002: Global Resource Coordinator: Basic service internals (Closed)
Patch Set: Review fixes 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 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 "services/resource_coordinator/public/cpp/coordination_unit_id.h"
6
7 #include "third_party/smhasher/src/MurmurHash2.h"
8
9 namespace resource_coordinator {
10
11 // The seed to use when taking the murmur2 hash of the id.
12 const uint64_t kMurmur2HashSeed = 0;
13
14 CoordinationUnitID::CoordinationUnitID()
15 : id(0), type(CoordinationUnitType::INVALID_TYPE) {}
16
17 CoordinationUnitID::CoordinationUnitID(const CoordinationUnitType& type,
18 const std::string& new_id)
19 : type(type) {
20 id = MurmurHash2(&new_id.front(), new_id.size(), kMurmur2HashSeed);
Primiano Tucci (use gerrit) 2017/04/11 18:04:51 if you initialize this in the initializer list ou
oystein (OOO til 10th of July) 2017/04/12 19:15:31 Doesn't work with the Mojo serialization/deseriali
21 }
22
23 } // resource_coordinator
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698