diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-08-24 12:15:48 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-08-28 13:30:04 +0000 |
commit | b014812705fc80bff0a5c120dfcef88f349816dc (patch) | |
tree | 25a2e2d9fa285f1add86aa333389a839f81a39ae /chromium/components/browser_watcher/stability_report_user_stream_data_source.cc | |
parent | 9f4560b1027ae06fdb497023cdcaf91b8511fa74 (diff) | |
download | qtwebengine-chromium-b014812705fc80bff0a5c120dfcef88f349816dc.tar.gz |
BASELINE: Update Chromium to 68.0.3440.125
Change-Id: I23f19369e01f688e496f5bf179abb521ad73874f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/browser_watcher/stability_report_user_stream_data_source.cc')
-rw-r--r-- | chromium/components/browser_watcher/stability_report_user_stream_data_source.cc | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/chromium/components/browser_watcher/stability_report_user_stream_data_source.cc b/chromium/components/browser_watcher/stability_report_user_stream_data_source.cc index ea6b61a4797..bec019b55e5 100644 --- a/chromium/components/browser_watcher/stability_report_user_stream_data_source.cc +++ b/chromium/components/browser_watcher/stability_report_user_stream_data_source.cc @@ -97,7 +97,7 @@ bool CollectStabilityReport(const base::FilePath& path, return true; } -void CollectSystemMemoryMetrics(StabilityReport* report) { +void CollectSystemPerformanceMetrics(StabilityReport* report) { // Grab system commit memory. Also best effort. PERFORMANCE_INFORMATION perf_info = {sizeof(perf_info)}; if (GetPerformanceInfo(&perf_info, sizeof(perf_info))) { @@ -107,11 +107,13 @@ void CollectSystemMemoryMetrics(StabilityReport* report) { memory_state->set_system_commit_limit(perf_info.CommitLimit); memory_state->set_system_commit_remaining(perf_info.CommitLimit - perf_info.CommitTotal); + memory_state->set_system_handle_count(perf_info.HandleCount); } } -void CollectProcessMemoryMetrics(crashpad::ProcessSnapshot* process_snapshot, - StabilityReport* report) { +void CollectProcessPerformanceMetrics( + crashpad::ProcessSnapshot* process_snapshot, + StabilityReport* report) { const crashpad::ExceptionSnapshot* exception = process_snapshot->Exception(); if (!exception) @@ -151,7 +153,7 @@ void CollectProcessMemoryMetrics(crashpad::ProcessSnapshot* process_snapshot, if (process.IsValid()) { PROCESS_MEMORY_COUNTERS_EX process_memory = {sizeof(process_memory)}; - if (GetProcessMemoryInfo( + if (::GetProcessMemoryInfo( process.Handle(), reinterpret_cast<PROCESS_MEMORY_COUNTERS*>(&process_memory), sizeof(process_memory))) { @@ -165,6 +167,11 @@ void CollectProcessMemoryMetrics(crashpad::ProcessSnapshot* process_snapshot, memory_state->set_process_peak_pagefile_usage( process_memory.PeakPagefileUsage / kPageSize); } + + DWORD process_handle_count = 0; + if (::GetProcessHandleCount(process.Handle(), &process_handle_count)) { + memory_state->set_process_handle_count(process_handle_count); + } } } @@ -194,8 +201,8 @@ StabilityReportUserStreamDataSource::ProduceStreamData( } } - CollectSystemMemoryMetrics(&report); - CollectProcessMemoryMetrics(process_snapshot, &report); + CollectSystemPerformanceMetrics(&report); + CollectProcessPerformanceMetrics(process_snapshot, &report); std::unique_ptr<BufferExtensionStreamDataSource> source( new BufferExtensionStreamDataSource(kStabilityReportStreamType)); |