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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorInputAgent.cpp

Issue 1949793002: Emit a console warning when blocking event listener is delayed for too long (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed forward decls & includes that are not in use now Created 4 years, 7 months 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/InspectorInputAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorInputAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorInputAgent.cpp
index 1fe3e8cb546a0153fa4808ee6db2fcf228984562..1ee5812883ccf3ef43069a9606b48fa0d6f53c38 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorInputAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorInputAgent.cpp
@@ -30,8 +30,11 @@
#include "core/inspector/InspectorInputAgent.h"
+#include "core/dom/ExecutionContext.h"
+#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
+#include "core/frame/Settings.h"
#include "core/input/EventHandler.h"
#include "core/inspector/InspectedFrames.h"
#include "core/page/ChromeClient.h"
@@ -124,6 +127,10 @@ void ConvertInspectorPoint(blink::LocalFrame* frame, const blink::IntPoint& poin
namespace blink {
+namespace InputAgentState {
+static const char blockedEventsWarningThreshold[] = "blockedEventsWarningThreshold";
+}
+
InspectorInputAgent::InspectorInputAgent(InspectedFrames* inspectedFrames)
: InspectorBaseAgent<InspectorInputAgent, protocol::Frontend::Input>("Input")
, m_inspectedFrames(inspectedFrames)
@@ -203,6 +210,22 @@ void InspectorInputAgent::dispatchTouchEvent(ErrorString* error, const String& t
m_inspectedFrames->root()->eventHandler().handleTouchEvent(event);
}
+void InspectorInputAgent::restore()
+{
+ ErrorString dummy;
+
+ setBlockedEventsWarningThreshold(&dummy, m_state->numberProperty(InputAgentState::blockedEventsWarningThreshold, 0.0));
+}
+
+void InspectorInputAgent::setBlockedEventsWarningThreshold(ErrorString*, double threshold)
+{
+ m_state->setNumber(InputAgentState::blockedEventsWarningThreshold, threshold);
+ FrameHost* host = m_inspectedFrames->root()->host();
+ if (!host)
+ return;
+ host->settings().setBlockedMainThreadEventsWarningThreshold(threshold);
+}
+
DEFINE_TRACE(InspectorInputAgent)
{
visitor->trace(m_inspectedFrames);

Powered by Google App Engine
This is Rietveld 408576698