Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
|
Primiano Tucci (use gerrit)
2017/05/11 15:31:07
is this "agent" going also to subsume the other ba
chiniforooshan
2017/05/15 20:44:12
It's going to be a special base::trace_event::Trac
Primiano Tucci (use gerrit)
2017/05/16 04:45:11
tracing::ChromeAgent SGTM (or if you want even jus
| |
| 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 SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_TRACING_TRACE_EVENT_AGENT_H_ | |
| 6 #define SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_TRACING_TRACE_EVENT_AGENT_H_ | |
| 7 | |
| 8 #include "base/memory/ref_counted.h" | |
| 9 #include "base/memory/ref_counted_memory.h" | |
| 10 #include "base/values.h" | |
| 11 #include "mojo/public/cpp/bindings/binding.h" | |
| 12 #include "services/resource_coordinator/public/cpp/resource_coordinator_export.h " | |
| 13 #include "services/resource_coordinator/public/interfaces/tracing/tracing.mojom. h" | |
| 14 #include "services/service_manager/public/cpp/connector.h" | |
| 15 | |
| 16 namespace resource_coordinator { | |
|
Primiano Tucci (use gerrit)
2017/05/11 15:31:07
i wonder if we should just keep this simple and ju
chiniforooshan
2017/05/15 20:44:12
Done.
| |
| 17 namespace tracing { | |
| 18 | |
| 19 class SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_EXPORT TraceEventAgent | |
| 20 : public mojom::Agent { | |
| 21 public: | |
| 22 typedef base::RepeatingCallback<std::unique_ptr<base::DictionaryValue>()> | |
|
Primiano Tucci (use gerrit)
2017/05/11 15:31:07
small nit: using MetadataGenerator = base...
seems
chiniforooshan
2017/05/15 20:44:12
Done.
| |
| 23 MetadataGenerator; | |
| 24 | |
| 25 static TraceEventAgent* GetOrCreateInstance(mojom::AgentSetPtr agent_set); | |
|
Primiano Tucci (use gerrit)
2017/05/11 15:31:07
can you add a comment on what the argument is for?
chiniforooshan
2017/05/15 20:44:12
Done.
| |
| 26 | |
| 27 void AddMetadataGenerator(MetadataGenerator generator); | |
| 28 | |
| 29 private: | |
| 30 friend std::default_delete<TraceEventAgent>; // For Testing | |
| 31 friend class TraceEventAgentTest; // For Testing | |
| 32 | |
| 33 explicit TraceEventAgent(mojom::AgentSetPtr agent_set); | |
| 34 ~TraceEventAgent() override; | |
| 35 | |
| 36 // mojom::Agent | |
| 37 void StartTracing(const std::string& config, | |
| 38 mojom::RecorderPtr recorder, | |
| 39 bool report_categories_only, | |
| 40 const StartTracingCallback& callback) override; | |
| 41 void StopAndFlush() override; | |
| 42 void RequestClockSyncMarker( | |
| 43 const std::string& sync_id, | |
| 44 const RequestClockSyncMarkerCallback& callback) override; | |
| 45 void RequestBufferStatus( | |
| 46 const RequestBufferStatusCallback& callback) override; | |
| 47 | |
| 48 void SendChunk(const scoped_refptr<base::RefCountedString>& events_str, | |
| 49 bool has_more_events); | |
| 50 | |
| 51 mojo::Binding<mojom::Agent> binding_; | |
| 52 mojom::RecorderPtr recorder_; | |
| 53 bool report_categories_only_; | |
| 54 std::vector<MetadataGenerator> metadata_generators_; | |
| 55 | |
| 56 DISALLOW_COPY_AND_ASSIGN(TraceEventAgent); | |
| 57 }; | |
| 58 | |
| 59 } // namespace tracing | |
| 60 } // namespace resource_coordinator | |
| 61 #endif // SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_TRACING_TRACE_EVENT_AGENT_H_ | |
| OLD | NEW |