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

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: 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 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 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 /** 1049 /**
1050 * @constructor 1050 * @constructor
1051 * @implements {WebInspector.TargetManager.Observer} 1051 * @implements {WebInspector.TargetManager.Observer}
1052 */ 1052 */
1053 WebInspector.BackendSettingsSync = function() 1053 WebInspector.BackendSettingsSync = function()
1054 { 1054 {
1055 this._autoAttachSetting = WebInspector.settings.moduleSetting("autoAttachToC reatedPages"); 1055 this._autoAttachSetting = WebInspector.settings.moduleSetting("autoAttachToC reatedPages");
1056 this._autoAttachSetting.addChangeListener(this._update, this); 1056 this._autoAttachSetting.addChangeListener(this._update, this);
1057 this._disableJavascriptSetting = WebInspector.settings.moduleSetting("javaSc riptDisabled"); 1057 this._disableJavascriptSetting = WebInspector.settings.moduleSetting("javaSc riptDisabled");
1058 this._disableJavascriptSetting.addChangeListener(this._update, this); 1058 this._disableJavascriptSetting.addChangeListener(this._update, this);
1059 this._blockedEventsWarningSetting = WebInspector.settings.moduleSetting("blo ckedEventsWarningEnabled");
1060 this._blockedEventsWarningSetting.addChangeListener(this._update, this);
1059 WebInspector.targetManager.observeTargets(this, WebInspector.Target.Type.Pag e); 1061 WebInspector.targetManager.observeTargets(this, WebInspector.Target.Type.Pag e);
1060 } 1062 }
1061 1063
1062 WebInspector.BackendSettingsSync.prototype = { 1064 WebInspector.BackendSettingsSync.prototype = {
1065 /**
1066 * @param {!WebInspector.Target} target
1067 */
1068 _updateTarget: function(target)
1069 {
1070 var blockedEventsWarningThresholdSeconds = 0.1;
1071 target.pageAgent().setBlockedEventsWarningThreshold(this._blockedEventsW arningSetting.get() ? blockedEventsWarningThresholdSeconds : 0);
1072 target.pageAgent().setAutoAttachToCreatedPages(this._autoAttachSetting.g et());
1073 target.emulationAgent().setScriptExecutionDisabled(this._disableJavascri ptSetting.get());
1074 },
1075
1063 _update: function() 1076 _update: function()
1064 { 1077 {
1065 for (var target of WebInspector.targetManager.targets(WebInspector.Targe t.Type.Page)) { 1078 WebInspector.targetManager.targets(WebInspector.Target.Type.Page).forEac h(this._updateTarget, this);
1066 target.pageAgent().setAutoAttachToCreatedPages(this._autoAttachSetti ng.get());
1067 target.emulationAgent().setScriptExecutionDisabled(this._disableJava scriptSetting.get());
1068 }
1069 }, 1079 },
1070 1080
1071 /** 1081 /**
1072 * @param {!WebInspector.Target} target 1082 * @param {!WebInspector.Target} target
1073 * @override 1083 * @override
1074 */ 1084 */
1075 targetAdded: function(target) 1085 targetAdded: function(target)
1076 { 1086 {
1077 target.pageAgent().setAutoAttachToCreatedPages(this._autoAttachSetting.g et()); 1087 this._updateTarget(target);
1078 target.emulationAgent().setScriptExecutionDisabled(this._disableJavascri ptSetting.get());
1079 target.renderingAgent().setShowViewportSizeOnResize(true); 1088 target.renderingAgent().setShowViewportSizeOnResize(true);
1080 }, 1089 },
1081 1090
1082 /** 1091 /**
1083 * @param {!WebInspector.Target} target 1092 * @param {!WebInspector.Target} target
1084 * @override 1093 * @override
1085 */ 1094 */
1086 targetRemoved: function(target) 1095 targetRemoved: function(target)
1087 { 1096 {
1088 } 1097 }
(...skipping 13 matching lines...) Expand all
1102 * @return {?Element} 1111 * @return {?Element}
1103 */ 1112 */
1104 settingElement: function() 1113 settingElement: function()
1105 { 1114 {
1106 return WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIStri ng("Show rulers"), WebInspector.moduleSetting("showMetricsRulers")); 1115 return WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIStri ng("Show rulers"), WebInspector.moduleSetting("showMetricsRulers"));
1107 } 1116 }
1108 } 1117 }
1109 1118
1110 1119
1111 new WebInspector.Main(); 1120 new WebInspector.Main();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698