Changeset 89652 in webkit
- Timestamp:
- Jun 23, 2011 10:42:25 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r89651 r89652 1 2011-06-23 Yury Semikhatsky <yurys@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 [Chromium] Web Inspector: provide context menu item for enabling native worker inspection 6 https://bugs.webkit.org/show_bug.cgi?id=63258 7 8 Added context menu checkbox item that allows to enable inspection of 9 native workers. The value will be persisted as other inspector settings 10 and will be restored after frontend/breowser reopening. 11 12 * inspector/Inspector.json: 13 * inspector/InspectorController.cpp: 14 (WebCore::InspectorController::restoreInspectorStateFromCookie): 15 * inspector/InspectorInstrumentation.h: 16 (WebCore::InspectorInstrumentation::didStartWorkerContext): 17 * inspector/InspectorWorkerAgent.cpp: 18 (WebCore::InspectorWorkerAgent::setFrontend): 19 (WebCore::InspectorWorkerAgent::restore): 20 (WebCore::InspectorWorkerAgent::setWorkerInspectionEnabled): 21 * inspector/InspectorWorkerAgent.h: 22 * inspector/front-end/ScriptsPanel.js: 23 (WebInspector.ScriptsPanel): 24 (WebInspector.ScriptsPanel.prototype.reset): 25 (WebInspector.ScriptsPanel.prototype._toggleFormatSourceFiles): 26 (WebInspector.ScriptsPanel.prototype._contextMenu.enableWorkerInspection): 27 (WebInspector.ScriptsPanel.prototype._contextMenu): 28 * inspector/front-end/Settings.js: 29 (WebInspector.Settings): 30 * inspector/front-end/inspector.js: 31 (WebInspector.didCreateWorker): 32 (WebInspector.didDestroyWorker): 33 * workers/Worker.cpp: 34 (WebCore::Worker::notifyFinished): 35 1 36 2011-06-23 Simon Fraser <simon.fraser@apple.com> 2 37 -
trunk/Source/WebCore/inspector/Inspector.json
r89449 r89652 1758 1758 "commands": [ 1759 1759 { 1760 "name": "setWorkerInspectionEnabled", 1761 "parameters": [ 1762 { "name": "value", "type": "boolean" } 1763 ] 1764 }, 1765 { 1760 1766 "name": "sendMessageToWorker", 1761 1767 "parameters": [ -
trunk/Source/WebCore/inspector/InspectorController.cpp
r89456 r89652 340 340 m_domStorageAgent->restore(); 341 341 #endif 342 #if ENABLE(WORKERS) 343 m_workerAgent->restore(); 344 #endif 342 345 #if ENABLE(JAVASCRIPT_DEBUGGER) 343 346 m_debuggerAgent->restore(); -
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
r89345 r89652 167 167 168 168 #if ENABLE(WORKERS) 169 static bool willStartWorkerContext(ScriptExecutionContext*, WorkerContextProxy*); 170 static void didStartWorkerContext(ScriptExecutionContext*, WorkerContextProxy*, bool paused, const KURL&); 169 static void didStartWorkerContext(ScriptExecutionContext*, WorkerContextProxy*, const KURL&); 171 170 static void didCreateWorker(ScriptExecutionContext*, intptr_t id, const String& url, bool isSharedWorker); 172 171 static void didDestroyWorker(ScriptExecutionContext*, intptr_t id); … … 908 907 909 908 #if ENABLE(WORKERS) 910 inline bool InspectorInstrumentation::willStartWorkerContext(ScriptExecutionContext*, WorkerContextProxy*) 911 { 912 return false; 913 } 914 915 inline void InspectorInstrumentation::didStartWorkerContext(ScriptExecutionContext* context, WorkerContextProxy* proxy, bool paused, const KURL& url) 916 { 917 #if ENABLE(INSPECTOR) 918 if (!paused) 919 return; 909 inline void InspectorInstrumentation::didStartWorkerContext(ScriptExecutionContext* context, WorkerContextProxy* proxy, const KURL& url) 910 { 911 #if ENABLE(INSPECTOR) 920 912 FAST_RETURN_IF_NO_FRONTENDS(void()); 921 913 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context)) -
trunk/Source/WebCore/inspector/InspectorWorkerAgent.cpp
r88547 r89652 48 48 49 49 namespace WorkerAgentState { 50 static const char workerInspectionEnabled[] = "workerInspectionEnabled"; 50 51 static const char autoconnectToWorkers[] = "autoconnectToWorkers"; 51 52 }; … … 124 125 { 125 126 m_inspectorFrontend = frontend; 126 // Disabled for now. 127 // m_instrumentingAgents->setInspectorWorkerAgent(this); 127 restore(); 128 } 129 130 void InspectorWorkerAgent::restore() 131 { 132 if (m_inspectorState->getBoolean(WorkerAgentState::workerInspectionEnabled)) 133 m_instrumentingAgents->setInspectorWorkerAgent(this); 128 134 } 129 135 … … 140 146 } 141 147 148 void InspectorWorkerAgent::setWorkerInspectionEnabled(ErrorString*, bool value) 149 { 150 m_inspectorState->setBoolean(WorkerAgentState::workerInspectionEnabled, value); 151 if (!m_inspectorFrontend) 152 return; 153 if (value) 154 m_instrumentingAgents->setInspectorWorkerAgent(this); 155 else 156 m_instrumentingAgents->setInspectorWorkerAgent(0); 157 } 158 142 159 void InspectorWorkerAgent::connectToWorker(ErrorString* error, int workerId) 143 160 { -
trunk/Source/WebCore/inspector/InspectorWorkerAgent.h
r87992 r89652 53 53 54 54 void setFrontend(InspectorFrontend*); 55 void restore(); 55 56 void clearFrontend(); 56 57 … … 60 61 61 62 // Called from InspectorBackendDispatcher 63 void setWorkerInspectionEnabled(ErrorString*, bool value); 62 64 void connectToWorker(ErrorString*, int workerId); 63 65 void disconnectFromWorker(ErrorString*, int workerId); -
trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js
r89428 r89652 107 107 } 108 108 109 this.sidebarPanes.workers = new WebInspector.WorkersSidebarPane();110 109 if (Preferences.canInspectWorkers && WebInspector.workerManager) 110 this.sidebarElement.addEventListener("contextmenu", this._contextMenu.bind(this), true); 111 if (Preferences.canInspectWorkers && WebInspector.workerManager && WebInspector.settings.workerInspectionEnabled) { 112 WorkerAgent.setWorkerInspectionEnabled(true); 111 113 this.sidebarPanes.workerList = new WebInspector.WorkerListSidebarPane(WebInspector.workerManager); 112 114 } else 115 this.sidebarPanes.workers = new WebInspector.WorkersSidebarPane(); 113 116 114 117 for (var pane in this.sidebarPanes) … … 498 501 this.sidebarPanes.jsBreakpoints.reset(); 499 502 this.sidebarPanes.watchExpressions.refreshExpressions(); 500 if (!preserveItems )503 if (!preserveItems && this.sidebarPanes.workers) 501 504 this.sidebarPanes.workers.reset(); 502 505 }, … … 1067 1070 this._toggleFormatSourceFilesButton.toggled = !this._toggleFormatSourceFilesButton.toggled; 1068 1071 this._presentationModel.setFormatSourceFiles(this._toggleFormatSourceFilesButton.toggled); 1072 }, 1073 1074 _contextMenu: function(event) 1075 { 1076 var contextMenu = new WebInspector.ContextMenu(); 1077 1078 function enableWorkerInspection() 1079 { 1080 var newValue = !WebInspector.settings.workerInspectionEnabled; 1081 WebInspector.settings.workerInspectionEnabled = newValue; 1082 WorkerAgent.setWorkerInspectionEnabled(newValue); 1083 if (newValue) { 1084 var element = this.sidebarPanes.workers.element; 1085 delete this.sidebarPanes.workers; 1086 this.sidebarPanes.workerList = new WebInspector.WorkerListSidebarPane(WebInspector.workerManager); 1087 element.parentNode.replaceChild(this.sidebarPanes.workerList.element, element); 1088 } else { 1089 var element = this.sidebarPanes.workerList.element; 1090 delete this.sidebarPanes.workerList; 1091 this.sidebarPanes.workers = new WebInspector.WorkersSidebarPane(); 1092 element.parentNode.replaceChild(this.sidebarPanes.workers.element, element); 1093 } 1094 } 1095 contextMenu.appendCheckboxItem(WebInspector.UIString("Enable worker inspection"), enableWorkerInspection.bind(this), WebInspector.settings.workerInspectionEnabled); 1096 1097 contextMenu.show(event); 1069 1098 } 1070 1099 } -
trunk/Source/WebCore/inspector/front-end/Settings.js
r89135 r89652 79 79 this.installApplicationSetting("domBreakpoints", []); 80 80 this.installApplicationSetting("xhrBreakpoints", []); 81 this.installApplicationSetting("workerInspectionEnabled", []); 81 82 82 83 // If there are too many breakpoints in a storage, it is likely due to a recent bug that caused -
trunk/Source/WebCore/inspector/front-end/inspector.js
r89556 r89652 1005 1005 { 1006 1006 var workersPane = WebInspector.panels.scripts.sidebarPanes.workers; 1007 workersPane.addWorker.apply(workersPane, arguments); 1007 if (workersPane) 1008 workersPane.addWorker.apply(workersPane, arguments); 1008 1009 } 1009 1010 … … 1011 1012 { 1012 1013 var workersPane = WebInspector.panels.scripts.sidebarPanes.workers; 1013 workersPane.removeWorker.apply(workersPane, arguments); 1014 if (workersPane) 1015 workersPane.removeWorker.apply(workersPane, arguments); 1014 1016 } 1015 1017 -
trunk/Source/WebCore/workers/Worker.cpp
r88578 r89652 132 132 dispatchEvent(Event::create(eventNames().errorEvent, false, true)); 133 133 else { 134 bool shouldStartPaused = InspectorInstrumentation::willStartWorkerContext(scriptExecutionContext(), m_contextProxy);135 134 m_contextProxy->startWorkerContext(m_scriptLoader->url(), scriptExecutionContext()->userAgent(m_scriptLoader->url()), m_scriptLoader->script()); 136 InspectorInstrumentation::didStartWorkerContext(scriptExecutionContext(), m_contextProxy, shouldStartPaused,m_scriptLoader->url());135 InspectorInstrumentation::didStartWorkerContext(scriptExecutionContext(), m_contextProxy, m_scriptLoader->url()); 137 136 InspectorInstrumentation::scriptImported(scriptExecutionContext(), m_scriptLoader->identifier(), m_scriptLoader->script()); 138 137 } -
trunk/Source/WebKit/chromium/ChangeLog
r89635 r89652 1 2011-06-23 Yury Semikhatsky <yurys@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 [Chromium] Web Inspector: provide context menu item for enabling native worker inspection 6 https://bugs.webkit.org/show_bug.cgi?id=63258 7 8 * src/js/DevTools.js: 9 (): 10 1 11 2011-06-23 John Bates <jbates@google.com> 2 12 -
trunk/Source/WebKit/chromium/src/js/DevTools.js
r86746 r89652 53 53 Preferences.saveAsAvailable = true; 54 54 Preferences.useLowerCaseMenuTitlesOnWindows = true; 55 Preferences.canInspectWorkers = true; 55 56 })(); 56 57
Note: See TracChangeset
for help on using the changeset viewer.