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

Unified Diff: components/policy/core/common/preg_parser.h

Issue 2791193005: Add fuzzer test for preg_parser (Closed)
Patch Set: Can't char string concat base::FilePath::value()s on Windows since file paths are UTF16 there. Created 3 years, 8 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: components/policy/core/common/preg_parser.h
diff --git a/components/policy/core/common/preg_parser.h b/components/policy/core/common/preg_parser.h
index 03872a47a182bdd77a15b3f303789c0dc666fe2f..8df6cf7d90b98560e18e2691c604cb5211b8f9f5 100644
--- a/components/policy/core/common/preg_parser.h
+++ b/components/policy/core/common/preg_parser.h
@@ -14,6 +14,7 @@
#include <vector>
#include "base/strings/string16.h"
+#include "components/policy/core/common/policy_load_status.h"
#include "components/policy/policy_export.h"
namespace base {
@@ -22,7 +23,6 @@ class FilePath;
namespace policy {
-class PolicyLoadStatusSample;
class RegistryDict;
namespace preg_parser {
@@ -31,12 +31,23 @@ namespace preg_parser {
POLICY_EXPORT extern const char kPRegFileHeader[8];
// Reads the PReg file at |file_path| and writes the registry data to |dict|.
-// |root| specifies the registry subtree the caller is interested in,
-// everything else gets ignored.
+// |root| specifies the registry subtree the caller is interested in, everything
+// else gets ignored.
POLICY_EXPORT bool ReadFile(const base::FilePath& file_path,
const base::string16& root,
RegistryDict* dict,
- PolicyLoadStatusSample* status);
+ PolicyLoadStatusSample* status_sample);
+
+// Reads the PReg data at |data| of length |data_size| and writes the registry
+// data to |dict|. |root| specifies the registry subtree the caller is
+// interested in, everything else gets ignored. |debug_name| is printed out
+// along with error messages. Returns false and sets |status| on error.
+POLICY_EXPORT bool ReadData(const uint8_t* data,
Thiemo Nagel 2017/04/07 09:39:57 I don't think it is fair to export an interface wi
Thiemo Nagel 2017/04/07 09:55:41 As discussed offline, imho it would be fair to add
ljusten (tachyonic) 2017/04/10 10:22:51 As discussed offline, I'll add Internal to the nam
+ size_t data_size,
+ const base::string16& root,
+ RegistryDict* dict,
+ PolicyLoadStatus* status,
+ const std::string& debug_name);
} // namespace preg_parser
} // namespace policy

Powered by Google App Engine
This is Rietveld 408576698