| Index: third_party/WebKit/Source/core/inspector/InspectorWebPerfAgent.h
|
| diff --git a/third_party/WebKit/Source/core/inspector/InspectorWebPerfAgent.h b/third_party/WebKit/Source/core/inspector/InspectorWebPerfAgent.h
|
| index f0f8ed6c185fd0eae694d20c151973f156cb97e1..b89d760d0500ae6c62679e60549c37699cc6ce52 100644
|
| --- a/third_party/WebKit/Source/core/inspector/InspectorWebPerfAgent.h
|
| +++ b/third_party/WebKit/Source/core/inspector/InspectorWebPerfAgent.h
|
| @@ -17,8 +17,37 @@ class ExecutionContext;
|
| class Frame;
|
| class LocalFrame;
|
| class Location;
|
| +class Performance;
|
|
|
| // Inspector Agent for Web Performance APIs
|
| +// The agent is maintained per local root.
|
| +// Long task notifications are delivered to observing Performance* instances
|
| +// (in the local frame tree) in m_webPerformanceObservers.
|
| +//
|
| +// Usage:
|
| +// To create agent:
|
| +// - instantiate and enable the agent:
|
| +// inspectorWebPerfAgent = new InspectorWebPerfAgent(localFrame);
|
| +// inspectorWebPerfAgent->enable();
|
| +// - add first Performanace* instance:
|
| +// inspectorWebPerfAgent->addWebPerformanceObserver(performance)
|
| +//
|
| +// To add additional Performance* observers, within the local frame tree:
|
| +// inspectorWebPerfAgent->addWebPerformanceObserver(performance);
|
| +//
|
| +// To remove Performance* observer:
|
| +// inspectorWebPerfAgent->removeWebPerformanceObserver(performance);
|
| +//
|
| +// To delete the agent:
|
| +// - remove last Performance* observer
|
| +// inspectorWebPerfAgent->removeWebPerformanceObserver(performance);
|
| +// - ensure all Performance* observers have been removed:
|
| +// if (!inspectorWebPerfAgent->hasWebPerformanceObservers()) { ..
|
| +// - delete the agent:
|
| +// inspectorWebPerfAgent->disable();
|
| +// inspectorWebPerfAgent = nullptr; // depending on lifetime
|
| +// management
|
| +//
|
| class CORE_EXPORT InspectorWebPerfAgent final
|
| : public GarbageCollectedFinalized<InspectorWebPerfAgent>,
|
| public WebThread::TaskObserver,
|
| @@ -33,6 +62,11 @@ class CORE_EXPORT InspectorWebPerfAgent final
|
|
|
| void enable();
|
| void disable();
|
| + bool isEnabled();
|
| +
|
| + void addWebPerformanceObserver(Performance*);
|
| + void removeWebPerformanceObserver(Performance*);
|
| + bool hasWebPerformanceObservers();
|
|
|
| void willExecuteScript(ExecutionContext*);
|
| void didExecuteScript();
|
| @@ -49,11 +83,12 @@ class CORE_EXPORT InspectorWebPerfAgent final
|
| private:
|
| bool m_enabled;
|
| std::pair<String, DOMWindow*> sanitizedAttribution(
|
| - const HeapHashSet<Member<Location>>& frameContextLocations,
|
| + const HeapHashSet<Member<Frame>>& frameContexts,
|
| Frame* observerFrame);
|
|
|
| - Member<LocalFrame> m_localFrame;
|
| - HeapHashSet<Member<Location>> m_frameContextLocations;
|
| + Member<LocalFrame> m_localRoot;
|
| + HeapHashSet<Member<Frame>> m_frameContexts;
|
| + HeapHashSet<Member<Performance>> m_webPerformanceObservers;
|
| };
|
|
|
| } // namespace blink
|
|
|