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

Unified Diff: third_party/WebKit/Source/core/frame/PerformanceMonitor.h

Issue 2514643002: DevTools: support all handlers that end up with function call in perfmonitor. (Closed)
Patch Set: 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/frame/PerformanceMonitor.h
diff --git a/third_party/WebKit/Source/core/frame/PerformanceMonitor.h b/third_party/WebKit/Source/core/frame/PerformanceMonitor.h
index 2e6093c8a77ff29462e83ca41ef41bd5cb8f2bd5..484f51c4349b2c9bd8c87a725cc7d547a59e7e3c 100644
--- a/third_party/WebKit/Source/core/frame/PerformanceMonitor.h
+++ b/third_party/WebKit/Source/core/frame/PerformanceMonitor.h
@@ -9,17 +9,16 @@
#include "platform/heap/Handle.h"
#include "public/platform/WebThread.h"
#include "public/platform/scheduler/base/task_time_observer.h"
+#include <v8.h>
namespace blink {
class DOMWindow;
class Document;
-class EventListener;
class ExecutionContext;
class Frame;
class LocalFrame;
class Performance;
-class ScheduledAction;
class SourceLocation;
// Performance monitor for Web Performance APIs and logging.
@@ -45,21 +44,12 @@ class CORE_EXPORT PerformanceMonitor final
class CORE_EXPORT HandlerCall {
STACK_ALLOCATED();
-
public:
- HandlerCall(ExecutionContext*, ScheduledAction*);
- HandlerCall(ExecutionContext*, EventListener*);
+ HandlerCall(ExecutionContext*, const char* name, bool recurring);
~HandlerCall();
private:
- void start();
-
- Member<ExecutionContext> m_context;
Member<PerformanceMonitor> m_performanceMonitor;
- Member<ScheduledAction> m_scheduledAction;
- Member<EventListener> m_eventListener;
- Violation m_violation;
- double m_startTime = 0;
};
class CORE_EXPORT Client : public GarbageCollectedMixin {
@@ -79,6 +69,8 @@ class CORE_EXPORT PerformanceMonitor final
// Instrumenting methods.
static void willExecuteScript(ExecutionContext*);
static void didExecuteScript(ExecutionContext*);
+ static void willCallFunction(ExecutionContext*);
+ static void didCallFunction(ExecutionContext*, v8::Local<v8::Function>);
static void willUpdateLayout(Document*);
static void didUpdateLayout(Document*);
static void willRecalculateStyle(Document*);
@@ -111,6 +103,8 @@ class CORE_EXPORT PerformanceMonitor final
void innerWillExecuteScript(ExecutionContext*);
void didExecuteScript();
+ void innerWillCallFunction(ExecutionContext*);
+ void didCallFunction(v8::Local<v8::Function>);
void willUpdateLayout();
void didUpdateLayout();
void willRecalculateStyle();
@@ -134,10 +128,15 @@ class CORE_EXPORT PerformanceMonitor final
Frame* observerFrame);
bool m_enabled = false;
- bool m_isExecutingScript = false;
+ unsigned m_scriptDepth = 0;
+ double m_scriptStartTime = 0;
double m_layoutStartTime = 0;
+ unsigned m_layoutDepth = 0;
double m_styleStartTime = 0;
double m_perTaskStyleAndLayoutTime = 0;
+ Violation m_handlerType = Violation::kAfterLast;
+ unsigned m_handlerDepth = 0;
+ const char* m_handlerName = nullptr;
double m_thresholds[kAfterLast];

Powered by Google App Engine
This is Rietveld 408576698