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

Unified Diff: components/browser_watcher/stability_debugging.cc

Issue 2531123002: Record MetricsService's execution phase to the stability file (Closed)
Patch Set: fix issue with incorrect kStabilityExecutionPhase Created 4 years 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/browser_watcher/stability_debugging.cc
diff --git a/components/browser_watcher/stability_debugging_win.cc b/components/browser_watcher/stability_debugging.cc
similarity index 85%
rename from components/browser_watcher/stability_debugging_win.cc
rename to components/browser_watcher/stability_debugging.cc
index 3eb4e47b2affb3eac0e7f5a1995dcb4781810dbe..4341ffe7d3f6cc1eae8357edb4ea324c060a3938 100644
--- a/components/browser_watcher/stability_debugging_win.cc
+++ b/components/browser_watcher/stability_debugging.cc
@@ -2,10 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "components/browser_watcher/stability_debugging_win.h"
+#include "components/browser_watcher/stability_debugging.h"
#include <string>
+#include "base/debug/activity_tracker.h"
#include "base/feature_list.h"
#include "base/files/file.h"
#include "base/metrics/persistent_memory_allocator.h"
@@ -19,6 +20,7 @@ namespace browser_watcher {
namespace {
+#if defined(OS_WIN)
bool GetCreationTime(const base::Process& process, base::Time* time) {
DCHECK(time);
@@ -33,9 +35,12 @@ bool GetCreationTime(const base::Process& process, base::Time* time) {
*time = base::Time::FromFileTime(creation_time);
return true;
}
+#endif // defined(OS_WIN)
} // namespace
+#if defined(OS_WIN)
+
base::FilePath GetStabilityDir(const base::FilePath& user_data_dir) {
return user_data_dir.AppendASCII("Stability");
}
@@ -84,5 +89,15 @@ void MarkStabilityFileForDeletion(const base::FilePath& user_data_dir) {
base::File::FLAG_READ |
base::File::FLAG_DELETE_ON_CLOSE);
}
+#endif // defined(OS_WIN)
+
+void SetStabilityDataInt(base::StringPiece name, int64_t value) {
+ base::debug::GlobalActivityTracker* global_tracker =
+ base::debug::GlobalActivityTracker::Get();
+ if (!global_tracker)
+ return; // Activity tracking isn't enabled.
+
+ global_tracker->user_data().SetInt(name, value);
+}
} // namespace browser_watcher
« no previous file with comments | « components/browser_watcher/stability_debugging.h ('k') | components/browser_watcher/stability_debugging_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698