diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/core/inspector/inspector_performance_timeline_agent.h')
-rw-r--r-- | chromium/third_party/blink/renderer/core/inspector/inspector_performance_timeline_agent.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/chromium/third_party/blink/renderer/core/inspector/inspector_performance_timeline_agent.h b/chromium/third_party/blink/renderer/core/inspector/inspector_performance_timeline_agent.h new file mode 100644 index 00000000000..94c106d2b30 --- /dev/null +++ b/chromium/third_party/blink/renderer/core/inspector/inspector_performance_timeline_agent.h @@ -0,0 +1,55 @@ +// Copyright 2021 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_INSPECTOR_INSPECTOR_PERFORMANCE_TIMELINE_AGENT_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_INSPECTOR_INSPECTOR_PERFORMANCE_TIMELINE_AGENT_H_ + +#include <memory> + +#include "base/macros.h" +#include "base/task/sequence_manager/task_time_observer.h" +#include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/inspector/inspector_base_agent.h" +#include "third_party/blink/renderer/core/inspector/inspector_session_state.h" +#include "third_party/blink/renderer/core/inspector/protocol/PerformanceTimeline.h" + +namespace blink { + +class ExecutionContext; +class InspectedFrames; +class PerformanceEntry; + +class CORE_EXPORT InspectorPerformanceTimelineAgent final + : public InspectorBaseAgent<protocol::PerformanceTimeline::Metainfo> { + public: + explicit InspectorPerformanceTimelineAgent(InspectedFrames*); + ~InspectorPerformanceTimelineAgent() override; + + // PerformanceTimeline probes implementation. + void PerformanceEntryAdded(ExecutionContext*, PerformanceEntry*); + + void Trace(Visitor*) const override; + + private: + // Performance protocol domain implementation. + protocol::Response enable( + std::unique_ptr<protocol::Array<String>> event_types) override; + protocol::Response disable() override; + void Restore() override; + + void InnerEnable(); + bool IsEnabled() const; + + using EventsVector = + protocol::Array<protocol::PerformanceTimeline::TimelineEvent>; + void CollectEntries(AtomicString type, EventsVector* events); + + Member<InspectedFrames> inspected_frames_; + InspectorAgentState::Integer enabled_types_; + DISALLOW_COPY_AND_ASSIGN(InspectorPerformanceTimelineAgent); +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_INSPECTOR_INSPECTOR_PERFORMANCE_TIMELINE_AGENT_H_ |