OLD | NEW |
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/private_working_set_snapshot.h" | 5 #include "chrome/browser/win/private_working_set_snapshot.h" |
6 | 6 |
7 #include <pdh.h> | 7 #include <pdh.h> |
8 #include <pdhmsg.h> | 8 #include <pdhmsg.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
11 #include <algorithm> | 11 #include <algorithm> |
12 | 12 |
13 #include "base/numerics/safe_conversions.h" | 13 #include "base/numerics/safe_conversions.h" |
14 #include "base/win/windows_version.h" | 14 #include "base/win/windows_version.h" |
15 | 15 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 size_t PrivateWorkingSetSnapshot::GetPrivateWorkingSet( | 180 size_t PrivateWorkingSetSnapshot::GetPrivateWorkingSet( |
181 base::ProcessId process_id) const { | 181 base::ProcessId process_id) const { |
182 // Do a binary search for the requested process ID and return the working set | 182 // Do a binary search for the requested process ID and return the working set |
183 // if found. | 183 // if found. |
184 auto p = std::lower_bound(records_.begin(), records_.end(), process_id); | 184 auto p = std::lower_bound(records_.begin(), records_.end(), process_id); |
185 if (p != records_.end() && p->process_id == process_id) | 185 if (p != records_.end() && p->process_id == process_id) |
186 return p->private_ws; | 186 return p->private_ws; |
187 | 187 |
188 return 0; | 188 return 0; |
189 } | 189 } |
OLD | NEW |