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

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

Issue 8757014: Move GetProcessTypeNameInEnglish beside the ProcessType enum where it belongs. This also helps re... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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/bind.h" 7 #include "base/bind.h"
8 #include "base/file_version_info.h" 8 #include "base/file_version_info.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
13 #include "chrome/browser/extensions/extension_process_manager.h" 13 #include "chrome/browser/extensions/extension_process_manager.h"
14 #include "chrome/browser/extensions/extension_service.h" 14 #include "chrome/browser/extensions/extension_service.h"
15 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/common/chrome_view_type.h" 16 #include "chrome/common/chrome_view_type.h"
17 #include "chrome/common/extensions/extension.h" 17 #include "chrome/common/extensions/extension.h"
18 #include "chrome/common/url_constants.h" 18 #include "chrome/common/url_constants.h"
19 #include "content/browser/browser_child_process_host.h" 19 #include "content/browser/browser_child_process_host.h"
20 #include "content/browser/renderer_host/backing_store_manager.h" 20 #include "content/browser/renderer_host/backing_store_manager.h"
21 #include "content/browser/renderer_host/render_view_host.h" 21 #include "content/browser/renderer_host/render_view_host.h"
22 #include "content/browser/tab_contents/navigation_entry.h" 22 #include "content/browser/tab_contents/navigation_entry.h"
23 #include "content/browser/tab_contents/tab_contents.h" 23 #include "content/browser/tab_contents/tab_contents.h"
24 #include "content/common/child_process_info.h"
25 #include "content/public/browser/browser_thread.h" 24 #include "content/public/browser/browser_thread.h"
26 #include "content/public/browser/render_process_host.h" 25 #include "content/public/browser/render_process_host.h"
27 #include "content/public/common/bindings_policy.h" 26 #include "content/public/common/bindings_policy.h"
27 #include "content/public/common/process_type.h"
28 #include "grit/chromium_strings.h" 28 #include "grit/chromium_strings.h"
29 #include "grit/generated_resources.h" 29 #include "grit/generated_resources.h"
30 #include "ui/base/l10n/l10n_util.h" 30 #include "ui/base/l10n/l10n_util.h"
31 31
32 #if defined(OS_POSIX) && !defined(OS_MACOSX) 32 #if defined(OS_POSIX) && !defined(OS_MACOSX)
33 #include "content/browser/renderer_host/render_sandbox_host_linux.h" 33 #include "content/browser/renderer_host/render_sandbox_host_linux.h"
34 #include "content/browser/zygote_host_linux.h" 34 #include "content/browser/zygote_host_linux.h"
35 #endif 35 #endif
36 36
37 using content::BrowserThread; 37 using content::BrowserThread;
(...skipping 22 matching lines...) Expand all
60 return "Unknown"; 60 return "Unknown";
61 } 61 }
62 } 62 }
63 63
64 // static 64 // static
65 std::string ProcessMemoryInformation::GetFullTypeNameInEnglish( 65 std::string ProcessMemoryInformation::GetFullTypeNameInEnglish(
66 content::ProcessType type, 66 content::ProcessType type,
67 RendererProcessType rtype) { 67 RendererProcessType rtype) {
68 if (type == content::PROCESS_TYPE_RENDERER) 68 if (type == content::PROCESS_TYPE_RENDERER)
69 return GetRendererTypeNameInEnglish(rtype); 69 return GetRendererTypeNameInEnglish(rtype);
70 return ChildProcessInfo::GetTypeNameInEnglish(type); 70 return content::GetProcessTypeNameInEnglish(type);
71 } 71 }
72 72
73 ProcessMemoryInformation::ProcessMemoryInformation() 73 ProcessMemoryInformation::ProcessMemoryInformation()
74 : pid(0), 74 : pid(0),
75 num_processes(0), 75 num_processes(0),
76 is_diagnostics(false), 76 is_diagnostics(false),
77 type(content::PROCESS_TYPE_UNKNOWN), 77 type(content::PROCESS_TYPE_UNKNOWN),
78 renderer_type(RENDERER_UNKNOWN) { 78 renderer_type(RENDERER_UNKNOWN) {
79 } 79 }
80 80
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 UMA_HISTOGRAM_COUNTS_100("Memory.PepperPluginProcessCount", 420 UMA_HISTOGRAM_COUNTS_100("Memory.PepperPluginProcessCount",
421 pepper_plugin_count); 421 pepper_plugin_count);
422 UMA_HISTOGRAM_COUNTS_100("Memory.RendererProcessCount", renderer_count); 422 UMA_HISTOGRAM_COUNTS_100("Memory.RendererProcessCount", renderer_count);
423 UMA_HISTOGRAM_COUNTS_100("Memory.WorkerProcessCount", worker_count); 423 UMA_HISTOGRAM_COUNTS_100("Memory.WorkerProcessCount", worker_count);
424 // TODO(viettrungluu): Do we want separate counts for the other 424 // TODO(viettrungluu): Do we want separate counts for the other
425 // (platform-specific) process types? 425 // (platform-specific) process types?
426 426
427 int total_sample = static_cast<int>(aggregate_memory / 1000); 427 int total_sample = static_cast<int>(aggregate_memory / 1000);
428 UMA_HISTOGRAM_MEMORY_MB("Memory.Total", total_sample); 428 UMA_HISTOGRAM_MEMORY_MB("Memory.Total", total_sample);
429 } 429 }
OLDNEW
« no previous file with comments | « chrome/browser/automation/testing_automation_provider.cc ('k') | chrome/browser/metrics/tracking_synchronizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698