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

Unified Diff: chrome/browser/install_module_verifier_win.h

Issue 23513049: Implement install module verification metric. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Additional tests. Created 7 years, 2 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
Index: chrome/browser/install_module_verifier_win.h
diff --git a/chrome/browser/install_module_verifier_win.h b/chrome/browser/install_module_verifier_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..c3ba9eb7db6c7fd76b0d9b2b71cbccf08478f1c8
--- /dev/null
+++ b/chrome/browser/install_module_verifier_win.h
@@ -0,0 +1,49 @@
+// Copyright (c) 2013 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.
+
+#ifndef CHROME_BROWSER_INSTALL_MODULE_VERIFIER_WIN_H_
+#define CHROME_BROWSER_INSTALL_MODULE_VERIFIER_WIN_H_
+
+#include <utility>
sky 2013/10/04 19:21:54 nit: sort
erikwright (departed) 2013/10/04 20:39:38 Done.
+#include <set>
+#include <string>
+#include <vector>
+
+#include "base/callback_forward.h"
+#include "base/strings/string_piece.h"
+
+namespace base {
+class ListValue;
+} // namespace base
+
+typedef std::vector<std::pair<size_t, base::StringPiece> > AdditionalModules;
+
+// Starts a background process to verify installed modules. Results are reported
+// via UMA.
+void BeginModuleVerification();
+
+// Converts a list of modules descriptions extracted from EnumerateModulesModel
+// into a list of loaded module name digests.
+void ExtractLoadedModuleNameDigests(
+ const base::ListValue& module_list,
+ std::set<std::string>* loaded_module_name_digests);
+
+// Verifies a list of installed module name digests and reports results via the
+// supplied callback. Each reported ID corresponds to a found, expected module.
+void VerifyModules(const std::set<std::string>& module_name_digests,
+ const AdditionalModules& additional_modules,
+ const base::Callback<void(size_t)>& delegate);
+
+// Parses a list of additional modules to verify. The data format is a series of
+// lines. Each line starts with a decimal ID, then a module name digest,
+// separated by a space. Lines are terminated by \n. The result is a vector of
+// pairs where the first value is an ID and the second value is the
+// corresponding module name digest. The StringPieces use the same underlying
+// storage as |raw_data|.
+//
+// Invalid lines are ignored.
+void ParseAdditionalModules(const base::StringPiece& raw_data,
+ AdditionalModules* additional_modules);
+
+#endif // CHROME_BROWSER_INSTALL_MODULE_VERIFIER_WIN_H_

Powered by Google App Engine
This is Rietveld 408576698