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

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

Issue 1081323003: Convert renderer JS memory usage reporting to use Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@utility-process-report-js-memory
Patch Set: Rebase and fix tests. Created 5 years, 7 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
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 #include "chrome/browser/task_manager/task_manager.h" 5 #include "chrome/browser/task_manager/task_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/i18n/number_formatting.h" 8 #include "base/i18n/number_formatting.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/prefs/pref_registry_simple.h" 10 #include "base/prefs/pref_registry_simple.h"
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 } 1209 }
1210 } 1210 }
1211 1211
1212 void TaskManagerModel::NotifyVideoMemoryUsageStats( 1212 void TaskManagerModel::NotifyVideoMemoryUsageStats(
1213 const content::GPUVideoMemoryUsageStats& video_memory_usage_stats) { 1213 const content::GPUVideoMemoryUsageStats& video_memory_usage_stats) {
1214 DCHECK(pending_video_memory_usage_stats_update_); 1214 DCHECK(pending_video_memory_usage_stats_update_);
1215 video_memory_usage_stats_ = video_memory_usage_stats; 1215 video_memory_usage_stats_ = video_memory_usage_stats;
1216 pending_video_memory_usage_stats_update_ = false; 1216 pending_video_memory_usage_stats_update_ = false;
1217 } 1217 }
1218 1218
1219 void TaskManagerModel::NotifyV8HeapStats(base::ProcessId renderer_id,
1220 size_t v8_memory_allocated,
1221 size_t v8_memory_used) {
1222 for (ResourceList::iterator it = resources_.begin();
1223 it != resources_.end(); ++it) {
1224 if (base::GetProcId((*it)->GetProcess()) == renderer_id) {
1225 (*it)->NotifyV8HeapStats(v8_memory_allocated, v8_memory_used);
1226 }
1227 }
1228 }
1229
1230 void TaskManagerModel::NotifyBytesRead(const net::URLRequest& request, 1219 void TaskManagerModel::NotifyBytesRead(const net::URLRequest& request,
1231 int byte_count) { 1220 int byte_count) {
1232 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 1221 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
1233 if (!is_updating_byte_count_) 1222 if (!is_updating_byte_count_)
1234 return; 1223 return;
1235 1224
1236 // Only net::URLRequestJob instances created by the ResourceDispatcherHost 1225 // Only net::URLRequestJob instances created by the ResourceDispatcherHost
1237 // have an associated ResourceRequestInfo and a render frame associated. 1226 // have an associated ResourceRequestInfo and a render frame associated.
1238 // All other jobs will have -1 returned for the render process child and 1227 // All other jobs will have -1 returned for the render process child and
1239 // routing ids - the jobs may still match a resource based on their origin id, 1228 // routing ids - the jobs may still match a resource based on their origin id,
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
1547 params.host_desktop_type = desktop_type; 1536 params.host_desktop_type = desktop_type;
1548 chrome::Navigate(&params); 1537 chrome::Navigate(&params);
1549 } 1538 }
1550 1539
1551 TaskManager::TaskManager() 1540 TaskManager::TaskManager()
1552 : model_(new TaskManagerModel(this)) { 1541 : model_(new TaskManagerModel(this)) {
1553 } 1542 }
1554 1543
1555 TaskManager::~TaskManager() { 1544 TaskManager::~TaskManager() {
1556 } 1545 }
OLDNEW
« no previous file with comments | « chrome/browser/task_manager/task_manager.h ('k') | chrome/browser/ui/webui/memory_internals/memory_internals_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698