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

Unified Diff: base/debug/trace_event_system_stats_monitor.h

Issue 885443002: Roll Chrome into Mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase to ToT mojo Created 5 years, 11 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
« no previous file with comments | « base/debug/trace_event_synthetic_delay_unittest.cc ('k') | base/debug/trace_event_system_stats_monitor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/trace_event_system_stats_monitor.h
diff --git a/base/debug/trace_event_system_stats_monitor.h b/base/debug/trace_event_system_stats_monitor.h
deleted file mode 100644
index 143f1875db852e26817c5f37317fabca431a6654..0000000000000000000000000000000000000000
--- a/base/debug/trace_event_system_stats_monitor.h
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2013 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_DEBUG_TRACE_EVENT_SYSTEM_STATS_MONITOR_H_
-#define BASE_DEBUG_TRACE_EVENT_SYSTEM_STATS_MONITOR_H_
-
-#include "base/base_export.h"
-#include "base/debug/trace_event_impl.h"
-#include "base/gtest_prod_util.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/weak_ptr.h"
-#include "base/process/process_metrics.h"
-#include "base/timer/timer.h"
-
-namespace base {
-
-class SingleThreadTaskRunner;
-
-namespace debug {
-
-// Watches for chrome://tracing to be enabled or disabled. When tracing is
-// enabled, also enables system events profiling. This class is the preferred
-// way to turn system tracing on and off.
-class BASE_EXPORT TraceEventSystemStatsMonitor
- : public TraceLog::EnabledStateObserver {
- public:
- // Length of time interval between stat profiles.
- static const int kSamplingIntervalMilliseconds = 2000;
-
- // |task_runner| must be the primary thread for the client
- // process, e.g. the UI thread in a browser.
- explicit TraceEventSystemStatsMonitor(
- scoped_refptr<SingleThreadTaskRunner> task_runner);
-
- virtual ~TraceEventSystemStatsMonitor();
-
- // base::debug::TraceLog::EnabledStateChangedObserver overrides:
- void OnTraceLogEnabled() override;
- void OnTraceLogDisabled() override;
-
- // Retrieves system profiling at the current time.
- void DumpSystemStats();
-
- private:
- FRIEND_TEST_ALL_PREFIXES(TraceSystemStatsMonitorTest,
- TraceEventSystemStatsMonitor);
-
- bool IsTimerRunningForTest() const;
-
- void StartProfiling();
-
- void StopProfiling();
-
- // Ensures the observer starts and stops tracing on the primary thread.
- scoped_refptr<SingleThreadTaskRunner> task_runner_;
-
- // Timer to schedule system profile dumps.
- RepeatingTimer<TraceEventSystemStatsMonitor> dump_timer_;
-
- WeakPtrFactory<TraceEventSystemStatsMonitor> weak_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(TraceEventSystemStatsMonitor);
-};
-
-// Converts system memory profiling stats in |input| to
-// trace event compatible JSON and appends to |output|. Visible for testing.
-BASE_EXPORT void AppendSystemProfileAsTraceFormat(const SystemMetrics&
- system_stats,
- std::string* output);
-
-} // namespace debug
-} // namespace base
-
-#endif // BASE_DEBUG_TRACE_EVENT_SYSTEM_STATS_MONITOR_H_
« no previous file with comments | « base/debug/trace_event_synthetic_delay_unittest.cc ('k') | base/debug/trace_event_system_stats_monitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698