1 // Copyright 2016 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef COMPONENTS_METRICS_CALL_STACKS_CALL_STACK_PROFILE_COLLECTOR_H_ 6 #define COMPONENTS_METRICS_CALL_STACKS_CALL_STACK_PROFILE_COLLECTOR_H_ 7 8 #include "components/metrics/public/mojom/call_stack_profile_collector.mojom.h" 9 #include "mojo/public/cpp/bindings/pending_receiver.h" 10 11 namespace metrics { 12 13 class CallStackProfileCollector : public mojom::CallStackProfileCollector { 14 public: 15 CallStackProfileCollector(); 16 17 CallStackProfileCollector(const CallStackProfileCollector&) = delete; 18 CallStackProfileCollector& operator=(const CallStackProfileCollector&) = 19 delete; 20 21 ~CallStackProfileCollector() override; 22 23 // Create a collector to receive profiles from |expected_process|. 24 static void Create( 25 mojo::PendingReceiver<mojom::CallStackProfileCollector> receiver); 26 27 // mojom::CallStackProfileCollector: 28 void Collect(base::TimeTicks start_timestamp, 29 mojom::ProfileType profile_type, 30 mojom::SampledProfilePtr profile) override; 31 }; 32 33 } // namespace metrics 34 35 #endif // COMPONENTS_METRICS_CALL_STACKS_CALL_STACK_PROFILE_COLLECTOR_H_ 36