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

Unified Diff: chrome/browser/safe_browsing/incident_reporting/module_integrity_verifier_win.cc

Issue 559633002: Stop recording UMA metrics for known reloc types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/incident_reporting/module_integrity_verifier_win.cc
diff --git a/chrome/browser/safe_browsing/incident_reporting/module_integrity_verifier_win.cc b/chrome/browser/safe_browsing/incident_reporting/module_integrity_verifier_win.cc
index a4c48eb1f08e2ee7b45812e0bff7d34e3c3cff5a..19528bb997fac3fbfd77cd7c5134fc1198164398 100644
--- a/chrome/browser/safe_browsing/incident_reporting/module_integrity_verifier_win.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/module_integrity_verifier_win.cc
@@ -164,23 +164,27 @@ bool EnumRelocsCallback(const base::win::PEImage& mem_peimage,
if (!AddrIsInCodeSection(address, mem_code_addr, code_size))
return true;
- UMA_HISTOGRAM_SPARSE_SLOWLY("SafeBrowsing.ModuleBaseRelocation", type);
-
switch (type) {
- case IMAGE_REL_BASED_HIGHLOW: {
- AddBytesCorrectedByReloc(reinterpret_cast<uintptr_t>(address), state);
- break;
- }
- case IMAGE_REL_BASED_ABSOLUTE:
+ case IMAGE_REL_BASED_ABSOLUTE: // 0
// Absolute type relocations are a noop, sometimes used to pad a section
// of relocations.
break;
- default: {
+ case IMAGE_REL_BASED_HIGHLOW: // 3
+ // The base relocation applies all 32 bits of the difference to the 32-bit
+ // field at offset.
+ AddBytesCorrectedByReloc(reinterpret_cast<uintptr_t>(address), state);
+ break;
+ case IMAGE_REL_BASED_DIR64: // 10
+ // The base relocation applies the difference to the 64-bit field at
+ // offset.
+ // TODO(robertshield): Handle this type of reloc.
+ break;
+ default:
// TODO(robertshield): Find a reliable description of the behaviour of the
// remaining types of relocation and handle them.
+ UMA_HISTOGRAM_SPARSE_SLOWLY("SafeBrowsing.ModuleBaseRelocation", type);
state->unknown_reloc_type = true;
break;
- }
}
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698