OLD | NEW |
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/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/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 case RENDERER_NORMAL: | 52 case RENDERER_NORMAL: |
53 return "Tab"; | 53 return "Tab"; |
54 case RENDERER_CHROME: | 54 case RENDERER_CHROME: |
55 return "Tab (Chrome)"; | 55 return "Tab (Chrome)"; |
56 case RENDERER_EXTENSION: | 56 case RENDERER_EXTENSION: |
57 return "Extension"; | 57 return "Extension"; |
58 case RENDERER_DEVTOOLS: | 58 case RENDERER_DEVTOOLS: |
59 return "Devtools"; | 59 return "Devtools"; |
60 case RENDERER_INTERSTITIAL: | 60 case RENDERER_INTERSTITIAL: |
61 return "Interstitial"; | 61 return "Interstitial"; |
62 case RENDERER_NOTIFICATION: | |
63 return "Notification"; | |
64 case RENDERER_BACKGROUND_APP: | 62 case RENDERER_BACKGROUND_APP: |
65 return "Background App"; | 63 return "Background App"; |
66 case RENDERER_UNKNOWN: | 64 case RENDERER_UNKNOWN: |
67 default: | 65 default: |
68 NOTREACHED() << "Unknown renderer process type!"; | 66 NOTREACHED() << "Unknown renderer process type!"; |
69 return "Unknown"; | 67 return "Unknown"; |
70 } | 68 } |
71 } | 69 } |
72 | 70 |
73 // static | 71 // static |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 continue; | 294 continue; |
297 } | 295 } |
298 | 296 |
299 if (type == extensions::VIEW_TYPE_BACKGROUND_CONTENTS) { | 297 if (type == extensions::VIEW_TYPE_BACKGROUND_CONTENTS) { |
300 process.titles.push_back(base::UTF8ToUTF16(url.spec())); | 298 process.titles.push_back(base::UTF8ToUTF16(url.spec())); |
301 process.renderer_type = | 299 process.renderer_type = |
302 ProcessMemoryInformation::RENDERER_BACKGROUND_APP; | 300 ProcessMemoryInformation::RENDERER_BACKGROUND_APP; |
303 continue; | 301 continue; |
304 } | 302 } |
305 | 303 |
306 if (type == extensions::VIEW_TYPE_NOTIFICATION) { | |
307 process.titles.push_back(base::UTF8ToUTF16(url.spec())); | |
308 process.renderer_type = | |
309 ProcessMemoryInformation::RENDERER_NOTIFICATION; | |
310 continue; | |
311 } | |
312 | |
313 // Since we have a WebContents and and the renderer type hasn't been | 304 // Since we have a WebContents and and the renderer type hasn't been |
314 // set yet, it must be a normal tabbed renderer. | 305 // set yet, it must be a normal tabbed renderer. |
315 if (process.renderer_type == ProcessMemoryInformation::RENDERER_UNKNOWN) | 306 if (process.renderer_type == ProcessMemoryInformation::RENDERER_UNKNOWN) |
316 process.renderer_type = ProcessMemoryInformation::RENDERER_NORMAL; | 307 process.renderer_type = ProcessMemoryInformation::RENDERER_NORMAL; |
317 | 308 |
318 base::string16 title = contents->GetTitle(); | 309 base::string16 title = contents->GetTitle(); |
319 if (!title.length()) | 310 if (!title.length()) |
320 title = l10n_util::GetStringUTF16(IDS_DEFAULT_TAB_TITLE); | 311 title = l10n_util::GetStringUTF16(IDS_DEFAULT_TAB_TITLE); |
321 process.titles.push_back(title); | 312 process.titles.push_back(title); |
322 | 313 |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 | 580 |
590 if (swap_info_.orig_data_size > 0 && swap_info_.compr_data_size > 0) { | 581 if (swap_info_.orig_data_size > 0 && swap_info_.compr_data_size > 0) { |
591 UMA_HISTOGRAM_CUSTOM_COUNTS( | 582 UMA_HISTOGRAM_CUSTOM_COUNTS( |
592 "Memory.Swap.CompressionRatio", | 583 "Memory.Swap.CompressionRatio", |
593 swap_info_.orig_data_size / swap_info_.compr_data_size, | 584 swap_info_.orig_data_size / swap_info_.compr_data_size, |
594 1, 20, 20); | 585 1, 20, 20); |
595 } | 586 } |
596 } | 587 } |
597 | 588 |
598 #endif | 589 #endif |
OLD | NEW |