OLD | NEW |
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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "components/metrics/call_stack_profile_metrics_provider.h" | 10 #include "components/metrics/call_stack_profile_metrics_provider.h" |
11 #include "mojo/public/cpp/bindings/interface_request.h" | 11 #include "mojo/public/cpp/bindings/interface_request.h" |
12 #include "mojo/public/cpp/bindings/strong_binding.h" | 12 #include "mojo/public/cpp/bindings/strong_binding.h" |
13 | 13 |
14 namespace metrics { | 14 namespace metrics { |
15 | 15 |
16 CallStackProfileCollector::CallStackProfileCollector( | 16 CallStackProfileCollector::CallStackProfileCollector( |
17 CallStackProfileParams::Process expected_process) | 17 CallStackProfileParams::Process expected_process) |
18 : expected_process_(expected_process) {} | 18 : expected_process_(expected_process) {} |
19 | 19 |
20 CallStackProfileCollector::~CallStackProfileCollector() {} | 20 CallStackProfileCollector::~CallStackProfileCollector() {} |
21 | 21 |
22 // static | 22 // static |
23 void CallStackProfileCollector::Create( | 23 void CallStackProfileCollector::Create( |
24 CallStackProfileParams::Process expected_process, | 24 CallStackProfileParams::Process expected_process, |
| 25 const service_manager::BindSourceInfo& source_info, |
25 mojom::CallStackProfileCollectorRequest request) { | 26 mojom::CallStackProfileCollectorRequest request) { |
26 mojo::MakeStrongBinding( | 27 mojo::MakeStrongBinding( |
27 base::MakeUnique<CallStackProfileCollector>(expected_process), | 28 base::MakeUnique<CallStackProfileCollector>(expected_process), |
28 std::move(request)); | 29 std::move(request)); |
29 } | 30 } |
30 | 31 |
31 void CallStackProfileCollector::Collect( | 32 void CallStackProfileCollector::Collect( |
32 const CallStackProfileParams& params, | 33 const CallStackProfileParams& params, |
33 base::TimeTicks start_timestamp, | 34 base::TimeTicks start_timestamp, |
34 std::vector<CallStackProfile> profiles) { | 35 std::vector<CallStackProfile> profiles) { |
35 if (params.process != expected_process_) | 36 if (params.process != expected_process_) |
36 return; | 37 return; |
37 | 38 |
38 CallStackProfileMetricsProvider::ReceiveCompletedProfiles( | 39 CallStackProfileMetricsProvider::ReceiveCompletedProfiles( |
39 params, start_timestamp, std::move(profiles)); | 40 params, start_timestamp, std::move(profiles)); |
40 } | 41 } |
41 | 42 |
42 } // namespace metrics | 43 } // namespace metrics |
OLD | NEW |