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

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

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 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
« no previous file with comments | « base/profiler/stack_sampling_profiler.cc ('k') | base/profiler/win32_stack_frame_unwinder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <cstdlib> 8 #include <cstdlib>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 #else 783 #else
784 #define MAYBE_DestroyProfilerWhileProfiling \ 784 #define MAYBE_DestroyProfilerWhileProfiling \
785 DISABLED_DestroyProfilerWhileProfiling 785 DISABLED_DestroyProfilerWhileProfiling
786 #endif 786 #endif
787 TEST(StackSamplingProfilerTest, MAYBE_DestroyProfilerWhileProfiling) { 787 TEST(StackSamplingProfilerTest, MAYBE_DestroyProfilerWhileProfiling) {
788 SamplingParams params; 788 SamplingParams params;
789 params.sampling_interval = TimeDelta::FromMilliseconds(10); 789 params.sampling_interval = TimeDelta::FromMilliseconds(10);
790 790
791 CallStackProfiles profiles; 791 CallStackProfiles profiles;
792 WithTargetThread([&params, &profiles](PlatformThreadId target_thread_id) { 792 WithTargetThread([&params, &profiles](PlatformThreadId target_thread_id) {
793 scoped_ptr<StackSamplingProfiler> profiler; 793 std::unique_ptr<StackSamplingProfiler> profiler;
794 profiler.reset(new StackSamplingProfiler( 794 profiler.reset(new StackSamplingProfiler(
795 target_thread_id, params, Bind(&SaveProfiles, Unretained(&profiles)))); 795 target_thread_id, params, Bind(&SaveProfiles, Unretained(&profiles))));
796 profiler->Start(); 796 profiler->Start();
797 profiler.reset(); 797 profiler.reset();
798 798
799 // Wait longer than a sample interval to catch any use-after-free actions by 799 // Wait longer than a sample interval to catch any use-after-free actions by
800 // the profiler thread. 800 // the profiler thread.
801 PlatformThread::Sleep(TimeDelta::FromMilliseconds(50)); 801 PlatformThread::Sleep(TimeDelta::FromMilliseconds(50));
802 }); 802 });
803 } 803 }
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 #if defined(STACK_SAMPLING_PROFILER_SUPPORTED) 957 #if defined(STACK_SAMPLING_PROFILER_SUPPORTED)
958 #define MAYBE_UnloadedLibrary UnloadedLibrary 958 #define MAYBE_UnloadedLibrary UnloadedLibrary
959 #else 959 #else
960 #define MAYBE_UnloadedLibrary DISABLED_UnloadedLibrary 960 #define MAYBE_UnloadedLibrary DISABLED_UnloadedLibrary
961 #endif 961 #endif
962 TEST(StackSamplingProfilerTest, MAYBE_UnloadedLibrary) { 962 TEST(StackSamplingProfilerTest, MAYBE_UnloadedLibrary) {
963 TestLibraryUnload(true); 963 TestLibraryUnload(true);
964 } 964 }
965 965
966 } // namespace base 966 } // namespace base
OLDNEW
« no previous file with comments | « base/profiler/stack_sampling_profiler.cc ('k') | base/profiler/win32_stack_frame_unwinder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698