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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 /** 1044 /**
1045 * @constructor 1045 * @constructor
1046 * @implements {WebInspector.TargetManager.Observer} 1046 * @implements {WebInspector.TargetManager.Observer}
1047 */ 1047 */
1048 WebInspector.BackendSettingsSync = function() 1048 WebInspector.BackendSettingsSync = function()
1049 { 1049 {
1050 this._autoAttachSetting = WebInspector.settings.moduleSetting("autoAttachToC reatedPages"); 1050 this._autoAttachSetting = WebInspector.settings.moduleSetting("autoAttachToC reatedPages");
1051 this._autoAttachSetting.addChangeListener(this._update, this); 1051 this._autoAttachSetting.addChangeListener(this._update, this);
1052 this._disableJavascriptSetting = WebInspector.settings.moduleSetting("javaSc riptDisabled"); 1052 this._disableJavascriptSetting = WebInspector.settings.moduleSetting("javaSc riptDisabled");
1053 this._disableJavascriptSetting.addChangeListener(this._update, this); 1053 this._disableJavascriptSetting.addChangeListener(this._update, this);
1054 this._blockedEventsWarningSetting = WebInspector.settings.moduleSetting("blo ckedEventsWarningEnabled");
1055 this._blockedEventsWarningSetting.addChangeListener(this._update, this);
1054 WebInspector.targetManager.observeTargets(this, WebInspector.Target.Type.Pag e); 1056 WebInspector.targetManager.observeTargets(this, WebInspector.Target.Type.Pag e);
1055 } 1057 }
1056 1058
1057 WebInspector.BackendSettingsSync.prototype = { 1059 WebInspector.BackendSettingsSync.prototype = {
1060 /**
1061 * @param {!WebInspector.Target} target
1062 */
1063 _updateTarget: function(target)
1064 {
1065 target.pageAgent().setAutoAttachToCreatedPages(this._autoAttachSetting.g et());
1066 target.emulationAgent().setScriptExecutionDisabled(this._disableJavascri ptSetting.get());
1067
1068 var blockedEventsWarningThresholdSeconds = 0.1;
1069 target.inputAgent().setBlockedEventsWarningThreshold(this._blockedEvents WarningSetting.get() ? blockedEventsWarningThresholdSeconds : 0);
1070 },
1071
1058 _update: function() 1072 _update: function()
1059 { 1073 {
1060 for (var target of WebInspector.targetManager.targets(WebInspector.Targe t.Type.Page)) { 1074 WebInspector.targetManager.targets(WebInspector.Target.Type.Page).forEac h(this._updateTarget, this);
1061 target.pageAgent().setAutoAttachToCreatedPages(this._autoAttachSetti ng.get());
1062 target.emulationAgent().setScriptExecutionDisabled(this._disableJava scriptSetting.get());
1063 }
1064 }, 1075 },
1065 1076
1066 /** 1077 /**
1067 * @param {!WebInspector.Target} target 1078 * @param {!WebInspector.Target} target
1068 * @override 1079 * @override
1069 */ 1080 */
1070 targetAdded: function(target) 1081 targetAdded: function(target)
1071 { 1082 {
1072 target.pageAgent().setAutoAttachToCreatedPages(this._autoAttachSetting.g et()); 1083 this._updateTarget(target);
1073 target.emulationAgent().setScriptExecutionDisabled(this._disableJavascri ptSetting.get());
1074 target.renderingAgent().setShowViewportSizeOnResize(true); 1084 target.renderingAgent().setShowViewportSizeOnResize(true);
1075 }, 1085 },
1076 1086
1077 /** 1087 /**
1078 * @param {!WebInspector.Target} target 1088 * @param {!WebInspector.Target} target
1079 * @override 1089 * @override
1080 */ 1090 */
1081 targetRemoved: function(target) 1091 targetRemoved: function(target)
1082 { 1092 {
1083 } 1093 }
(...skipping 13 matching lines...) Expand all
1097 * @return {?Element} 1107 * @return {?Element}
1098 */ 1108 */
1099 settingElement: function() 1109 settingElement: function()
1100 { 1110 {
1101 return WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIStri ng("Show rulers"), WebInspector.moduleSetting("showMetricsRulers")); 1111 return WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIStri ng("Show rulers"), WebInspector.moduleSetting("showMetricsRulers"));
1102 } 1112 }
1103 } 1113 }
1104 1114
1105 1115
1106 new WebInspector.Main(); 1116 new WebInspector.Main();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698