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

Side by Side Diff: base/profiler/native_stack_sampler_win.cc

Issue 2561963002: base: Remove the string logging from CHECK(). (Closed)
Patch Set: checkstring: rebase Created 4 years 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 "base/profiler/native_stack_sampler.h" 5 #include "base/profiler/native_stack_sampler.h"
6 6
7 #include <objbase.h> 7 #include <objbase.h>
8 #include <windows.h> 8 #include <windows.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <winternl.h> 10 #include <winternl.h>
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 // resuming the thread. 294 // resuming the thread.
295 // 295 //
296 // Note that this can racily disable a priority boost that otherwise would 296 // Note that this can racily disable a priority boost that otherwise would
297 // have been given to the thread, if the thread is waiting on other wait 297 // have been given to the thread, if the thread is waiting on other wait
298 // conditions at the time of SuspendThread and those conditions are satisfied 298 // conditions at the time of SuspendThread and those conditions are satisfied
299 // before priority boost is reenabled. The measured length of this window is 299 // before priority boost is reenabled. The measured length of this window is
300 // ~100us, so this should occur fairly rarely. 300 // ~100us, so this should occur fairly rarely.
301 ScopedDisablePriorityBoost disable_priority_boost(thread_handle_); 301 ScopedDisablePriorityBoost disable_priority_boost(thread_handle_);
302 bool resume_thread_succeeded = 302 bool resume_thread_succeeded =
303 ::ResumeThread(thread_handle_) != static_cast<DWORD>(-1); 303 ::ResumeThread(thread_handle_) != static_cast<DWORD>(-1);
304 CHECK(resume_thread_succeeded) << "ResumeThread failed: " << GetLastError(); 304 // ResumeThread failed.
305 CHECK(resume_thread_succeeded);
305 } 306 }
306 307
307 // Tests whether |stack_pointer| points to a location in the guard page. 308 // Tests whether |stack_pointer| points to a location in the guard page.
308 // 309 //
309 // IMPORTANT NOTE: This function is invoked while the target thread is 310 // IMPORTANT NOTE: This function is invoked while the target thread is
310 // suspended so it must not do any allocation from the default heap, including 311 // suspended so it must not do any allocation from the default heap, including
311 // indirectly via use of DCHECK/CHECK or other logging statements. Otherwise 312 // indirectly via use of DCHECK/CHECK or other logging statements. Otherwise
312 // this code can deadlock on heap locks in the default heap acquired by the 313 // this code can deadlock on heap locks in the default heap acquired by the
313 // target thread before it was suspended. 314 // target thread before it was suspended.
314 bool PointsToGuardPage(uintptr_t stack_pointer) { 315 bool PointsToGuardPage(uintptr_t stack_pointer) {
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 558
558 if (thread_handle) { 559 if (thread_handle) {
559 return std::unique_ptr<NativeStackSampler>(new NativeStackSamplerWin( 560 return std::unique_ptr<NativeStackSampler>(new NativeStackSamplerWin(
560 win::ScopedHandle(thread_handle), annotator, test_delegate)); 561 win::ScopedHandle(thread_handle), annotator, test_delegate));
561 } 562 }
562 #endif 563 #endif
563 return std::unique_ptr<NativeStackSampler>(); 564 return std::unique_ptr<NativeStackSampler>();
564 } 565 }
565 566
566 } // namespace base 567 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698