| 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 #ifndef CHROME_BROWSER_MEMORY_TAB_MANAGER_DELEGATE_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_MANAGER_DELEGATE_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_MEMORY_TAB_MANAGER_DELEGATE_CHROMEOS_H_ | 6 #define CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_MANAGER_DELEGATE_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "base/process/process.h" | 18 #include "base/process/process.h" |
| 19 #include "base/timer/timer.h" | 19 #include "base/timer/timer.h" |
| 20 #include "chrome/browser/chromeos/arc/process/arc_process.h" | 20 #include "chrome/browser/chromeos/arc/process/arc_process.h" |
| 21 #include "chrome/browser/memory/tab_manager.h" | 21 #include "chrome/browser/resource_coordinator/tab_manager.h" |
| 22 #include "chrome/browser/memory/tab_stats.h" | 22 #include "chrome/browser/resource_coordinator/tab_stats.h" |
| 23 #include "chrome/browser/ui/browser_list_observer.h" | 23 #include "chrome/browser/ui/browser_list_observer.h" |
| 24 #include "chromeos/dbus/debug_daemon_client.h" | 24 #include "chromeos/dbus/debug_daemon_client.h" |
| 25 #include "components/arc/common/process.mojom.h" | 25 #include "components/arc/common/process.mojom.h" |
| 26 #include "components/arc/instance_holder.h" | 26 #include "components/arc/instance_holder.h" |
| 27 #include "content/public/browser/notification_observer.h" | 27 #include "content/public/browser/notification_observer.h" |
| 28 #include "content/public/browser/notification_registrar.h" | 28 #include "content/public/browser/notification_registrar.h" |
| 29 #include "ui/wm/public/activation_change_observer.h" | 29 #include "ui/wm/public/activation_change_observer.h" |
| 30 | 30 |
| 31 namespace memory { | 31 namespace resource_coordinator { |
| 32 | 32 |
| 33 // Possible types of Apps/Tabs processes. From most important to least | 33 // Possible types of Apps/Tabs processes. From most important to least |
| 34 // important. | 34 // important. |
| 35 enum class ProcessType { | 35 enum class ProcessType { |
| 36 // Conceptually, the system cannot have both FOCUSED_TAB and FOCUSED_APP at | 36 // Conceptually, the system cannot have both FOCUSED_TAB and FOCUSED_APP at |
| 37 // the same time, but because Chrome cannot retrieve FOCUSED_APP status | 37 // the same time, but because Chrome cannot retrieve FOCUSED_APP status |
| 38 // synchronously, Chrome may still see both at the same time. When that | 38 // synchronously, Chrome may still see both at the same time. When that |
| 39 // happens, treat FOCUSED_TAB as the most important since the (synchronously | 39 // happens, treat FOCUSED_TAB as the most important since the (synchronously |
| 40 // retrieved) tab information is more reliable and up-to-date. | 40 // retrieved) tab information is more reliable and up-to-date. |
| 41 FOCUSED_TAB = 1, | 41 FOCUSED_TAB = 1, |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 | 265 |
| 266 private: | 266 private: |
| 267 // Returns the low memory margin system config. Low memory condition is | 267 // Returns the low memory margin system config. Low memory condition is |
| 268 // reported if available memory is under the number. | 268 // reported if available memory is under the number. |
| 269 static int LowMemoryMarginKB(); | 269 static int LowMemoryMarginKB(); |
| 270 | 270 |
| 271 // Reads in an integer. | 271 // Reads in an integer. |
| 272 static int ReadIntFromFile(const char* file_name, int default_val); | 272 static int ReadIntFromFile(const char* file_name, int default_val); |
| 273 }; | 273 }; |
| 274 | 274 |
| 275 } // namespace memory | 275 } // namespace resource_coordinator |
| 276 | 276 |
| 277 #endif // CHROME_BROWSER_MEMORY_TAB_MANAGER_DELEGATE_CHROMEOS_H_ | 277 #endif // CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_MANAGER_DELEGATE_CHROMEOS_H_ |
| OLD | NEW |