diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-10 05:23:33 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-10 05:23:33 +0000 |
commit | 9c85204b1fd755b70de7974e24b7cf4e4b5ffefa (patch) | |
tree | 47ba98558e3ffc2b571ad56923b2e4f7c878a395 /chrome/browser/task_manager.cc | |
parent | 05d3fc7b93bc8498aac8fb798b4adebad257633d (diff) | |
download | chromium_src-9c85204b1fd755b70de7974e24b7cf4e4b5ffefa.zip chromium_src-9c85204b1fd755b70de7974e24b7cf4e4b5ffefa.tar.gz chromium_src-9c85204b1fd755b70de7974e24b7cf4e4b5ffefa.tar.bz2 |
Revert 55449 - Fix some problems with TaskManagerBrowserTest.PopulateWebCacheFields:
- wait for an actual update to occur; otherwise we're not testing the real thing
- change DCHECKs to EXPECT_EQs; that's what we should use in tests
This change should also fix the crashiness of this test.
TEST=browser_tests
BUG=42301
Review URL: http://codereview.chromium.org/2856091
TBR=phajdan.jr@chromium.org,glen@chromium.org
Review URL: http://codereview.chromium.org/3118003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55530 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/task_manager.cc')
-rw-r--r-- | chrome/browser/task_manager.cc | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/chrome/browser/task_manager.cc b/chrome/browser/task_manager.cc index 79d2e9d..8677620 100644 --- a/chrome/browser/task_manager.cc +++ b/chrome/browser/task_manager.cc @@ -24,7 +24,6 @@ #include "chrome/browser/renderer_host/resource_dispatcher_host.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/task_manager_resource_providers.h" -#include "chrome/common/notification_service.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "grit/app_resources.h" @@ -180,7 +179,7 @@ std::wstring TaskManagerModel::GetResourceGoatsTeleported(int index) const { std::wstring TaskManagerModel::GetResourceWebCoreImageCacheSize( int index) const { DCHECK(index < ResourceCount()); - if (!resources_[index]->HasCacheStats()) + if (!resources_[index]->ReportsCacheStats()) return l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT); const WebKit::WebCache::ResourceTypeStats stats( resources_[index]->GetWebCoreCacheStats()); @@ -190,7 +189,7 @@ std::wstring TaskManagerModel::GetResourceWebCoreImageCacheSize( std::wstring TaskManagerModel::GetResourceWebCoreScriptsCacheSize( int index) const { DCHECK(index < ResourceCount()); - if (!resources_[index]->HasCacheStats()) + if (!resources_[index]->ReportsCacheStats()) return l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT); const WebKit::WebCache::ResourceTypeStats stats( resources_[index]->GetWebCoreCacheStats()); @@ -200,7 +199,7 @@ std::wstring TaskManagerModel::GetResourceWebCoreScriptsCacheSize( std::wstring TaskManagerModel::GetResourceWebCoreCSSCacheSize( int index) const { DCHECK(index < ResourceCount()); - if (!resources_[index]->HasCacheStats()) + if (!resources_[index]->ReportsCacheStats()) return l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT); const WebKit::WebCache::ResourceTypeStats stats( resources_[index]->GetWebCoreCacheStats()); @@ -339,9 +338,9 @@ int TaskManagerModel::CompareValues(int row1, int row2, int col_id) const { case IDS_TASK_MANAGER_WEBCORE_CSS_CACHE_COLUMN: { WebKit::WebCache::ResourceTypeStats stats1 = { { 0 } }; WebKit::WebCache::ResourceTypeStats stats2 = { { 0 } }; - if (resources_[row1]->HasCacheStats()) + if (resources_[row1]->ReportsCacheStats()) stats1 = resources_[row1]->GetWebCoreCacheStats(); - if (resources_[row2]->HasCacheStats()) + if (resources_[row2]->ReportsCacheStats()) stats2 = resources_[row2]->GetWebCoreCacheStats(); if (IDS_TASK_MANAGER_WEBCORE_IMAGE_CACHE_COLUMN == col_id) return ValueCompare<size_t>(stats1.images.size, stats2.images.size); @@ -688,10 +687,6 @@ void TaskManagerModel::NotifyResourceTypeStats( (*it)->NotifyResourceTypeStats(stats); } } - NotificationService::current()->Notify( - NotificationType::TASK_MANAGER_RESOURCE_TYPE_STATS_UPDATED, - Source<TaskManagerModel>(this), - NotificationService::NoDetails()); } void TaskManagerModel::NotifyV8HeapStats(base::ProcessId renderer_id, |