| 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 // ----------------------------------------------------------------------------- |
| 34 #if !defined(OS_MACOSX) |
| 35 #error "The old task manager is deprecated on non-macos platforms." |
| 36 #endif // defined(OS_MACOSX) |
| 37 |
| 38 |
| 27 class PrefRegistrySimple; | 39 class PrefRegistrySimple; |
| 28 class PrivateWorkingSetSnapshot; | 40 class PrivateWorkingSetSnapshot; |
| 29 class TaskManagerModel; | 41 class TaskManagerModel; |
| 30 class TaskManagerModelGpuDataManagerObserver; | 42 class TaskManagerModelGpuDataManagerObserver; |
| 31 | 43 |
| 32 namespace base { | 44 namespace base { |
| 33 class ProcessMetrics; | 45 class ProcessMetrics; |
| 34 } | 46 } |
| 35 | 47 |
| 36 namespace content { | 48 namespace content { |
| 37 class WebContents; | 49 class WebContents; |
| 38 } | 50 } |
| 39 | 51 |
| 40 namespace extensions { | 52 namespace extensions { |
| 41 class Extension; | 53 class Extension; |
| 42 } | 54 } |
| 43 | 55 |
| 44 namespace gfx { | 56 namespace gfx { |
| 45 class ImageSkia; | 57 class ImageSkia; |
| 46 } | 58 } |
| 47 | 59 |
| 48 namespace net { | 60 namespace net { |
| 49 class URLRequest; | 61 class URLRequest; |
| 50 } | 62 } |
| 51 | 63 |
| 52 // This class is a singleton. | 64 // This class is a singleton. |
| 53 class TaskManager { | 65 class TaskManager { |
| 54 public: | 66 public: |
| 55 static void RegisterPrefs(PrefRegistrySimple* registry); | 67 // On Mac, if the views toolkit is enabled, the new implementation of the task |
| 56 | 68 // manager backend (in task_management/) will be used. |
| 57 // Returns true if the user is allowed to end processes. | 69 static bool NewTaskManagerEnabled(); |
| 58 static bool IsEndProcessEnabled(); | |
| 59 | 70 |
| 60 // Returns true if the process at the specified index is the browser process. | 71 // Returns true if the process at the specified index is the browser process. |
| 61 bool IsBrowserProcess(int index) const; | 72 bool IsBrowserProcess(int index) const; |
| 62 | 73 |
| 63 // Terminates the process at the specified index. | 74 // Terminates the process at the specified index. |
| 64 void KillProcess(int index); | 75 void KillProcess(int index); |
| 65 | 76 |
| 66 // Activates the browser tab associated with the process in the specified | 77 // Activates the browser tab associated with the process in the specified |
| 67 // index. | 78 // index. |
| 68 void ActivateProcess(int index); | 79 void ActivateProcess(int index); |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 // All per-Resource values are stored here. | 563 // All per-Resource values are stored here. |
| 553 mutable PerResourceCache per_resource_cache_; | 564 mutable PerResourceCache per_resource_cache_; |
| 554 | 565 |
| 555 // All per-Process values are stored here. | 566 // All per-Process values are stored here. |
| 556 mutable PerProcessCache per_process_cache_; | 567 mutable PerProcessCache per_process_cache_; |
| 557 | 568 |
| 558 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); | 569 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); |
| 559 }; | 570 }; |
| 560 | 571 |
| 561 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ | 572 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ |
| OLD | NEW |