| 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 <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/callback_forward.h" | 14 #include "base/callback_forward.h" |
| 15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/memory/singleton.h" | 18 #include "base/memory/singleton.h" |
| 19 #include "base/observer_list.h" | 19 #include "base/observer_list.h" |
| 20 #include "base/strings/string16.h" | 20 #include "base/strings/string16.h" |
| 21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
| 22 #include "chrome/browser/task_manager/resource_provider.h" | 22 #include "chrome/browser/task_manager/resource_provider.h" |
| 23 #include "chrome/browser/ui/host_desktop.h" | 23 #include "chrome/browser/ui/host_desktop.h" |
| 24 #include "gpu/ipc/common/memory_stats.h" | 24 #include "content/public/common/gpu_memory_stats.h" |
| 25 #include "third_party/WebKit/public/web/WebCache.h" | 25 #include "third_party/WebKit/public/web/WebCache.h" |
| 26 | 26 |
| 27 class PrefRegistrySimple; | 27 class PrefRegistrySimple; |
| 28 class PrivateWorkingSetSnapshot; | 28 class PrivateWorkingSetSnapshot; |
| 29 class TaskManagerModel; | 29 class TaskManagerModel; |
| 30 class TaskManagerModelGpuDataManagerObserver; | 30 class TaskManagerModelGpuDataManagerObserver; |
| 31 | 31 |
| 32 namespace base { | 32 namespace base { |
| 33 class ProcessMetrics; | 33 class ProcessMetrics; |
| 34 } | 34 } |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 void ModelChanged(); | 291 void ModelChanged(); |
| 292 | 292 |
| 293 // Updates the values for all rows. | 293 // Updates the values for all rows. |
| 294 void Refresh(); | 294 void Refresh(); |
| 295 | 295 |
| 296 // Do a bulk repopulation of the physical_memory data on platforms where that | 296 // Do a bulk repopulation of the physical_memory data on platforms where that |
| 297 // is faster. | 297 // is faster. |
| 298 void RefreshPhysicalMemoryFromWorkingSetSnapshot(); | 298 void RefreshPhysicalMemoryFromWorkingSetSnapshot(); |
| 299 | 299 |
| 300 void NotifyVideoMemoryUsageStats( | 300 void NotifyVideoMemoryUsageStats( |
| 301 const gpu::VideoMemoryUsageStats& video_memory_usage_stats); | 301 const content::GPUVideoMemoryUsageStats& video_memory_usage_stats); |
| 302 | 302 |
| 303 void NotifyBytesRead(const net::URLRequest& request, int64_t bytes_read); | 303 void NotifyBytesRead(const net::URLRequest& request, int64_t bytes_read); |
| 304 | 304 |
| 305 void RegisterOnDataReadyCallback(const base::Closure& callback); | 305 void RegisterOnDataReadyCallback(const base::Closure& callback); |
| 306 | 306 |
| 307 void NotifyDataReady(); | 307 void NotifyDataReady(); |
| 308 | 308 |
| 309 private: | 309 private: |
| 310 friend class base::RefCountedThreadSafe<TaskManagerModel>; | 310 friend class base::RefCountedThreadSafe<TaskManagerModel>; |
| 311 friend class TaskManagerBrowserTest; | 311 friend class TaskManagerBrowserTest; |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 | 502 |
| 503 // A map to retrieve the process metrics for a process. The ProcessMetrics are | 503 // A map to retrieve the process metrics for a process. The ProcessMetrics are |
| 504 // owned by the model. | 504 // owned by the model. |
| 505 MetricsMap metrics_map_; | 505 MetricsMap metrics_map_; |
| 506 | 506 |
| 507 // A map that keeps track of the number of bytes read per process since last | 507 // A map that keeps track of the number of bytes read per process since last |
| 508 // tick. The Resources are owned by the ResourceProviders. | 508 // tick. The Resources are owned by the ResourceProviders. |
| 509 ResourceValueMap current_byte_count_map_; | 509 ResourceValueMap current_byte_count_map_; |
| 510 | 510 |
| 511 // A map that contains the video memory usage for a process | 511 // A map that contains the video memory usage for a process |
| 512 gpu::VideoMemoryUsageStats video_memory_usage_stats_; | 512 content::GPUVideoMemoryUsageStats video_memory_usage_stats_; |
| 513 | 513 |
| 514 // Set to true when we've requested video stats and false once we get them. | 514 // Set to true when we've requested video stats and false once we get them. |
| 515 bool pending_video_memory_usage_stats_update_; | 515 bool pending_video_memory_usage_stats_update_; |
| 516 | 516 |
| 517 // An observer waiting for video memory usage stats updates from the GPU | 517 // An observer waiting for video memory usage stats updates from the GPU |
| 518 // process | 518 // process |
| 519 scoped_ptr<TaskManagerModelGpuDataManagerObserver> | 519 scoped_ptr<TaskManagerModelGpuDataManagerObserver> |
| 520 video_memory_usage_stats_observer_; | 520 video_memory_usage_stats_observer_; |
| 521 | 521 |
| 522 base::ObserverList<TaskManagerModelObserver> observer_list_; | 522 base::ObserverList<TaskManagerModelObserver> observer_list_; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 549 // All per-Resource values are stored here. | 549 // All per-Resource values are stored here. |
| 550 mutable PerResourceCache per_resource_cache_; | 550 mutable PerResourceCache per_resource_cache_; |
| 551 | 551 |
| 552 // All per-Process values are stored here. | 552 // All per-Process values are stored here. |
| 553 mutable PerProcessCache per_process_cache_; | 553 mutable PerProcessCache per_process_cache_; |
| 554 | 554 |
| 555 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); | 555 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); |
| 556 }; | 556 }; |
| 557 | 557 |
| 558 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ | 558 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ |
| OLD | NEW |