diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-13 17:27:01 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-13 17:27:01 +0000 |
commit | d277d432270803785ad05293674789c5f711b325 (patch) | |
tree | 750ec294bbc2befd8d65ce628a24926800e6e4d9 /chrome/browser/task_manager.cc | |
parent | 26eb09f69b07041c3fb674205aca65e2faa3996e (diff) | |
download | chromium_src-d277d432270803785ad05293674789c5f711b325.zip chromium_src-d277d432270803785ad05293674789c5f711b325.tar.gz chromium_src-d277d432270803785ad05293674789c5f711b325.tar.bz2 |
Refactors freaky TaskManager::Resource self-updating
Currently, TaskManagerTabContentsResource supports getting WebCore cache information. This information has to be fetched from the renderer process via an IPC round-trip. Currently, the Resource updates itself whenever a query is made from the View via the TaskManagerModel::GetResourceWebCore*() methods, which seems very wrong from a design POV and is tricky to test. This patch cleans up the picture a bit by routing the TaskManagerModel::Refresh() call to interested TaskManager::Resource objects.
TEST=try bots, open task manager + right click to enable cache columns, browse around, observe updated values
BUG=none
Review URL: http://codereview.chromium.org/267062
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28829 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/task_manager.cc')
-rw-r--r-- | chrome/browser/task_manager.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/task_manager.cc b/chrome/browser/task_manager.cc index bbc77da..5e019b8 100644 --- a/chrome/browser/task_manager.cc +++ b/chrome/browser/task_manager.cc @@ -635,6 +635,13 @@ void TaskManagerModel::Refresh() { // Then we reset the current byte count. iter->second = 0; } + + // Let resources update themselves if they need to. + for (ResourceList::iterator iter = resources_.begin(); + iter != resources_.end(); ++iter) { + (*iter)->Refresh(); + } + if (!resources_.empty()) { FOR_EACH_OBSERVER(TaskManagerModelObserver, observer_list_, OnItemsChanged(0, ResourceCount())); |