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

Side by Side Diff: chrome/browser/task_manager_resource_providers.cc

Issue 3118003: Revert 55449 - Fix some problems with TaskManagerBrowserTest.PopulateWebCache... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 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
« no previous file with comments | « chrome/browser/task_manager_resource_providers.h ('k') | chrome/common/notification_type.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "chrome/browser/task_manager_resource_providers.h" 5 #include "chrome/browser/task_manager_resource_providers.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #endif // defined(OS_WIN) 47 #endif // defined(OS_WIN)
48 48
49 //////////////////////////////////////////////////////////////////////////////// 49 ////////////////////////////////////////////////////////////////////////////////
50 // TaskManagerTabContentsResource class 50 // TaskManagerTabContentsResource class
51 //////////////////////////////////////////////////////////////////////////////// 51 ////////////////////////////////////////////////////////////////////////////////
52 52
53 TaskManagerTabContentsResource::TaskManagerTabContentsResource( 53 TaskManagerTabContentsResource::TaskManagerTabContentsResource(
54 TabContents* tab_contents) 54 TabContents* tab_contents)
55 : tab_contents_(tab_contents), 55 : tab_contents_(tab_contents),
56 pending_stats_update_(false), 56 pending_stats_update_(false),
57 had_stats_update_(false),
58 v8_memory_allocated_(0), 57 v8_memory_allocated_(0),
59 v8_memory_used_(0), 58 v8_memory_used_(0),
60 pending_v8_memory_allocated_update_(false) { 59 pending_v8_memory_allocated_update_(false) {
61 // We cache the process as when the TabContents is closed the process 60 // We cache the process as when the TabContents is closed the process
62 // becomes NULL and the TaskManager still needs it. 61 // becomes NULL and the TaskManager still needs it.
63 process_ = tab_contents_->GetRenderProcessHost()->GetHandle(); 62 process_ = tab_contents_->GetRenderProcessHost()->GetHandle();
64 pid_ = base::GetProcId(process_); 63 pid_ = base::GetProcId(process_);
65 memset(&stats_, 0, sizeof(stats_)); 64 stats_.images.size = 0;
65 stats_.cssStyleSheets.size = 0;
66 stats_.scripts.size = 0;
67 stats_.xslStyleSheets.size = 0;
68 stats_.fonts.size = 0;
66 } 69 }
67 70
68 TaskManagerTabContentsResource::~TaskManagerTabContentsResource() { 71 TaskManagerTabContentsResource::~TaskManagerTabContentsResource() {
69 } 72 }
70 73
71 std::wstring TaskManagerTabContentsResource::GetTitle() const { 74 std::wstring TaskManagerTabContentsResource::GetTitle() const {
72 // Fall back on the URL if there's no title. 75 // Fall back on the URL if there's no title.
73 std::wstring tab_title(UTF16ToWideHack(tab_contents_->GetTitle())); 76 std::wstring tab_title(UTF16ToWideHack(tab_contents_->GetTitle()));
74 if (tab_title.empty()) { 77 if (tab_title.empty()) {
75 tab_title = UTF8ToWide(tab_contents_->GetURL().spec()); 78 tab_title = UTF8ToWide(tab_contents_->GetURL().spec());
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 115 }
113 116
114 size_t TaskManagerTabContentsResource::GetV8MemoryUsed() const { 117 size_t TaskManagerTabContentsResource::GetV8MemoryUsed() const {
115 return v8_memory_used_; 118 return v8_memory_used_;
116 } 119 }
117 120
118 void TaskManagerTabContentsResource::NotifyResourceTypeStats( 121 void TaskManagerTabContentsResource::NotifyResourceTypeStats(
119 const WebKit::WebCache::ResourceTypeStats& stats) { 122 const WebKit::WebCache::ResourceTypeStats& stats) {
120 stats_ = stats; 123 stats_ = stats;
121 pending_stats_update_ = false; 124 pending_stats_update_ = false;
122 had_stats_update_ = true;
123 } 125 }
124 126
125 void TaskManagerTabContentsResource::NotifyV8HeapStats( 127 void TaskManagerTabContentsResource::NotifyV8HeapStats(
126 size_t v8_memory_allocated, size_t v8_memory_used) { 128 size_t v8_memory_allocated, size_t v8_memory_used) {
127 v8_memory_allocated_ = v8_memory_allocated; 129 v8_memory_allocated_ = v8_memory_allocated;
128 v8_memory_used_ = v8_memory_used; 130 v8_memory_used_ = v8_memory_used;
129 pending_v8_memory_allocated_update_ = false; 131 pending_v8_memory_allocated_update_ = false;
130 } 132 }
131 133
132 SkBitmap TaskManagerTabContentsResource::GetIcon() const { 134 SkBitmap TaskManagerTabContentsResource::GetIcon() const {
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 905
904 return &resource_; 906 return &resource_;
905 } 907 }
906 908
907 void TaskManagerBrowserProcessResourceProvider::StartUpdating() { 909 void TaskManagerBrowserProcessResourceProvider::StartUpdating() {
908 task_manager_->AddResource(&resource_); 910 task_manager_->AddResource(&resource_);
909 } 911 }
910 912
911 void TaskManagerBrowserProcessResourceProvider::StopUpdating() { 913 void TaskManagerBrowserProcessResourceProvider::StopUpdating() {
912 } 914 }
OLDNEW
« no previous file with comments | « chrome/browser/task_manager_resource_providers.h ('k') | chrome/common/notification_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698