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

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: added some comments about std::move 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
« no previous file with comments | « base/profiler/stack_sampling_profiler.cc ('k') | components/metrics/call_stack_profile_collector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4fc70b8e050c90ab9004f859ef9fba9206ba5460 100644
--- a/base/profiler/stack_sampling_profiler_unittest.cc
+++ b/base/profiler/stack_sampling_profiler_unittest.cc
@@ -6,6 +6,7 @@
#include <stdint.h>
#include <cstdlib>
+#include <utility>
#include "base/bind.h"
#include "base/compiler_specific.h"
@@ -309,8 +310,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);
}
// Called on the profiler thread when complete. Collects profiles produced by
@@ -318,8 +319,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();
}
« no previous file with comments | « base/profiler/stack_sampling_profiler.cc ('k') | components/metrics/call_stack_profile_collector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698