Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorLogAgent.h

Issue 2484213003: Convert performance monitor to the subscription model. (Closed)
Patch Set: core export Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/inspector/InspectorLogAgent.h
diff --git a/third_party/WebKit/Source/core/inspector/InspectorLogAgent.h b/third_party/WebKit/Source/core/inspector/InspectorLogAgent.h
index d9de42d89b6b8c69bd00d2b15d556be375a061c4..d4ef9bfd3a940f496dcf34a9636447a5ff9abf68 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorLogAgent.h
+++ b/third_party/WebKit/Source/core/inspector/InspectorLogAgent.h
@@ -6,6 +6,7 @@
#define InspectorLogAgent_h
#include "core/CoreExport.h"
+#include "core/frame/PerformanceMonitor.h"
#include "core/inspector/InspectorBaseAgent.h"
#include "core/inspector/protocol/Log.h"
@@ -13,10 +14,11 @@ namespace blink {
class ConsoleMessage;
class ConsoleMessageStorage;
-class PerformanceMonitor;
class CORE_EXPORT InspectorLogAgent
- : public InspectorBaseAgent<protocol::Log::Metainfo> {
+ : public InspectorBaseAgent<protocol::Log::Metainfo>,
+ public PerformanceMonitor::Client {
+ USING_GARBAGE_COLLECTED_MIXIN(InspectorLogAgent);
WTF_MAKE_NONCOPYABLE(InspectorLogAgent);
public:
@@ -33,9 +35,22 @@ class CORE_EXPORT InspectorLogAgent
Response enable() override;
Response disable() override;
Response clear() override;
- Response setReportViolationsEnabled(bool) override;
+ Response startViolationsReport(
+ std::unique_ptr<protocol::Array<protocol::Log::ViolationSetting>>)
+ override;
+ Response stopViolationsReport() override;
private:
+ // PerformanceMonitor::Client implementation.
+ void reportLongTask(double startTime,
+ double endTime,
+ const HeapHashSet<Member<Frame>>& contextFrames) override;
+ void reportLongLayout(double duration) override;
+ void reportGenericViolation(PerformanceMonitor::Violation,
+ const String& text,
+ double time,
+ SourceLocation*) override;
+
bool m_enabled;
Member<ConsoleMessageStorage> m_storage;
Member<PerformanceMonitor> m_performanceMonitor;

Powered by Google App Engine
This is Rietveld 408576698