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

Side by Side Diff: components/metrics/system_memory_stats_recorder_win.cc

Issue 1366643002: Extract guts of ChromeStabilityMetricsProvider into helper class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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
« no previous file with comments | « components/metrics/system_memory_stats_recorder_linux.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/system_memory_stats_recorder.h" 5 #include "components/metrics/system_memory_stats_recorder.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "base/process/process_metrics.h" 10 #include "base/process/process_metrics.h"
11 11
12 namespace memory { 12 namespace metrics {
13 13
14 void RecordMemoryStats(RecordMemoryStatsType type) { 14 void RecordMemoryStats(RecordMemoryStatsType type) {
15 MEMORYSTATUSEX mem_status; 15 MEMORYSTATUSEX mem_status;
16 mem_status.dwLength = sizeof(mem_status); 16 mem_status.dwLength = sizeof(mem_status);
17 if (!::GlobalMemoryStatusEx(&mem_status)) 17 if (!::GlobalMemoryStatusEx(&mem_status))
18 return; 18 return;
19 19
20 switch (type) { 20 switch (type) {
21 case RECORD_MEMORY_STATS_TAB_DISCARDED: { 21 case RECORD_MEMORY_STATS_TAB_DISCARDED: {
22 UMA_HISTOGRAM_CUSTOM_COUNTS("Memory.Stats.Win.MemoryLoad", 22 UMA_HISTOGRAM_CUSTOM_COUNTS("Memory.Stats.Win.MemoryLoad",
(...skipping 11 matching lines...) Expand all
34 UMA_HISTOGRAM_LARGE_MEMORY_MB("Memory.Stats.Win.AvailVirtual", 34 UMA_HISTOGRAM_LARGE_MEMORY_MB("Memory.Stats.Win.AvailVirtual",
35 mem_status.ullAvailVirtual); 35 mem_status.ullAvailVirtual);
36 break; 36 break;
37 } 37 }
38 default: 38 default:
39 NOTREACHED() << L"Received unexpected notification"; 39 NOTREACHED() << L"Received unexpected notification";
40 break; 40 break;
41 } 41 }
42 } 42 }
43 43
44 } // namespace memory 44 } // namespace metrics
OLDNEW
« no previous file with comments | « components/metrics/system_memory_stats_recorder_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698