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

Side by Side Diff: components/metrics/call_stack_profile_collector.h

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, 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 #ifndef COMPONENTS_METRICS_CALL_STACK_PROFILE_COLLECTOR_H_ 5 #ifndef COMPONENTS_METRICS_CALL_STACK_PROFILE_COLLECTOR_H_
6 #define COMPONENTS_METRICS_CALL_STACK_PROFILE_COLLECTOR_H_ 6 #define COMPONENTS_METRICS_CALL_STACK_PROFILE_COLLECTOR_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "components/metrics/public/interfaces/call_stack_profile_collector.mojo m.h" 9 #include "components/metrics/public/interfaces/call_stack_profile_collector.mojo m.h"
10 10
11 namespace metrics { 11 namespace metrics {
12 12
13 class CallStackProfileCollector : public mojom::CallStackProfileCollector { 13 class CallStackProfileCollector : public mojom::CallStackProfileCollector {
14 public: 14 public:
15 using CallStackProfile = base::StackSamplingProfiler::CallStackProfile; 15 using CallStackProfile = base::StackSamplingProfiler::CallStackProfile;
16 16
17 explicit CallStackProfileCollector( 17 explicit CallStackProfileCollector(
18 CallStackProfileParams::Process expected_process); 18 CallStackProfileParams::Process expected_process);
19 ~CallStackProfileCollector() override; 19 ~CallStackProfileCollector() override;
20 20
21 // Create a collector to receive profiles from |expected_process|. 21 // Create a collector to receive profiles from |expected_process|.
22 static void Create(CallStackProfileParams::Process expected_process, 22 static void Create(CallStackProfileParams::Process expected_process,
23 mojom::CallStackProfileCollectorRequest request); 23 mojom::CallStackProfileCollectorRequest request);
24 24
25 // mojom::CallStackProfileCollector: 25 // mojom::CallStackProfileCollector:
26 void Collect(const CallStackProfileParams& params, 26 void Collect(const CallStackProfileParams& params,
27 base::TimeTicks start_timestamp, 27 base::TimeTicks start_timestamp,
28 const std::vector<CallStackProfile>& profiles) override; 28 std::vector<CallStackProfile> profiles) override;
29 29
30 private: 30 private:
31 // Profile params are validated to come from this process. Profiles with a 31 // Profile params are validated to come from this process. Profiles with a
32 // different process declared in the params are considered untrustworthy and 32 // different process declared in the params are considered untrustworthy and
33 // ignored. 33 // ignored.
34 const CallStackProfileParams::Process expected_process_; 34 const CallStackProfileParams::Process expected_process_;
35 35
36 DISALLOW_COPY_AND_ASSIGN(CallStackProfileCollector); 36 DISALLOW_COPY_AND_ASSIGN(CallStackProfileCollector);
37 }; 37 };
38 38
39 } // namespace metrics 39 } // namespace metrics
40 40
41 #endif // COMPONENTS_METRICS_CALL_STACK_PROFILE_COLLECTOR_H_ 41 #endif // COMPONENTS_METRICS_CALL_STACK_PROFILE_COLLECTOR_H_
OLDNEW
« no previous file with comments | « base/profiler/stack_sampling_profiler_unittest.cc ('k') | components/metrics/call_stack_profile_collector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698