| 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 <objbase.h> | 5 #include <objbase.h> |
| 6 #include <windows.h> | 6 #include <windows.h> |
| 7 #include <winternl.h> | 7 #include <winternl.h> |
| 8 | 8 |
| 9 #include <cstdlib> | 9 #include <cstdlib> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 GUID guid; | 201 GUID guid; |
| 202 DWORD age; | 202 DWORD age; |
| 203 win::PEImage(module_handle).GetDebugId(&guid, &age); | 203 win::PEImage(module_handle).GetDebugId(&guid, &age); |
| 204 const int kGUIDSize = 39; | 204 const int kGUIDSize = 39; |
| 205 std::wstring build_id; | 205 std::wstring build_id; |
| 206 int result = | 206 int result = |
| 207 ::StringFromGUID2(guid, WriteInto(&build_id, kGUIDSize), kGUIDSize); | 207 ::StringFromGUID2(guid, WriteInto(&build_id, kGUIDSize), kGUIDSize); |
| 208 if (result != kGUIDSize) | 208 if (result != kGUIDSize) |
| 209 return std::string(); | 209 return std::string(); |
| 210 RemoveChars(build_id, L"{}-", &build_id); | 210 RemoveChars(build_id, L"{}-", &build_id); |
| 211 build_id += StringPrintf(L"%d", age); | 211 //build_id += StringPrintf(L"%d", age); |
| 212 return WideToUTF8(build_id); | 212 return WideToUTF8(build_id); |
| 213 } | 213 } |
| 214 | 214 |
| 215 // ScopedDisablePriorityBoost ------------------------------------------------- | 215 // ScopedDisablePriorityBoost ------------------------------------------------- |
| 216 | 216 |
| 217 // Disables priority boost on a thread for the lifetime of the object. | 217 // Disables priority boost on a thread for the lifetime of the object. |
| 218 class ScopedDisablePriorityBoost { | 218 class ScopedDisablePriorityBoost { |
| 219 public: | 219 public: |
| 220 ScopedDisablePriorityBoost(HANDLE thread_handle); | 220 ScopedDisablePriorityBoost(HANDLE thread_handle); |
| 221 ~ScopedDisablePriorityBoost(); | 221 ~ScopedDisablePriorityBoost(); |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 | 511 |
| 512 if (thread_handle) { | 512 if (thread_handle) { |
| 513 return scoped_ptr<NativeStackSampler>(new NativeStackSamplerWin( | 513 return scoped_ptr<NativeStackSampler>(new NativeStackSamplerWin( |
| 514 win::ScopedHandle(thread_handle))); | 514 win::ScopedHandle(thread_handle))); |
| 515 } | 515 } |
| 516 #endif | 516 #endif |
| 517 return scoped_ptr<NativeStackSampler>(); | 517 return scoped_ptr<NativeStackSampler>(); |
| 518 } | 518 } |
| 519 | 519 |
| 520 } // namespace base | 520 } // namespace base |
| OLD | NEW |