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

Unified Diff: third_party/WebKit/Source/devtools/front_end/main/Main.js

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: rebased 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/devtools/front_end/main/Main.js
diff --git a/third_party/WebKit/Source/devtools/front_end/main/Main.js b/third_party/WebKit/Source/devtools/front_end/main/Main.js
index 3ae50f87357688061c664da5da4b7c291e0c5e88..16ad799964e6f7bba9a0016fb0faa053e01ca1cd 100644
--- a/third_party/WebKit/Source/devtools/front_end/main/Main.js
+++ b/third_party/WebKit/Source/devtools/front_end/main/Main.js
@@ -1056,16 +1056,26 @@ WebInspector.BackendSettingsSync = function()
this._autoAttachSetting.addChangeListener(this._update, this);
this._disableJavascriptSetting = WebInspector.settings.moduleSetting("javaScriptDisabled");
this._disableJavascriptSetting.addChangeListener(this._update, this);
+ this._blockedEventsWarningSetting = WebInspector.settings.moduleSetting("blockedEventsWarningEnabled");
+ this._blockedEventsWarningSetting.addChangeListener(this._update, this);
WebInspector.targetManager.observeTargets(this, WebInspector.Target.Type.Page);
}
WebInspector.BackendSettingsSync.prototype = {
+ /**
+ * @param {!WebInspector.Target} target
+ */
+ _updateTarget: function(target)
+ {
+ var blockedEventsWarningThresholdSeconds = 0.1;
+ target.pageAgent().setBlockedEventsWarningThreshold(this._blockedEventsWarningSetting.get() ? blockedEventsWarningThresholdSeconds : 0);
+ target.pageAgent().setAutoAttachToCreatedPages(this._autoAttachSetting.get());
+ target.emulationAgent().setScriptExecutionDisabled(this._disableJavascriptSetting.get());
+ },
+
_update: function()
{
- for (var target of WebInspector.targetManager.targets(WebInspector.Target.Type.Page)) {
- target.pageAgent().setAutoAttachToCreatedPages(this._autoAttachSetting.get());
- target.emulationAgent().setScriptExecutionDisabled(this._disableJavascriptSetting.get());
- }
+ WebInspector.targetManager.targets(WebInspector.Target.Type.Page).forEach(this._updateTarget, this);
},
/**
@@ -1074,8 +1084,7 @@ WebInspector.BackendSettingsSync.prototype = {
*/
targetAdded: function(target)
{
- target.pageAgent().setAutoAttachToCreatedPages(this._autoAttachSetting.get());
- target.emulationAgent().setScriptExecutionDisabled(this._disableJavascriptSetting.get());
+ this._updateTarget(target);
target.renderingAgent().setShowViewportSizeOnResize(true);
},

Powered by Google App Engine
This is Rietveld 408576698