Changeset 60965 in webkit
- Timestamp:
- Jun 10, 2010 10:59:59 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r60964 r60965 1 2010-06-10 Yury Semikhatsky <yurys@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: to reduce the front end start up time don't push script 6 sources to frontend if debugger is always enabled, instead request 7 script content lazily at the moment it should be displyed. It is critical for 8 always enabled debugger because in that case lots of script may have 9 already been parsed when the front end is opening and pushing all 10 of them at once may slow things down(even though the script sources will never 11 be used if scripts panel isn't open). 12 https://bugs.webkit.org/show_bug.cgi?id=40364 13 14 * inspector/InspectorBackend.cpp: 15 (WebCore::InspectorBackend::getScriptSource): 16 * inspector/InspectorBackend.h: 17 * inspector/InspectorBackend.idl: 18 * inspector/InspectorController.cpp: 19 (WebCore::InspectorController::didCommitLoad): 20 (WebCore::InspectorController::getScriptSource): 21 (WebCore::InspectorController::didParseSource): 22 * inspector/InspectorController.h: 23 * inspector/InspectorFrontend.cpp: 24 (WebCore::InspectorFrontend::didGetScriptSource): 25 * inspector/InspectorFrontend.h: 26 * inspector/front-end/InspectorBackendStub.js: 27 (.WebInspector.InspectorBackendStub.prototype.editScriptSource): 28 (.WebInspector.InspectorBackendStub.prototype.getScriptSource): 29 * inspector/front-end/ScriptView.js: 30 (WebInspector.ScriptView.prototype.setupSourceFrameIfNeeded): 31 (WebInspector.ScriptView.prototype._didGetScriptSource): 32 (WebInspector.ScriptView.prototype._sourceFrameSetupFinished): 33 1 34 2010-06-10 Adam Barth <abarth@webkit.org> 2 35 -
trunk/WebCore/inspector/InspectorBackend.cpp
r60843 r60965 222 222 } 223 223 224 void InspectorBackend::getScriptSource(long callId, const String& sourceID) 225 { 226 if (m_inspectorController) 227 m_inspectorController->getScriptSource(callId, sourceID); 228 } 229 224 230 void InspectorBackend::enableProfiler(bool always) 225 231 { -
trunk/WebCore/inspector/InspectorBackend.h
r60843 r60965 92 92 93 93 void editScriptSource(long callId, const String& sourceID, const String& newContent); 94 void getScriptSource(long callId, const String& sourceID); 94 95 95 96 void enableProfiler(bool always); -
trunk/WebCore/inspector/InspectorBackend.idl
r60843 r60965 67 67 68 68 void editScriptSource(in long callId, in DOMString sourceID, in DOMString newContent); 69 void getScriptSource(in long callId, in DOMString sourceID); 69 70 70 71 void enableProfiler(in boolean always); -
trunk/WebCore/inspector/InspectorController.cpp
r60895 r60965 668 668 #if ENABLE(JAVASCRIPT_DEBUGGER) 669 669 m_sourceIDToURL.clear(); 670 m_scriptIDToContent.clear(); 670 671 #endif 671 672 #if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC) … … 1634 1635 } 1635 1636 1637 void InspectorController::getScriptSource(long callId, const String& sourceID) 1638 { 1639 if (!m_frontend) 1640 return; 1641 String scriptSource = m_scriptIDToContent.get(sourceID); 1642 m_frontend->didGetScriptSource(callId, scriptSource); 1643 } 1644 1636 1645 void InspectorController::resumeDebugger() 1637 1646 { … … 1684 1693 void InspectorController::didParseSource(const String& sourceID, const String& url, const String& data, int firstLine, ScriptWorldType worldType) 1685 1694 { 1686 m_frontend->parsedScriptSource(sourceID, url, data, firstLine, worldType); 1695 // Don't send script content to the front end until it's realy needed. 1696 m_frontend->parsedScriptSource(sourceID, url, "", firstLine, worldType); 1687 1697 1688 1698 if (url.isEmpty()) … … 1700 1710 1701 1711 m_sourceIDToURL.set(sourceID, url); 1712 m_scriptIDToContent.set(sourceID, data); 1702 1713 } 1703 1714 -
trunk/WebCore/inspector/InspectorController.h
r60895 r60965 243 243 244 244 void editScriptSource(long callId, const String& sourceID, const String& newContent); 245 void getScriptSource(long callId, const String& sourceID); 245 246 246 247 void resumeDebugger(); … … 362 363 ScriptState* m_pausedScriptState; 363 364 HashMap<String, String> m_sourceIDToURL; 365 HashMap<String, String> m_scriptIDToContent; 364 366 HashMap<String, SourceBreakpoints> m_stickyBreakpoints; 365 367 -
trunk/WebCore/inspector/InspectorFrontend.cpp
r60895 r60965 371 371 } 372 372 373 void InspectorFrontend::didGetScriptSource(long callId, const String& result) 374 { 375 ScriptFunctionCall function(m_webInspector, "dispatch"); 376 function.appendArgument("didGetScriptSource"); 377 function.appendArgument(callId); 378 function.appendArgument(result); 379 function.call(); 380 } 381 373 382 void InspectorFrontend::profilerWasEnabled() 374 383 { -
trunk/WebCore/inspector/InspectorFrontend.h
r60895 r60965 100 100 101 101 void didEditScriptSource(long callId, bool success, const String& result, SerializedScriptValue* newCallFrames); 102 void didGetScriptSource(long callId, const String& result); 102 103 103 104 void profilerWasEnabled(); -
trunk/WebCore/inspector/front-end/InspectorBackendStub.js
r57505 r60965 186 186 }, 187 187 188 editScriptSource: function() 189 { 190 WebInspector.didEditScriptSource(callId, false); 191 }, 192 193 getScriptSource: function(callId, sourceID) 194 { 195 WebInspector.didGetScriptSource(callId, null); 196 }, 197 188 198 resumeDebugger: function() 189 199 { -
trunk/WebCore/inspector/front-end/ScriptView.js
r60567 r60965 51 51 if (!this._frameNeedsSetup) 52 52 return; 53 delete this._frameNeedsSetup; 53 54 54 55 this.attach(); 55 56 57 if (this.script.source) 58 this._sourceFrameSetupFinished(); 59 else { 60 var callbackId = WebInspector.Callback.wrap(this._didGetScriptSource.bind(this)) 61 InspectorBackend.getScriptSource(callbackId, this.script.sourceID); 62 } 63 }, 64 65 _didGetScriptSource: function(source) 66 { 67 this.script.source = source || WebInspector.UIString("<source is not available>"); 68 this._sourceFrameSetupFinished(); 69 }, 70 71 _sourceFrameSetupFinished: function() 72 { 56 73 this.sourceFrame.setContent("text/javascript", this._prependWhitespace(this.script.source)); 57 74 this._sourceFrameSetup = true; 58 delete this._frameNeedsSetup;59 75 }, 60 76 … … 107 123 showingLastSearchResult: WebInspector.SourceView.prototype.showingLastSearchResult, 108 124 _jumpToSearchResult: WebInspector.SourceView.prototype._jumpToSearchResult, 109 _sourceFrameSetupFinished: WebInspector.SourceView.prototype._sourceFrameSetupFinished,110 125 _removeBreakpoint: WebInspector.SourceView.prototype._removeBreakpoint, 111 126 _editLine: WebInspector.SourceView.prototype._editLine, … … 114 129 115 130 WebInspector.ScriptView.prototype.__proto__ = WebInspector.View.prototype; 131 132 WebInspector.didGetScriptSource = WebInspector.Callback.processCallback; -
trunk/WebKit/chromium/ChangeLog
r60955 r60965 1 2010-06-10 Yury Semikhatsky <yurys@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: to reduce the front end start up time don't push script 6 sources to frontend if debugger is always enabled, instead request 7 script content lazily at the moment it should be displyed. It is critical for 8 always enabled debugger because in that case lots of script may have 9 already been parsed when the front end is opening and pushing all 10 of them at once may slow things down(even though the script sources will never 11 be used if scripts panel isn't open). 12 https://bugs.webkit.org/show_bug.cgi?id=40364 13 14 * src/js/DevTools.js: 15 * src/js/InspectorControllerImpl.js: 16 (devtools.InspectorBackendImpl): 17 (.devtools.InspectorBackendImpl.prototype.getScriptSource): 18 1 19 2010-06-10 Mike Belshe <mbelshe@google.com> 2 20 -
trunk/WebKit/chromium/src/js/DevTools.js
r60893 r60965 211 211 if (!window.v8ScriptDebugServerEnabled) { 212 212 213 /**214 * This override is necessary for adding script source asynchronously.215 * @override216 */217 WebInspector.ScriptView.prototype.setupSourceFrameIfNeeded = function()218 {219 if (!this._frameNeedsSetup)220 return;221 222 this.attach();223 224 if (this.script.source)225 this.didResolveScriptSource_();226 else {227 var self = this;228 devtools.tools.getDebuggerAgent().resolveScriptSource(229 this.script.sourceID,230 function(source) {231 self.script.source = source || WebInspector.UIString("<source is not available>");232 self.didResolveScriptSource_();233 });234 }235 };236 237 238 /**239 * Performs source frame setup when script source is aready resolved.240 */241 WebInspector.ScriptView.prototype.didResolveScriptSource_ = function()242 {243 this.sourceFrame.setContent("text/javascript", this._prependWhitespace(this.script.source));244 this._sourceFrameSetup = true;245 delete this._frameNeedsSetup;246 };247 248 249 213 (function() 250 214 { -
trunk/WebKit/chromium/src/js/InspectorControllerImpl.js
r60886 r60965 95 95 this.installInspectorControllerDelegate_("disableDebugger"); 96 96 this.installInspectorControllerDelegate_("editScriptSource"); 97 this.installInspectorControllerDelegate_("getScriptSource"); 97 98 this.installInspectorControllerDelegate_("enableDebugger"); 98 99 this.installInspectorControllerDelegate_("setBreakpoint"); … … 151 152 152 153 154 devtools.InspectorBackendImpl.prototype.getScriptSource = function(callID, sourceID) 155 { 156 devtools.tools.getDebuggerAgent().resolveScriptSource( 157 sourceID, 158 function(source) { 159 WebInspector.didGetScriptSource(callID, source); 160 }); 161 }; 162 163 153 164 devtools.InspectorBackendImpl.prototype.activateBreakpoints = function() 154 165 {
Note: See TracChangeset
for help on using the changeset viewer.