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

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

Issue 9473001: Extract minimal RenderViewHost interface for embedders, leaving (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ready for initial review. Created 8 years, 9 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 #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/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/i18n/number_formatting.h" 9 #include "base/i18n/number_formatting.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 } 820 }
821 } 821 }
822 } 822 }
823 823
824 void TaskManagerModel::NotifyFPS(base::ProcessId renderer_id, 824 void TaskManagerModel::NotifyFPS(base::ProcessId renderer_id,
825 int routing_id, 825 int routing_id,
826 float fps) { 826 float fps) {
827 for (ResourceList::iterator it = resources_.begin(); 827 for (ResourceList::iterator it = resources_.begin();
828 it != resources_.end(); ++it) { 828 it != resources_.end(); ++it) {
829 if (base::GetProcId((*it)->GetProcess()) == renderer_id && 829 if (base::GetProcId((*it)->GetProcess()) == renderer_id &&
830 (*it)->GetRoutingId() == routing_id) { 830 (*it)->GetRoutingID() == routing_id) {
831 (*it)->NotifyFPS(fps); 831 (*it)->NotifyFPS(fps);
832 } 832 }
833 } 833 }
834 } 834 }
835 835
836 void TaskManagerModel::NotifyV8HeapStats(base::ProcessId renderer_id, 836 void TaskManagerModel::NotifyV8HeapStats(base::ProcessId renderer_id,
837 size_t v8_memory_allocated, 837 size_t v8_memory_allocated,
838 size_t v8_memory_used) { 838 size_t v8_memory_used) {
839 for (ResourceList::iterator it = resources_.begin(); 839 for (ResourceList::iterator it = resources_.begin();
840 it != resources_.end(); ++it) { 840 it != resources_.end(); ++it) {
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 base::KillProcess(process, content::RESULT_CODE_KILLED, false); 1043 base::KillProcess(process, content::RESULT_CODE_KILLED, false);
1044 } 1044 }
1045 1045
1046 void TaskManager::ActivateProcess(int index) { 1046 void TaskManager::ActivateProcess(int index) {
1047 // GetResourceTabContents returns a pointer to the relevant tab contents for 1047 // GetResourceTabContents returns a pointer to the relevant tab contents for
1048 // the resource. If the index doesn't correspond to a Tab (i.e. refers to 1048 // the resource. If the index doesn't correspond to a Tab (i.e. refers to
1049 // the Browser process or a plugin), GetTabContents will return NULL. 1049 // the Browser process or a plugin), GetTabContents will return NULL.
1050 TabContentsWrapper* chosen_tab_contents = 1050 TabContentsWrapper* chosen_tab_contents =
1051 model_->GetResourceTabContents(index); 1051 model_->GetResourceTabContents(index);
1052 if (chosen_tab_contents) { 1052 if (chosen_tab_contents) {
1053 chosen_tab_contents->web_contents()->GetRenderViewHost()->delegate()-> 1053 chosen_tab_contents->web_contents()->GetRenderViewHost()->GetDelegate()->
1054 Activate(); 1054 Activate();
1055 } 1055 }
1056 } 1056 }
1057 1057
1058 void TaskManager::AddResource(Resource* resource) { 1058 void TaskManager::AddResource(Resource* resource) {
1059 model_->AddResource(resource); 1059 model_->AddResource(resource);
1060 } 1060 }
1061 1061
1062 void TaskManager::RemoveResource(Resource* resource) { 1062 void TaskManager::RemoveResource(Resource* resource) {
1063 model_->RemoveResource(resource); 1063 model_->RemoveResource(resource);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1164 // Count the number of extensions with background pages (including 1164 // Count the number of extensions with background pages (including
1165 // incognito). 1165 // incognito).
1166 count += CountExtensionBackgroundPagesForProfile(profile); 1166 count += CountExtensionBackgroundPagesForProfile(profile);
1167 if (profile->HasOffTheRecordProfile()) { 1167 if (profile->HasOffTheRecordProfile()) {
1168 count += CountExtensionBackgroundPagesForProfile( 1168 count += CountExtensionBackgroundPagesForProfile(
1169 profile->GetOffTheRecordProfile()); 1169 profile->GetOffTheRecordProfile());
1170 } 1170 }
1171 } 1171 }
1172 return count; 1172 return count;
1173 } 1173 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698