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

Side by Side Diff: chrome/browser/private_working_set_snapshot_win.cc

Issue 1548133002: Switch to standard integer types in chrome/browser/, part 3 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
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/private_working_set_snapshot.h" 5 #include "chrome/browser/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 10
10 #include <algorithm> 11 #include <algorithm>
11 12
12 #include "base/numerics/safe_conversions.h" 13 #include "base/numerics/safe_conversions.h"
13 #include "base/win/windows_version.h" 14 #include "base/win/windows_version.h"
14 15
15 // Link pdh.lib (import library for pdh.dll) whenever this file is linked in. 16 // Link pdh.lib (import library for pdh.dll) whenever this file is linked in.
16 #pragma comment(lib, "pdh.lib") 17 #pragma comment(lib, "pdh.lib")
17 18
18 PrivateWorkingSetSnapshot::PrivateWorkingSetSnapshot() {} 19 PrivateWorkingSetSnapshot::PrivateWorkingSetSnapshot() {}
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 size_t PrivateWorkingSetSnapshot::GetPrivateWorkingSet( 183 size_t PrivateWorkingSetSnapshot::GetPrivateWorkingSet(
183 base::ProcessId process_id) const { 184 base::ProcessId process_id) const {
184 // Do a binary search for the requested process ID and return the working set 185 // Do a binary search for the requested process ID and return the working set
185 // if found. 186 // if found.
186 auto p = std::lower_bound(records_.begin(), records_.end(), process_id); 187 auto p = std::lower_bound(records_.begin(), records_.end(), process_id);
187 if (p != records_.end() && p->process_id == process_id) 188 if (p != records_.end() && p->process_id == process_id)
188 return p->private_ws; 189 return p->private_ws;
189 190
190 return 0; 191 return 0;
191 } 192 }
OLDNEW
« no previous file with comments | « chrome/browser/private_working_set_snapshot.h ('k') | chrome/browser/private_working_set_snapshot_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698