Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_LOWMEMORYKILLER_MONITOR_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_LOWMEMORYKILLER_MONITOR_H_ | |
| 7 | |
| 8 #include "base/threading/sequenced_worker_pool.h" | |
| 9 | |
| 10 namespace arc { | |
| 11 | |
| 12 // Trace lowmemorykiller events and report to UMA. | |
| 13 // | |
| 14 // If kernel lowmemorykiller is enabled, it would kill processes automatically | |
| 15 // on memory pressure. ArcLowMemoryKillerMonitor listens on lowmemorykiller log | |
| 16 // from kernel space and reports to UMA. | |
| 17 // | |
| 18 // Note: There should be only one ArcLowMemoryKillerMonitor instance during the | |
| 19 // 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.
| |
| 20 // reported twice since it reads in the entire kernel log from head. | |
| 21 // On ChromeOS, it should live within a main browser thread. | |
| 22 class ArcLowMemoryKillerMonitor { | |
| 23 public: | |
| 24 ArcLowMemoryKillerMonitor(); | |
| 25 ~ArcLowMemoryKillerMonitor(); | |
| 26 | |
| 27 void Start(); | |
| 28 void Stop(); | |
| 29 | |
| 30 private: | |
| 31 void Run(); | |
| 32 | |
| 33 scoped_refptr<base::SequencedWorkerPool> worker_pool_; | |
| 34 | |
| 35 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.
| |
| 36 }; | |
| 37 | |
| 38 } // namespace arc | |
| 39 | |
| 40 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_LOWMEMORYKILLER_MONITOR_H_" | |
| OLD | NEW |