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

Side by Side Diff: chrome/browser/chromeos/arc/arc_low_memory_killer_monitor.h

Issue 1828533002: Enable UMA histogram logger for low memor kill events in ArcMetricsService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix NaClBrowserTest Created 4 years, 9 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 unified diff | Download patch
OLDNEW
(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_LOW_MEMORY_KILLER_MONITOR_H_
6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_LOW_MEMORY_KILLER_MONITOR_H_
7
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/threading/sequenced_worker_pool.h"
11
12 namespace arc {
13
14 // Trace lowmemorykiller events and report to UMA.
15 //
16 // If kernel lowmemorykiller is enabled, it would kill processes automatically
17 // on memory pressure. ArcLowMemoryKillerMonitor listens on lowmemorykiller log
18 // from kernel space and reports to UMA.
19 //
20 // Note: There should be only one ArcLowMemoryKillerMonitor instance during the
21 // power cycle of a Chrome OS device, otherwise an lowmemorykiller event would
22 // be reported twice since it reads in the entire kernel log from head.
23 // On Chrome OS, it should live within a main browser thread.
24 class ArcLowMemoryKillerMonitor {
25 public:
26 ArcLowMemoryKillerMonitor();
27 ~ArcLowMemoryKillerMonitor();
28
29 void Start();
30 void Stop();
31
32 private:
33 // Keep a reference to worker_pool_ in case |this| is deleted in
34 // shutdown process while this thread returns from a blocking read.
35 static void Run(scoped_refptr<base::SequencedWorkerPool> worker_pool);
36
37 scoped_refptr<base::SequencedWorkerPool> worker_pool_;
38
39 DISALLOW_COPY_AND_ASSIGN(ArcLowMemoryKillerMonitor);
40 };
41
42 } // namespace arc
43
44 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_LOW_MEMORY_KILLER_MONITOR_H_"
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_low_memory_killer_monitor.cc » ('j') | chrome/test/nacl/nacl_browsertest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698