Index: chrome_elf/dll_hash/dll_hash.cc |
diff --git a/chrome_elf/dll_hash/dll_hash.cc b/chrome_elf/dll_hash/dll_hash.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e520c6b0bd2c6623d0803167e0a8df36703ba1ac |
--- /dev/null |
+++ b/chrome_elf/dll_hash/dll_hash.cc |
@@ -0,0 +1,14 @@ |
+// Copyright (c) 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 "base/hash.h" |
+#include "chrome_elf/dll_hash_for_uma/dll_hash_for_uma.h" |
+ |
+int DllNameToHash(std::string dll_name) { |
+ uint32 data = base::Hash(dll_name); |
+ |
+ // Strip off the signed bit because UMA doesn't support negative values, |
+ // but takes a signed int as input. |
+ return static_cast<int>(data & 0x7fffffff); |
+} |