Add a UMA log decoder utility
...so WebView doesn't need to depend on zlib.
BUG=698047
Review-Url: https://codereview.chromium.org/2789773005
Cr-Commit-Position: refs/heads/master@{#461286}
diff --git a/components/metrics/log_decoder.cc b/components/metrics/log_decoder.cc
new file mode 100644
index 0000000..1754c27
--- /dev/null
+++ b/components/metrics/log_decoder.cc
@@ -0,0 +1,16 @@
+// Copyright 2017 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 "components/metrics/log_decoder.h"
+
+#include "third_party/zlib/google/compression_utils.h"
+
+namespace metrics {
+
+bool DecodeLogData(const std::string& compressed_log_data,
+ std::string* log_data) {
+ return compression::GzipUncompress(compressed_log_data, log_data);
+}
+
+} // namespace metrics