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

Side by Side Diff: components/metrics/call_stack_profile_collector.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, 1 month 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/metrics/call_stack_profile_collector.h" 5 #include "components/metrics/call_stack_profile_collector.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "components/metrics/call_stack_profile_metrics_provider.h" 8 #include "components/metrics/call_stack_profile_metrics_provider.h"
9 #include "mojo/public/cpp/bindings/interface_request.h" 9 #include "mojo/public/cpp/bindings/interface_request.h"
10 #include "mojo/public/cpp/bindings/strong_binding.h" 10 #include "mojo/public/cpp/bindings/strong_binding.h"
(...skipping 11 matching lines...) Expand all
22 CallStackProfileParams::Process expected_process, 22 CallStackProfileParams::Process expected_process,
23 mojom::CallStackProfileCollectorRequest request) { 23 mojom::CallStackProfileCollectorRequest request) {
24 mojo::MakeStrongBinding( 24 mojo::MakeStrongBinding(
25 base::MakeUnique<CallStackProfileCollector>(expected_process), 25 base::MakeUnique<CallStackProfileCollector>(expected_process),
26 std::move(request)); 26 std::move(request));
27 } 27 }
28 28
29 void CallStackProfileCollector::Collect( 29 void CallStackProfileCollector::Collect(
30 const CallStackProfileParams& params, 30 const CallStackProfileParams& params,
31 base::TimeTicks start_timestamp, 31 base::TimeTicks start_timestamp,
32 const std::vector<CallStackProfile>& profiles) { 32 std::vector<CallStackProfile> profiles) {
33 if (params.process != expected_process_) 33 if (params.process != expected_process_)
34 return; 34 return;
35 35
36 CallStackProfileMetricsProvider::ReceiveCompletedProfiles(params, 36 CallStackProfileMetricsProvider::ReceiveCompletedProfiles(
37 start_timestamp, 37 params, start_timestamp, std::move(profiles));
38 profiles);
39 } 38 }
40 39
41 } // namespace metrics 40 } // namespace metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698