Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_TASK_MANAGER_TASK_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ |
| 6 #define CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ | 6 #define CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <memory> | 12 #include <memory> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/callback_forward.h" | 15 #include "base/callback_forward.h" |
| 16 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "base/memory/singleton.h" | 19 #include "base/memory/singleton.h" |
| 20 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
| 21 #include "base/strings/string16.h" | 21 #include "base/strings/string16.h" |
| 22 #include "build/build_config.h" | 22 #include "build/build_config.h" |
| 23 #include "chrome/browser/task_manager/resource_provider.h" | 23 #include "chrome/browser/task_manager/resource_provider.h" |
| 24 #include "gpu/ipc/common/memory_stats.h" | 24 #include "gpu/ipc/common/memory_stats.h" |
| 25 #include "third_party/WebKit/public/web/WebCache.h" | 25 #include "third_party/WebKit/public/web/WebCache.h" |
| 26 | 26 |
| 27 // ----------------------------------------------------------------------------- | |
| 28 // DEPRECATED: | |
| 29 // - This is currently enabled only on MacOSX, and will be removed soon (See | |
| 30 // crbug.com/528486). | |
| 31 // - Please don't add any new stuff here. See the new implementation in | |
| 32 // //src/chrome/browser/task_management. | |
| 33 // ----------------------------------------------------------------------------- | |
|
Lei Zhang
2016/04/23 00:52:32
Do we have a timeline for when this gets removed?
afakhry
2016/04/25 20:02:50
Great idea! Done.
| |
| 34 | |
| 27 class PrefRegistrySimple; | 35 class PrefRegistrySimple; |
| 28 class PrivateWorkingSetSnapshot; | 36 class PrivateWorkingSetSnapshot; |
| 29 class TaskManagerModel; | 37 class TaskManagerModel; |
| 30 class TaskManagerModelGpuDataManagerObserver; | 38 class TaskManagerModelGpuDataManagerObserver; |
| 31 | 39 |
| 32 namespace base { | 40 namespace base { |
| 33 class ProcessMetrics; | 41 class ProcessMetrics; |
| 34 } | 42 } |
| 35 | 43 |
| 36 namespace content { | 44 namespace content { |
| 37 class WebContents; | 45 class WebContents; |
| 38 } | 46 } |
| 39 | 47 |
| 40 namespace extensions { | 48 namespace extensions { |
| 41 class Extension; | 49 class Extension; |
| 42 } | 50 } |
| 43 | 51 |
| 44 namespace gfx { | 52 namespace gfx { |
| 45 class ImageSkia; | 53 class ImageSkia; |
| 46 } | 54 } |
| 47 | 55 |
| 48 namespace net { | 56 namespace net { |
| 49 class URLRequest; | 57 class URLRequest; |
| 50 } | 58 } |
| 51 | 59 |
| 52 // This class is a singleton. | 60 // This class is a singleton. |
| 53 class TaskManager { | 61 class TaskManager { |
| 54 public: | 62 public: |
| 55 static void RegisterPrefs(PrefRegistrySimple* registry); | |
| 56 | |
| 57 // Returns true if the user is allowed to end processes. | |
| 58 static bool IsEndProcessEnabled(); | |
| 59 | |
| 60 // Returns true if the process at the specified index is the browser process. | 63 // Returns true if the process at the specified index is the browser process. |
| 61 bool IsBrowserProcess(int index) const; | 64 bool IsBrowserProcess(int index) const; |
| 62 | 65 |
| 63 // Terminates the process at the specified index. | 66 // Terminates the process at the specified index. |
| 64 void KillProcess(int index); | 67 void KillProcess(int index); |
| 65 | 68 |
| 66 // Activates the browser tab associated with the process in the specified | 69 // Activates the browser tab associated with the process in the specified |
| 67 // index. | 70 // index. |
| 68 void ActivateProcess(int index); | 71 void ActivateProcess(int index); |
| 69 | 72 |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 552 // All per-Resource values are stored here. | 555 // All per-Resource values are stored here. |
| 553 mutable PerResourceCache per_resource_cache_; | 556 mutable PerResourceCache per_resource_cache_; |
| 554 | 557 |
| 555 // All per-Process values are stored here. | 558 // All per-Process values are stored here. |
| 556 mutable PerProcessCache per_process_cache_; | 559 mutable PerProcessCache per_process_cache_; |
| 557 | 560 |
| 558 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); | 561 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); |
| 559 }; | 562 }; |
| 560 | 563 |
| 561 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ | 564 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ |
| OLD | NEW |