Index: chrome/browser/chromeos/arc/arc_lowmemorykiller_monitor.h |
diff --git a/chrome/browser/chromeos/arc/arc_lowmemorykiller_monitor.h b/chrome/browser/chromeos/arc/arc_lowmemorykiller_monitor.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3bb2290f44d2f6ef98d0f0a73ab483060ec1dd94 |
--- /dev/null |
+++ b/chrome/browser/chromeos/arc/arc_lowmemorykiller_monitor.h |
@@ -0,0 +1,40 @@ |
+// 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 CHROME_BROWSER_CHROMEOS_ARC_ARC_LOWMEMORYKILLER_MONITOR_H_ |
+#define CHROME_BROWSER_CHROMEOS_ARC_ARC_LOWMEMORYKILLER_MONITOR_H_ |
+ |
+#include "base/threading/sequenced_worker_pool.h" |
+ |
+namespace arc { |
+ |
+// Trace lowmemorykiller events and report to UMA. |
+// |
+// If kernel lowmemorykiller is enabled, it would kill processes automatically |
+// on memory pressure. ArcLowMemoryKillerMonitor listens on lowmemorykiller log |
+// from kernel space and reports to UMA. |
+// |
+// Note: There should be only one ArcLowMemoryKillerMonitor instance during the |
+// power cycle of a ChromeOS device, otherwise an lowmemorykiller event would be |
Yusuke Sato
2016/03/12 00:24:29
Chrome OS (here and elsewhere)
cylee1
2016/03/14 13:03:35
Done.
|
+// reported twice since it reads in the entire kernel log from head. |
+// On ChromeOS, it should live within a main browser thread. |
+class ArcLowMemoryKillerMonitor { |
+ public: |
+ ArcLowMemoryKillerMonitor(); |
+ ~ArcLowMemoryKillerMonitor(); |
+ |
+ void Start(); |
+ void Stop(); |
+ |
+ private: |
+ void Run(); |
+ |
+ scoped_refptr<base::SequencedWorkerPool> worker_pool_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ArcLowMemoryKillerMonitor); |
Yusuke Sato
2016/03/12 00:24:29
#include base/macros.h is needed for DISALLOW_COPY
cylee1
2016/03/14 13:03:35
Done.
|
+}; |
+ |
+} // namespace arc |
+ |
+#endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_LOWMEMORYKILLER_MONITOR_H_" |