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

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

Issue 2892443002: [GRC] Process Coordination Unit support for Global Resource Controller (Closed)
Patch Set: Rebase Created 3 years, 7 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
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/resource_coordinator/public/cpp/coordination_unit_id.h" 5 #include "services/resource_coordinator/public/cpp/coordination_unit_id.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/numerics/safe_conversions.h" 8 #include "base/numerics/safe_conversions.h"
9 #include "third_party/smhasher/src/MurmurHash2.h" 9 #include "third_party/smhasher/src/MurmurHash2.h"
10 10
(...skipping 10 matching lines...) Expand all
21 : type(type) { 21 : type(type) {
22 DCHECK(base::IsValueInRangeForNumericType<int>(new_id.size())); 22 DCHECK(base::IsValueInRangeForNumericType<int>(new_id.size()));
23 if (!new_id.empty()) { 23 if (!new_id.empty()) {
24 id = MurmurHash64A(&new_id.front(), static_cast<int>(new_id.size()), 24 id = MurmurHash64A(&new_id.front(), static_cast<int>(new_id.size()),
25 kMurmur2HashSeed); 25 kMurmur2HashSeed);
26 } else { 26 } else {
27 id = 0; 27 id = 0;
28 } 28 }
29 } 29 }
30 30
31 CoordinationUnitID::CoordinationUnitID(const CoordinationUnitType& type,
32 uint64_t new_id)
33 : id(new_id), type(type) {}
34
31 } // resource_coordinator 35 } // resource_coordinator
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698