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

Unified Diff: chrome_elf/dll_hash/dll_hash.cc

Issue 174013007: Add UMA stats to record when DLLs are successfully blocked in the Browser. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Alignment Created 6 years, 10 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
« no previous file with comments | « chrome_elf/dll_hash/dll_hash.h ('k') | chrome_elf/dll_hash/dll_hash_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f9c1dd81d25dd6d9cb790b1a32fbeeaa94161703
--- /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/dll_hash.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);
+}
« no previous file with comments | « chrome_elf/dll_hash/dll_hash.h ('k') | chrome_elf/dll_hash/dll_hash_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698