Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |