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

Unified Diff: components/browser_watcher/stability_debugging_win.cc

Issue 2531123002: Record MetricsService's execution phase to the stability file (Closed)
Patch Set: Created 4 years, 1 month 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_win.cc
diff --git a/components/browser_watcher/stability_debugging_win.cc b/components/browser_watcher/stability_debugging_win.cc
index 3eb4e47b2affb3eac0e7f5a1995dcb4781810dbe..ccc2a416f5be218587e018585735fa2b683b614f 100644
--- a/components/browser_watcher/stability_debugging_win.cc
+++ b/components/browser_watcher/stability_debugging_win.cc
@@ -6,6 +6,7 @@
#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"
@@ -85,4 +86,13 @@ void MarkStabilityFileForDeletion(const base::FilePath& user_data_dir) {
base::File::FLAG_DELETE_ON_CLOSE);
}
+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.
+ base::debug::ActivityUserData& global_user_data = global_tracker->user_data();
bcwhite 2016/12/01 16:35:20 Blank line above.
manzagop (departed) 2016/12/05 15:44:04 Done.
+ global_user_data.SetInt(name, value);
bcwhite 2016/12/01 16:35:20 Skip assigning it to a variable and just call SetI
manzagop (departed) 2016/12/05 15:44:04 Done.
+}
+
} // namespace browser_watcher

Powered by Google App Engine
This is Rietveld 408576698