blob: 6a535c79c52bbadadd32e455b96ff413b65d3879 [file] [log] [blame]
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <vector>
namespace perfetto {
namespace protos {
class TracePacket;
} // namespace protos
} // namespace perfetto
namespace v8 {
namespace platform {
namespace tracing {
// A TraceEventListener is a simple interface that allows subclasses to listen
// to trace events. This interface is to hide the more complex interactions that
// the PerfettoConsumer class has to perform. Clients override ProcessPacket()
// to respond to trace events, e.g. to write them to a file as JSON or for
// testing purposes.
class TraceEventListener {
virtual ~TraceEventListener() = default;
virtual void ProcessPacket(const ::perfetto::protos::TracePacket& packet) = 0;
void ParseFromArray(const std::vector<char>& array);
} // namespace tracing
} // namespace platform
} // namespace v8