Changeset 101381 in webkit
- Timestamp:
- Nov 29, 2011 8:01:30 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/inspector/profiler/detailed-heapshots-test.js
r89372 r101381 14 14 InspectorTest.addSniffer(WebInspector.DetailedHeapshotView.prototype, "_updatePercentButton", InspectorTest._snapshotViewShown, true); 15 15 16 if ( Preferences.detailedHeapProfiles)16 if (Capabilities.detailedHeapProfiles) 17 17 detailedHeapProfilesEnabled(); 18 18 else { … … 63 63 InspectorTest.runDetailedHeapshotTestSuite = function(testSuite) 64 64 { 65 if (! Preferences.heapProfilerPresent) {65 if (!Capabilities.heapProfilerPresent) { 66 66 InspectorTest.addResult("Heap profiler is disabled"); 67 67 InspectorTest.completeTest(); -
trunk/Source/WebCore/ChangeLog
r101376 r101381 1 2011-11-29 Pavel Feldman <pfeldman@google.com> 2 3 Web Inspector: split Preferences into Preferences and Capabilities. 4 https://bugs.webkit.org/show_bug.cgi?id=73321 5 6 Part of the Preferences defined in Settings.js are in fact backend capabilities. 7 Split them into two separate objects for further capabilities refactoring. 8 9 Reviewed by Yury Semikhatsky. 10 11 * inspector/front-end/DebuggerModel.js: 12 * inspector/front-end/ElementsPanel.js: 13 (WebInspector.ElementsPanel): 14 (WebInspector.ElementsPanel.prototype.wasShown): 15 (WebInspector.ElementsPanel.prototype._populateContextMenu): 16 * inspector/front-end/NetworkItemView.js: 17 (WebInspector.NetworkItemView): 18 * inspector/front-end/NetworkPanel.js: 19 (WebInspector.NetworkLogView.prototype._createTable): 20 (WebInspector.NetworkLogView.prototype.switchToDetailedView): 21 (WebInspector.NetworkLogView.prototype.switchToBriefView): 22 (WebInspector.NetworkLogView.prototype._contextMenu): 23 (WebInspector.NetworkDataGridNode.prototype.createCells): 24 (WebInspector.NetworkDataGridNode.prototype.refreshResource): 25 * inspector/front-end/ProfileDataGridTree.js: 26 (WebInspector.ProfileDataGridNode.prototype.get data.formatMilliseconds): 27 * inspector/front-end/ProfileView.js: 28 * inspector/front-end/ProfilesPanel.js: 29 (WebInspector.ProfilesPanel.prototype._enableDetailedHeapProfiles): 30 * inspector/front-end/Resource.js: 31 (WebInspector.Resource.prototype.populateImageSource): 32 * inspector/front-end/ScriptsPanel.js: 33 (WebInspector.ScriptsPanel.prototype.wasShown): 34 (WebInspector.ScriptsPanel.prototype._clearInterface): 35 * inspector/front-end/Settings.js: 36 * inspector/front-end/SettingsScreen.js: 37 (WebInspector.SettingsScreen): 38 * inspector/front-end/StylesSidebarPane.js: 39 * inspector/front-end/inspector.js: 40 1 41 2011-11-29 Simon Hausmann <simon.hausmann@nokia.com> 2 42 -
trunk/Source/WebCore/inspector/front-end/DebuggerModel.js
r101367 r101381 90 90 /** 91 91 * @param {Protocol.Error} error 92 * @param {Array.< string>} capabilities92 * @param {Array.<MetaAgent.DomainCapabilities>} capabilities 93 93 */ 94 94 function callback(error, capabilities) -
trunk/Source/WebCore/inspector/front-end/ElementsPanel.js
r100994 r101381 71 71 this.sidebarPanes.metrics = new WebInspector.MetricsSidebarPane(); 72 72 this.sidebarPanes.properties = new WebInspector.PropertiesSidebarPane(); 73 if ( Preferences.nativeInstrumentationEnabled)73 if (Capabilities.nativeInstrumentationEnabled) 74 74 this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane; 75 75 this.sidebarPanes.eventListeners = new WebInspector.EventListenersSidebarPane(); … … 138 138 WebInspector.domAgent.requestDocument(); 139 139 140 if ( Preferences.nativeInstrumentationEnabled)140 if (Capabilities.nativeInstrumentationEnabled) 141 141 this.sidebarElement.insertBefore(this.sidebarPanes.domBreakpoints.element, this.sidebarPanes.eventListeners.element); 142 142 }, … … 202 202 } 203 203 204 if ( Preferences.nativeInstrumentationEnabled)204 if (Capabilities.nativeInstrumentationEnabled) 205 205 this.sidebarPanes.domBreakpoints.restoreBreakpoints(); 206 206 … … 320 320 _populateContextMenu: function(contextMenu, node) 321 321 { 322 if ( Preferences.nativeInstrumentationEnabled) {322 if (Capabilities.nativeInstrumentationEnabled) { 323 323 // Add debbuging-related actions 324 324 contextMenu.appendSeparator(); -
trunk/Source/WebCore/inspector/front-end/NetworkItemView.js
r98194 r101381 48 48 this.appendTab("response", WebInspector.UIString("Response"), responseView); 49 49 50 if ( Preferences.showCookiesTab) {50 if (Capabilities.showCookiesTab) { 51 51 this._cookiesView = new WebInspector.ResourceCookiesView(resource); 52 52 this.appendTab("cookies", WebInspector.UIString("Cookies"), this._cookiesView); 53 53 } 54 54 55 if ( Preferences.showTimingTab) {55 if (Capabilities.showTimingTab) { 56 56 var timingView = new WebInspector.ResourceTimingView(resource); 57 57 this.appendTab("timing", WebInspector.UIString("Timing"), timingView); -
trunk/Source/WebCore/inspector/front-end/NetworkPanel.js
r101154 r101381 140 140 { 141 141 var columns; 142 if ( Preferences.showNetworkPanelInitiatorColumn)142 if (Capabilities.nativeInstrumentationEnabled) 143 143 columns = {name: {}, method: {}, status: {}, type: {}, initiator: {}, size: {}, time: {}, timeline: {}}; 144 144 else … … 161 161 columns.type.width = "6%"; 162 162 163 if ( Preferences.showNetworkPanelInitiatorColumn) {163 if (Capabilities.nativeInstrumentationEnabled) { 164 164 columns.initiator.title = WebInspector.UIString("Initiator"); 165 165 columns.initiator.sortable = true; … … 179 179 columns.timeline.title = ""; 180 180 columns.timeline.sortable = false; 181 if ( Preferences.showNetworkPanelInitiatorColumn)181 if (Capabilities.nativeInstrumentationEnabled) 182 182 columns.timeline.width = "40%"; 183 183 else … … 832 832 this._dataGrid.showColumn("status"); 833 833 this._dataGrid.showColumn("type"); 834 if ( Preferences.showNetworkPanelInitiatorColumn)834 if (Capabilities.nativeInstrumentationEnabled) 835 835 this._dataGrid.showColumn("initiator"); 836 836 this._dataGrid.showColumn("size"); … … 843 843 widths.status = 6; 844 844 widths.type = 6; 845 if ( Preferences.showNetworkPanelInitiatorColumn)845 if (Capabilities.nativeInstrumentationEnabled) 846 846 widths.initiator = 10; 847 847 widths.size = 6; 848 848 widths.time = 6; 849 if ( Preferences.showNetworkPanelInitiatorColumn)849 if (Capabilities.nativeInstrumentationEnabled) 850 850 widths.timeline = 40; 851 851 else … … 863 863 this._dataGrid.hideColumn("status"); 864 864 this._dataGrid.hideColumn("type"); 865 if ( Preferences.showNetworkPanelInitiatorColumn)865 if (Capabilities.nativeInstrumentationEnabled) 866 866 this._dataGrid.hideColumn("initiator"); 867 867 this._dataGrid.hideColumn("size"); … … 941 941 } 942 942 943 if ( Preferences.canClearCacheAndCookies) {943 if (Capabilities.canClearCacheAndCookies) { 944 944 contextMenu.appendSeparator(); 945 945 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Clear browser cache" : "Clear Browser Cache"), this._clearBrowserCache.bind(this)); … … 1687 1687 this._statusCell = this._createDivInTD("status"); 1688 1688 this._typeCell = this._createDivInTD("type"); 1689 if ( Preferences.showNetworkPanelInitiatorColumn)1689 if (Capabilities.nativeInstrumentationEnabled) 1690 1690 this._initiatorCell = this._createDivInTD("initiator"); 1691 1691 this._sizeCell = this._createDivInTD("size"); … … 1781 1781 this._refreshStatusCell(); 1782 1782 this._refreshTypeCell(); 1783 if ( Preferences.showNetworkPanelInitiatorColumn)1783 if (Capabilities.nativeInstrumentationEnabled) 1784 1784 this._refreshInitiatorCell(); 1785 1785 this._refreshSizeCell(); -
trunk/Source/WebCore/inspector/front-end/ProfileDataGridTree.js
r97977 r101381 51 51 function formatMilliseconds(time) 52 52 { 53 return Number.secondsToString(time / 1000, ! Preferences.samplingCPUProfiler);53 return Number.secondsToString(time / 1000, !Capabilities.samplingCPUProfiler); 54 54 } 55 55 -
trunk/Source/WebCore/inspector/front-end/ProfileView.js
r100903 r101381 43 43 "function": { title: WebInspector.UIString("Function"), disclosure: true, sortable: true } }; 44 44 45 if ( Preferences.samplingCPUProfiler) {45 if (Capabilities.samplingCPUProfiler) { 46 46 delete columns.average; 47 47 delete columns.calls; -
trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js
r100991 r101381 120 120 this.enableToggleButton = new WebInspector.StatusBarButton("", "enable-toggle-status-bar-item"); 121 121 this.enableToggleButton.addEventListener("click", this._toggleProfiling.bind(this), false); 122 if ( Preferences.profilerAlwaysEnabled)122 if (Capabilities.profilerAlwaysEnabled) 123 123 this.enableToggleButton.element.addStyleClass("hidden"); 124 124 … … 132 132 133 133 this._profiles = []; 134 this._profilerEnabled = Preferences.profilerAlwaysEnabled;134 this._profilerEnabled = Capabilities.profilerAlwaysEnabled; 135 135 this._reset(); 136 136 137 137 this._registerProfileType(new WebInspector.CPUProfileType()); 138 if ( Preferences.heapProfilerPresent)138 if (Capabilities.heapProfilerPresent) 139 139 this._registerProfileType(new WebInspector.DetailedHeapshotProfileType()); 140 140 141 141 InspectorBackend.registerProfilerDispatcher(new WebInspector.ProfilerDispatcher(this)); 142 142 143 if ( Preferences.profilerAlwaysEnabled || WebInspector.settings.profilerEnabled.get())143 if (Capabilities.profilerAlwaysEnabled || WebInspector.settings.profilerEnabled.get()) 144 144 ProfilerAgent.enable(); 145 145 else { … … 890 890 profileType.treeElement = oldProfileType.treeElement; 891 891 this._profileTypesByIdMap[profileType.id] = profileType; 892 Preferences.detailedHeapProfiles = true;892 Capabilities.detailedHeapProfiles = true; 893 893 this.detach(); 894 894 this.show(); -
trunk/Source/WebCore/inspector/front-end/Resource.js
r101126 r101381 892 892 } 893 893 894 if (Preferences.useDataURLForResourceImageIcons) 895 this.requestContent(onResourceContent.bind(this)); 896 else 897 image.src = this.url; 894 this.requestContent(onResourceContent.bind(this)); 898 895 }, 899 896 -
trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js
r101160 r101381 69 69 this.sidebarPanes.scopechain = new WebInspector.ScopeChainSidebarPane(); 70 70 this.sidebarPanes.jsBreakpoints = new WebInspector.JavaScriptBreakpointsSidebarPane(this._presentationModel, this._showSourceLine.bind(this)); 71 if ( Preferences.nativeInstrumentationEnabled) {71 if (Capabilities.nativeInstrumentationEnabled) { 72 72 this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane; 73 73 this.sidebarPanes.xhrBreakpoints = new WebInspector.XHRBreakpointsSidebarPane(); … … 75 75 } 76 76 77 if ( Preferences.canInspectWorkers && !WebInspector.WorkerManager.isWorkerFrontend()) {77 if (Capabilities.canInspectWorkers && !WebInspector.WorkerManager.isWorkerFrontend()) { 78 78 WorkerAgent.setWorkerInspectionEnabled(true); 79 79 this.sidebarPanes.workerList = new WebInspector.WorkerListSidebarPane(WebInspector.workerManager); … … 104 104 this.enableToggleButton = new WebInspector.StatusBarButton("", "enable-toggle-status-bar-item"); 105 105 this.enableToggleButton.addEventListener("click", this.toggleDebugging, this); 106 if ( Preferences.debuggerAlwaysEnabled)106 if (Capabilities.debuggerAlwaysEnabled) 107 107 this.enableToggleButton.element.addStyleClass("hidden"); 108 108 … … 117 117 this._scriptViewStatusBarItemsContainer.style.display = "inline-block"; 118 118 119 this._debuggerEnabled = Preferences.debuggerAlwaysEnabled;119 this._debuggerEnabled = Capabilities.debuggerAlwaysEnabled; 120 120 121 121 this._reset(false); … … 138 138 this._presentationModel.addEventListener(WebInspector.DebuggerPresentationModel.Events.DebuggerReset, this._reset.bind(this, false)); 139 139 140 var enableDebugger = Preferences.debuggerAlwaysEnabled || WebInspector.settings.debuggerEnabled.get();140 var enableDebugger = Capabilities.debuggerAlwaysEnabled || WebInspector.settings.debuggerEnabled.get(); 141 141 if (enableDebugger) 142 142 WebInspector.debuggerModel.enableDebugger(); … … 178 178 { 179 179 WebInspector.Panel.prototype.wasShown.call(this); 180 if ( Preferences.nativeInstrumentationEnabled)180 if (Capabilities.nativeInstrumentationEnabled) 181 181 this.sidebarElement.insertBefore(this.sidebarPanes.domBreakpoints.element, this.sidebarPanes.xhrBreakpoints.element); 182 182 this.sidebarPanes.watchExpressions.show(); … … 803 803 this.sidebarPanes.scopechain.update(null); 804 804 this.sidebarPanes.jsBreakpoints.clearBreakpointHighlight(); 805 if ( Preferences.nativeInstrumentationEnabled) {805 if (Capabilities.nativeInstrumentationEnabled) { 806 806 this.sidebarPanes.domBreakpoints.clearBreakpointHighlight(); 807 807 this.sidebarPanes.eventListenerBreakpoints.clearBreakpointHighlight(); -
trunk/Source/WebCore/inspector/front-end/Settings.js
r100695 r101381 38 38 styleRulesExpandedState: {}, 39 39 showMissingLocalizedStrings: false, 40 showColorNicknames: true, 41 saveAsAvailable: false, 42 useLowerCaseMenuTitlesOnWindows: false, 43 hasExtensions: false, 44 sharedWorkersDebugNote: undefined, 45 localizeUI: true, 46 applicationTitle: "Web Inspector - %s" 47 } 48 49 var Capabilities = { 40 50 samplingCPUProfiler: false, 41 showColorNicknames: true,42 51 debuggerAlwaysEnabled: false, 43 52 profilerAlwaysEnabled: false, 44 53 nativeInstrumentationEnabled: false, 45 useDataURLForResourceImageIcons: true,46 54 showTimingTab: false, 47 55 showCookiesTab: false, 48 debugMode: false,49 56 heapProfilerPresent: false, 50 57 detailedHeapProfiles: false, 51 saveAsAvailable: false,52 useLowerCaseMenuTitlesOnWindows: false,53 58 canInspectWorkers: false, 54 59 canClearCacheAndCookies: false, 55 canDisableCache: false, 56 showNetworkPanelInitiatorColumn: false, 57 haveExtensions: false, 58 sharedWorkersDebugNote: undefined, 59 localizeUI: true, 60 applicationTitle: "Web Inspector - %s" 60 canDisableCache: false 61 61 } 62 62 -
trunk/Source/WebCore/inspector/front-end/SettingsScreen.js
r100595 r101381 60 60 61 61 p = this._appendSection(WebInspector.UIString("Network"), true); 62 if ( Preferences.canDisableCache)62 if (Capabilities.canDisableCache) 63 63 p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Disable cache"), WebInspector.settings.cacheDisabled)); 64 64 p.appendChild(this._createUserActionControl()); … … 72 72 p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Preserve log upon navigation"), WebInspector.settings.preserveConsoleLog)); 73 73 74 if (Preferences.ha veExtensions) {74 if (Preferences.hasExtensions) { 75 75 var handlerSelector = new WebInspector.HandlerSelector(WebInspector.openAnchorLocationRegistry); 76 76 p = this._appendSection(WebInspector.UIString("Extensions"), true); -
trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js
r101341 r101381 890 890 this._selectorElement.textContent = styleRule.selectorText; 891 891 selectorContainer.appendChild(this._selectorElement); 892 if (Preferences.debugMode)893 this._selectorElement.addEventListener("click", this._debugShowStyle.bind(this), false);894 892 895 893 var openBrace = document.createElement("span"); … … 1134 1132 item.updateTitle(); 1135 1133 return item; 1136 },1137 1138 _debugShowStyle: function(event)1139 {1140 var boundHandler;1141 function removeStyleBox(element, event)1142 {1143 if (event.target === element) {1144 event.stopPropagation();1145 return;1146 }1147 document.body.removeChild(element);1148 document.getElementById("main").removeEventListener("mousedown", boundHandler, true);1149 }1150 1151 if (!event.shiftKey)1152 return;1153 1154 var container = document.createElement("div");1155 var element = document.createElement("span");1156 container.appendChild(element);1157 element.style.background = "yellow";1158 element.style.display = "inline-block";1159 container.style.cssText = "z-index: 2000000; position: absolute; top: 50px; left: 50px; white-space: pre; overflow: auto; background: white; font-family: monospace; font-size: 12px; border: 1px solid black; opacity: 0.85; -webkit-user-select: text; padding: 2px;";1160 container.style.width = (document.body.offsetWidth - 100) + "px";1161 container.style.height = (document.body.offsetHeight - 100) + "px";1162 document.body.appendChild(container);1163 if (this.rule)1164 element.textContent = this.rule.selectorText + " {" + ((this.styleRule.style.cssText !== undefined) ? this.styleRule.style.cssText : "<no cssText>") + "}";1165 else1166 element.textContent = this.styleRule.style.cssText;1167 boundHandler = removeStyleBox.bind(null, container);1168 document.getElementById("main").addEventListener("mousedown", boundHandler, true);1169 1134 }, 1170 1135 -
trunk/Source/WebCore/inspector/front-end/inspector.js
r101359 r101381 359 359 this.advancedSearchController = new WebInspector.AdvancedSearchController(); 360 360 361 if ( Preferences.nativeInstrumentationEnabled)361 if (Capabilities.nativeInstrumentationEnabled) 362 362 this.domBreakpointsSidebarPane = new WebInspector.DOMBreakpointsSidebarPane(); 363 363 -
trunk/Source/WebKit/chromium/ChangeLog
r101337 r101381 1 2011-11-29 Pavel Feldman <pfeldman@google.com> 2 3 Web Inspector: split Preferences into Preferences and Capabilities. 4 https://bugs.webkit.org/show_bug.cgi?id=73321 5 6 Reviewed by Yury Semikhatsky. 7 8 * src/js/DevTools.js: 9 1 10 2011-11-29 Jing Zhao <jingzhao@chromium.org> 2 11 -
trunk/Source/WebKit/chromium/src/js/DevTools.js
r100695 r101381 36 36 {(function () { 37 37 Preferences.ignoreWhitespace = false; 38 Preferences.samplingCPUProfiler = true;39 Preferences.heapProfilerPresent = true;40 Preferences.detailedHeapProfiles = true;41 Preferences.debuggerAlwaysEnabled = true;42 Preferences.profilerAlwaysEnabled = true;43 Preferences.nativeInstrumentationEnabled = true;44 Preferences.fileSystemEnabled = false;45 Preferences.showTimingTab = true;46 Preferences.showCookiesTab = true;47 38 Preferences.saveAsAvailable = true; 48 39 Preferences.useLowerCaseMenuTitlesOnWindows = true; 49 Preferences.canInspectWorkers = true; 50 Preferences.canClearCacheAndCookies = true; 51 Preferences.canDisableCache = true; 52 Preferences.showNetworkPanelInitiatorColumn = true; 53 Preferences.haveExtensions = true; 40 Preferences.hasExtensions = true; 54 41 Preferences.sharedWorkersDebugNote = "Shared workers can be inspected in the Task Manager"; 55 42 Preferences.localizeUI = false; 56 43 Preferences.applicationTitle = "Developer Tools - %s"; 44 45 Capabilities.samplingCPUProfiler = true; 46 Capabilities.heapProfilerPresent = true; 47 Capabilities.detailedHeapProfiles = true; 48 Capabilities.debuggerAlwaysEnabled = true; 49 Capabilities.profilerAlwaysEnabled = true; 50 Capabilities.nativeInstrumentationEnabled = true; 51 Capabilities.showTimingTab = true; 52 Capabilities.showCookiesTab = true; 53 Capabilities.canInspectWorkers = true; 54 Capabilities.canClearCacheAndCookies = true; 55 Capabilities.canDisableCache = true; 57 56 })();} 58 57
Note: See TracChangeset
for help on using the changeset viewer.