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 "content/public/common/gpu_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 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 content::GPUVideoMemoryUsageStats& video_memory_usage_stats); | 301 const gpu::VideoMemoryUsageStats& 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 | 504 |
505 // A map to retrieve the process metrics for a process. The ProcessMetrics are | 505 // A map to retrieve the process metrics for a process. The ProcessMetrics are |
506 // owned by the model. | 506 // owned by the model. |
507 MetricsMap metrics_map_; | 507 MetricsMap metrics_map_; |
508 | 508 |
509 // A map that keeps track of the number of bytes read per process since last | 509 // A map that keeps track of the number of bytes read per process since last |
510 // tick. The Resources are owned by the ResourceProviders. | 510 // tick. The Resources are owned by the ResourceProviders. |
511 ResourceValueMap current_byte_count_map_; | 511 ResourceValueMap current_byte_count_map_; |
512 | 512 |
513 // A map that contains the video memory usage for a process | 513 // A map that contains the video memory usage for a process |
514 content::GPUVideoMemoryUsageStats video_memory_usage_stats_; | 514 gpu::VideoMemoryUsageStats video_memory_usage_stats_; |
515 | 515 |
516 // Set to true when we've requested video stats and false once we get them. | 516 // Set to true when we've requested video stats and false once we get them. |
517 bool pending_video_memory_usage_stats_update_; | 517 bool pending_video_memory_usage_stats_update_; |
518 | 518 |
519 // An observer waiting for video memory usage stats updates from the GPU | 519 // An observer waiting for video memory usage stats updates from the GPU |
520 // process | 520 // process |
521 scoped_ptr<TaskManagerModelGpuDataManagerObserver> | 521 scoped_ptr<TaskManagerModelGpuDataManagerObserver> |
522 video_memory_usage_stats_observer_; | 522 video_memory_usage_stats_observer_; |
523 | 523 |
524 base::ObserverList<TaskManagerModelObserver> observer_list_; | 524 base::ObserverList<TaskManagerModelObserver> observer_list_; |
(...skipping 26 matching lines...) Expand all Loading... |
551 // All per-Resource values are stored here. | 551 // All per-Resource values are stored here. |
552 mutable PerResourceCache per_resource_cache_; | 552 mutable PerResourceCache per_resource_cache_; |
553 | 553 |
554 // All per-Process values are stored here. | 554 // All per-Process values are stored here. |
555 mutable PerProcessCache per_process_cache_; | 555 mutable PerProcessCache per_process_cache_; |
556 | 556 |
557 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); | 557 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); |
558 }; | 558 }; |
559 | 559 |
560 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ | 560 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ |
OLD | NEW |