Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: chrome/browser/task_manager/task_manager.h

Issue 10861018: Fix memory leaks from adding GPU memory to task manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <map> 8 #include <map>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/gtest_prod_util.h" 13 #include "base/gtest_prod_util.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "base/memory/singleton.h" 15 #include "base/memory/singleton.h"
16 #include "base/observer_list.h" 16 #include "base/observer_list.h"
17 #include "base/process_util.h" 17 #include "base/process_util.h"
18 #include "base/string16.h" 18 #include "base/string16.h"
19 #include "base/timer.h" 19 #include "base/timer.h"
20 #include "chrome/browser/renderer_host/web_cache_manager.h" 20 #include "chrome/browser/renderer_host/web_cache_manager.h"
21 #include "content/public/common/gpu_memory_stats.h" 21 #include "content/public/common/gpu_memory_stats.h"
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h"
23 23
24 class TaskManagerModel; 24 class TaskManagerModel;
25 class TaskManagerModelGpuDataManagerObserver;
25 26
26 namespace base { 27 namespace base {
27 class ProcessMetrics; 28 class ProcessMetrics;
28 } 29 }
29 30
30 namespace content { 31 namespace content {
31 class WebContents; 32 class WebContents;
32 } 33 }
33 34
34 namespace extensions { 35 namespace extensions {
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 // per second. It is computed every time the timer ticks. The Resources are 565 // per second. It is computed every time the timer ticks. The Resources are
565 // owned by the ResourceProviders. 566 // owned by the ResourceProviders.
566 ResourceValueMap displayed_network_usage_map_; 567 ResourceValueMap displayed_network_usage_map_;
567 568
568 // A map that contains the CPU usage (in %) for a process since last refresh. 569 // A map that contains the CPU usage (in %) for a process since last refresh.
569 CPUUsageMap cpu_usage_map_; 570 CPUUsageMap cpu_usage_map_;
570 571
571 // A map that contains the video memory usage for a process 572 // A map that contains the video memory usage for a process
572 content::GPUVideoMemoryUsageStats video_memory_usage_stats_; 573 content::GPUVideoMemoryUsageStats video_memory_usage_stats_;
573 bool pending_video_memory_usage_stats_update_; 574 bool pending_video_memory_usage_stats_update_;
574 575
ccameron 2012/08/20 21:20:02 The dtor for the observer will call into GpuDataMa
576 // An observer waiting for video memory usage stats updates from the GPU
577 // process
578 scoped_ptr<TaskManagerModelGpuDataManagerObserver>
579 video_memory_usage_stats_observer_;
580
575 // A map that contains the private/shared memory usage of the process. We 581 // A map that contains the private/shared memory usage of the process. We
576 // cache this because the same APIs are called on linux and windows, and 582 // cache this because the same APIs are called on linux and windows, and
577 // because the linux call takes >10ms to complete. This cache is cleared on 583 // because the linux call takes >10ms to complete. This cache is cleared on
578 // every Refresh(). 584 // every Refresh().
579 mutable MemoryUsageMap memory_usage_map_; 585 mutable MemoryUsageMap memory_usage_map_;
580 586
581 ObserverList<TaskManagerModelObserver> observer_list_; 587 ObserverList<TaskManagerModelObserver> observer_list_;
582 588
583 // How many calls to StartUpdating have been made without matching calls to 589 // How many calls to StartUpdating have been made without matching calls to
584 // StopUpdating. 590 // StopUpdating.
585 int update_requests_; 591 int update_requests_;
586 592
587 // How many calls to StartListening have been made without matching calls to 593 // How many calls to StartListening have been made without matching calls to
588 // StopListening. 594 // StopListening.
589 int listen_requests_; 595 int listen_requests_;
590 596
591 // Whether we are currently in the process of updating. 597 // Whether we are currently in the process of updating.
592 UpdateState update_state_; 598 UpdateState update_state_;
593 599
594 // A salt lick for the goats. 600 // A salt lick for the goats.
595 uint64 goat_salt_; 601 uint64 goat_salt_;
596 602
597 // Resource identifier that is unique within single session. 603 // Resource identifier that is unique within single session.
598 int last_unique_id_; 604 int last_unique_id_;
599 605
600 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel); 606 DISALLOW_COPY_AND_ASSIGN(TaskManagerModel);
601 }; 607 };
602 608
603 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_ 609 #endif // CHROME_BROWSER_TASK_MANAGER_TASK_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/task_manager/task_manager.cc » ('j') | content/browser/gpu/gpu_process_host.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698