OLD | NEW |
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" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 process.renderer_type = | 226 process.renderer_type = |
227 ProcessMemoryInformation::RENDERER_EXTENSION; | 227 ProcessMemoryInformation::RENDERER_EXTENSION; |
228 break; | 228 break; |
229 } | 229 } |
230 } | 230 } |
231 } | 231 } |
232 TabContents* contents = host_delegate->GetAsTabContents(); | 232 TabContents* contents = host_delegate->GetAsTabContents(); |
233 if (!contents) { | 233 if (!contents) { |
234 if (extension_process_map->Contains(host->process()->GetID())) { | 234 if (extension_process_map->Contains(host->process()->GetID())) { |
235 const Extension* extension = | 235 const Extension* extension = |
236 extension_service->GetExtensionByURL(url); | 236 extension_service->extensions()->GetByID(url.host()); |
237 if (extension) { | 237 if (extension) { |
238 string16 title = UTF8ToUTF16(extension->name()); | 238 string16 title = UTF8ToUTF16(extension->name()); |
239 process.titles.push_back(title); | 239 process.titles.push_back(title); |
240 } | 240 } |
241 } else if (process.renderer_type == | 241 } else if (process.renderer_type == |
242 ProcessMemoryInformation::RENDERER_UNKNOWN) { | 242 ProcessMemoryInformation::RENDERER_UNKNOWN) { |
243 process.titles.push_back(UTF8ToUTF16(url.spec())); | 243 process.titles.push_back(UTF8ToUTF16(url.spec())); |
244 switch (type) { | 244 switch (type) { |
245 case chrome::VIEW_TYPE_BACKGROUND_CONTENTS: | 245 case chrome::VIEW_TYPE_BACKGROUND_CONTENTS: |
246 process.renderer_type = | 246 process.renderer_type = |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
OLD | NEW |