OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "base/debug/gdi_debug_util_win.h" | 4 #include "base/debug/gdi_debug_util_win.h" |
5 | 5 |
6 #include <cmath> | 6 #include <cmath> |
7 | 7 |
8 #include <psapi.h> | 8 #include <psapi.h> |
| 9 #include <stddef.h> |
9 #include <TlHelp32.h> | 10 #include <TlHelp32.h> |
10 | 11 |
11 #include "base/debug/alias.h" | 12 #include "base/debug/alias.h" |
12 #include "base/logging.h" | 13 #include "base/logging.h" |
13 #include "base/win/scoped_handle.h" | 14 #include "base/win/scoped_handle.h" |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
17 void CollectChildGDIUsageAndDie(DWORD parent_pid) { | 18 void CollectChildGDIUsageAndDie(DWORD parent_pid) { |
18 HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); | 19 HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 0, &small_data, shared_section, 0); | 114 0, &small_data, shared_section, 0); |
114 CHECK(small_bitmap != NULL); | 115 CHECK(small_bitmap != NULL); |
115 DeleteObject(small_bitmap); | 116 DeleteObject(small_bitmap); |
116 } | 117 } |
117 // Maybe the child processes are the ones leaking GDI or USER resouces. | 118 // Maybe the child processes are the ones leaking GDI or USER resouces. |
118 CollectChildGDIUsageAndDie(GetCurrentProcessId()); | 119 CollectChildGDIUsageAndDie(GetCurrentProcessId()); |
119 } | 120 } |
120 | 121 |
121 } // namespace debug | 122 } // namespace debug |
122 } // namespace base | 123 } // namespace base |
OLD | NEW |