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

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

Issue 8113035: Remove RenderProcessHost::is_extension_process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 years, 2 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/memory_details.h" 5 #include "chrome/browser/memory_details.h"
6 6
7 #include "base/file_version_info.h" 7 #include "base/file_version_info.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 if (type == ViewType::DEV_TOOLS_UI) 170 if (type == ViewType::DEV_TOOLS_UI)
171 process.renderer_type = ChildProcessInfo::RENDERER_DEVTOOLS; 171 process.renderer_type = ChildProcessInfo::RENDERER_DEVTOOLS;
172 else 172 else
173 process.renderer_type = ChildProcessInfo::RENDERER_CHROME; 173 process.renderer_type = ChildProcessInfo::RENDERER_CHROME;
174 } else if (extension_process_manager->AreBindingsEnabledForProcess( 174 } else if (extension_process_manager->AreBindingsEnabledForProcess(
175 host->process()->id())) { 175 host->process()->id())) {
176 process.renderer_type = ChildProcessInfo::RENDERER_EXTENSION; 176 process.renderer_type = ChildProcessInfo::RENDERER_EXTENSION;
177 } 177 }
178 TabContents* contents = host_delegate->GetAsTabContents(); 178 TabContents* contents = host_delegate->GetAsTabContents();
179 if (!contents) { 179 if (!contents) {
180 if (host->process()->is_extension_process()) { 180 if (extension_process_manager->IsExtensionProcess(
181 host->process()->id())) {
181 const Extension* extension = 182 const Extension* extension =
182 extension_service->GetExtensionByURL(url); 183 extension_service->GetExtensionByURL(url);
183 if (extension) { 184 if (extension) {
184 string16 title = UTF8ToUTF16(extension->name()); 185 string16 title = UTF8ToUTF16(extension->name());
185 process.titles.push_back(title); 186 process.titles.push_back(title);
186 } 187 }
187 } else if (process.renderer_type == 188 } else if (process.renderer_type ==
188 ChildProcessInfo::RENDERER_UNKNOWN) { 189 ChildProcessInfo::RENDERER_UNKNOWN) {
189 process.titles.push_back(UTF8ToUTF16(url.spec())); 190 process.titles.push_back(UTF8ToUTF16(url.spec()));
190 switch (type) { 191 switch (type) {
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 UMA_HISTOGRAM_COUNTS_100("Memory.PepperPluginProcessCount", 364 UMA_HISTOGRAM_COUNTS_100("Memory.PepperPluginProcessCount",
364 pepper_plugin_count); 365 pepper_plugin_count);
365 UMA_HISTOGRAM_COUNTS_100("Memory.RendererProcessCount", renderer_count); 366 UMA_HISTOGRAM_COUNTS_100("Memory.RendererProcessCount", renderer_count);
366 UMA_HISTOGRAM_COUNTS_100("Memory.WorkerProcessCount", worker_count); 367 UMA_HISTOGRAM_COUNTS_100("Memory.WorkerProcessCount", worker_count);
367 // TODO(viettrungluu): Do we want separate counts for the other 368 // TODO(viettrungluu): Do we want separate counts for the other
368 // (platform-specific) process types? 369 // (platform-specific) process types?
369 370
370 int total_sample = static_cast<int>(aggregate_memory / 1000); 371 int total_sample = static_cast<int>(aggregate_memory / 1000);
371 UMA_HISTOGRAM_MEMORY_MB("Memory.Total", total_sample); 372 UMA_HISTOGRAM_MEMORY_MB("Memory.Total", total_sample);
372 } 373 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_process_manager.cc ('k') | chrome/browser/metrics/metrics_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698