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

Unified Diff: base/profiler/stack_sampling_profiler_unittest.cc

Issue 2438073002: Use movable types for CallStackProfile(s) to remove copying of data. (Closed)
Patch Set: fix tests and build problems Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: base/profiler/stack_sampling_profiler_unittest.cc
diff --git a/base/profiler/stack_sampling_profiler_unittest.cc b/base/profiler/stack_sampling_profiler_unittest.cc
index 3a59e6d2c300ff58534d4cac8b8e80a9ea1fd2c0..332db14ad7a3cf4567c0b7a27493214ef8b79175 100644
--- a/base/profiler/stack_sampling_profiler_unittest.cc
+++ b/base/profiler/stack_sampling_profiler_unittest.cc
@@ -309,8 +309,8 @@ void SynchronousUnloadNativeLibrary(NativeLibrary library) {
// Called on the profiler thread when complete, to collect profiles.
void SaveProfiles(CallStackProfiles* profiles,
- const CallStackProfiles& pending_profiles) {
- *profiles = pending_profiles;
+ CallStackProfiles pending_profiles) {
+ *profiles = std::move(pending_profiles);
Mike Wittman 2016/10/21 18:05:29 IWYU: <utility> ... and throughout this CL
bcwhite 2016/10/24 13:17:45 Done.
}
// Called on the profiler thread when complete. Collects profiles produced by
@@ -318,8 +318,8 @@ void SaveProfiles(CallStackProfiles* profiles,
// the profiler is done.
void SaveProfilesAndSignalEvent(CallStackProfiles* profiles,
WaitableEvent* event,
- const CallStackProfiles& pending_profiles) {
- *profiles = pending_profiles;
+ CallStackProfiles pending_profiles) {
+ *profiles = std::move(pending_profiles);
event->Signal();
}

Powered by Google App Engine
This is Rietveld 408576698