Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/memory/tab_manager_delegate_chromeos.h" | 5 #include "chrome/browser/memory/tab_manager_delegate_chromeos.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 aura::client::ActivationClient* GetActivationClient() { | 68 aura::client::ActivationClient* GetActivationClient() { |
| 69 if (!ash::Shell::HasInstance()) | 69 if (!ash::Shell::HasInstance()) |
| 70 return nullptr; | 70 return nullptr; |
| 71 return aura::client::GetActivationClient(ash::Shell::GetPrimaryRootWindow()); | 71 return aura::client::GetActivationClient(ash::Shell::GetPrimaryRootWindow()); |
| 72 } | 72 } |
| 73 | 73 |
| 74 // Checks if a window renders ARC apps. | 74 // Checks if a window renders ARC apps. |
| 75 bool IsArcWindow(aura::Window* window) { | 75 bool IsArcWindow(aura::Window* window) { |
| 76 if (!window || window->GetName() != kExoShellSurfaceWindowName) | 76 if (!window || window->GetName() != kExoShellSurfaceWindowName) |
| 77 return false; | 77 return false; |
| 78 std::string application_id = exo::ShellSurface::GetApplicationId(window); | 78 const std::string* application_id = |
|
Yusuke Sato
2017/05/19 16:55:28
FYI the code has been removed:
https://codereview.
yawano
2017/05/22 07:33:19
Thank you for letting me know about this! Rebased
| |
| 79 return base::StartsWith(application_id, kArcProcessNamePrefix, | 79 exo::ShellSurface::GetApplicationId(window); |
| 80 return application_id && | |
| 81 base::StartsWith(*application_id, kArcProcessNamePrefix, | |
| 80 base::CompareCase::SENSITIVE); | 82 base::CompareCase::SENSITIVE); |
| 81 } | 83 } |
| 82 | 84 |
| 83 bool IsArcMemoryManagementEnabled() { | 85 bool IsArcMemoryManagementEnabled() { |
| 84 return base::FeatureList::IsEnabled(features::kArcMemoryManagement); | 86 return base::FeatureList::IsEnabled(features::kArcMemoryManagement); |
| 85 } | 87 } |
| 86 | 88 |
| 87 void OnSetOomScoreAdj(bool success, const std::string& output) { | 89 void OnSetOomScoreAdj(bool success, const std::string& output) { |
| 88 VLOG(2) << "OnSetOomScoreAdj " << success << " " << output; | 90 VLOG(2) << "OnSetOomScoreAdj " << success << " " << output; |
| 89 if (!success) | 91 if (!success) |
| (...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 770 priority += priority_increment; | 772 priority += priority_increment; |
| 771 } | 773 } |
| 772 | 774 |
| 773 if (oom_scores_to_change.size()) { | 775 if (oom_scores_to_change.size()) { |
| 774 GetDebugDaemonClient()->SetOomScoreAdj( | 776 GetDebugDaemonClient()->SetOomScoreAdj( |
| 775 oom_scores_to_change, base::Bind(&OnSetOomScoreAdj)); | 777 oom_scores_to_change, base::Bind(&OnSetOomScoreAdj)); |
| 776 } | 778 } |
| 777 } | 779 } |
| 778 | 780 |
| 779 } // namespace memory | 781 } // namespace memory |
| OLD | NEW |