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

Unified Diff: base/metrics/persistent_metrics_file_util.h

Issue 2308763002: Integrate Crashpad UMA (Closed)
Patch Set: pass through user data dir for metrics Created 4 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
Index: base/metrics/persistent_metrics_file_util.h
diff --git a/base/metrics/persistent_metrics_file_util.h b/base/metrics/persistent_metrics_file_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..d0187b8d6e2bf36bf98cd8c85c270d5653ea49b3
--- /dev/null
+++ b/base/metrics/persistent_metrics_file_util.h
@@ -0,0 +1,34 @@
+// Copyright 2016 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 BASE_METRICS_PERSISTENT_METRICS_FILE_UTIL_H_
bcwhite 2016/09/14 13:16:12 Don't we have some policy against "*_util" files?
scottmg 2016/09/14 20:37:01 Done, much better! It'll be slightly more to stub
+#define BASE_METRICS_PERSISTENT_METRICS_FILE_UTIL_H_
+
+#include "base/base_export.h"
+
+namespace base {
+
+class FilePath;
+
+// Initializes a pair of metrics files in the given directory, using
+// |metrics_name| as the basename of the previous run file, and basename +
+// "-active" for the current run, with the given size. The basename one should
+// be associated with the previous run when registered with the metrics system,
+// and the "-active" with the current run.
+BASE_EXPORT void InitializeGlobalPersistentMetricsStorage(
+ const base::FilePath& dir,
+ const char* metrics_name,
+ size_t size);
+
+// If there is a global metrics file being updated on disk, mark it to be
+// deleted when the process exits. A normal shutdown is almost complete
+// so there is no benefit in keeping a file with no new data to be processed
+// during the next startup sequence. Deleting the file during shutdown adds
+// an extra disk-access or two to shutdown but eliminates the unnecessary
+// processing of the contents during startup only to find nothing.
+BASE_EXPORT void CleanUpGlobalPersistentHistogramStorage();
bcwhite 2016/09/14 13:16:12 There's a WriteToPersistentLocation() in that clas
scottmg 2016/09/14 20:37:01 Done.
+
+} // namespace base
+
+#endif // BASE_METRICS_PERSISTENT_METRICS_FILE_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698