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

Side by Side Diff: chrome/browser/chromeos/arc/process/arc_process.cc

Issue 2893943003: TabManager: Add more logs to understand how it works when memory is low. (Closed)
Patch Set: review comments Created 3 years, 7 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/arc/process/arc_process.h" 5 #include "chrome/browser/chromeos/arc/process/arc_process.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 namespace arc { 9 namespace arc {
10 10
(...skipping 27 matching lines...) Expand all
38 return process_state() <= mojom::ProcessState::IMPORTANT_FOREGROUND; 38 return process_state() <= mojom::ProcessState::IMPORTANT_FOREGROUND;
39 } 39 }
40 40
41 bool ArcProcess::IsKernelKillable() const { 41 bool ArcProcess::IsKernelKillable() const {
42 // Protect PERSISTENT, PERSISTENT_UI, and our HOME processes since they should 42 // Protect PERSISTENT, PERSISTENT_UI, and our HOME processes since they should
43 // never be killed even by the kernel. Returning false for them allows their 43 // never be killed even by the kernel. Returning false for them allows their
44 // OOM adjustment scores to remain negative. 44 // OOM adjustment scores to remain negative.
45 return process_state() > arc::mojom::ProcessState::PERSISTENT_UI; 45 return process_state() > arc::mojom::ProcessState::PERSISTENT_UI;
46 } 46 }
47 47
48 std::ostream& operator<<(std::ostream& out, const ArcProcess& arc_process) {
49 out << "Arc process " << arc_process.process_name() << " ("
Yusuke Sato 2017/05/18 21:42:49 nit: it might be unclear that the number inside th
cylee1 2017/05/18 22:11:06 Done.
50 << arc_process.pid() << ")"
51 << ", process_state: " << arc_process.process_state()
52 << ", is_focused: " << arc_process.is_focused()
53 << ", last_activity_time: " << arc_process.last_activity_time()
54 << ", packages: ";
55 for (const auto pkg : arc_process.packages())
56 out << pkg << ",";
Yusuke Sato 2017/05/18 21:42:49 The last "," seems redundant. #include "base/str
cylee1 2017/05/18 22:11:05 thanks ! haven't work on the code base for a while
57 return out;
58 }
59
48 } // namespace arc 60 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698