Web Inspector: SourceCode.requestContent should return a promise
authorjonowells@apple.com <jonowells@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Dec 2014 15:31:16 +0000 (15:31 +0000)
committerjonowells@apple.com <jonowells@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Dec 2014 15:31:16 +0000 (15:31 +0000)
commitd66075500dcd46d398a6b3aa475f0947d5a533cb
treee5138487b1042cd94b4d22bb77e07365ccfe90f3
parent6a5d90c968782e2196a1f576a19f74ae9a50e0da
Web Inspector: SourceCode.requestContent should return a promise
https://bugs.webkit.org/show_bug.cgi?id=135777

Reviewed by Brian Burg.

Change SourceCode.js to request content from the backend using Promises. Change Resource.js to use this new
approach when determining whether a resource load has finished. Change all calls to the older
SourceCode#requestContentFromBackendIfNeeded to simply use requestContent and use a catch function
if a content request error needs to be handled. Fix a bug where the appropriate error message for an
invalid resource wasn't showing in the resource content view.

* UserInterface/Controllers/AnalyzerManager.js:
(set WebInspector.AnalyzerManager.prototype.getAnalyzerMessagesForSourceCode.):
(set WebInspector.AnalyzerManager.prototype.getAnalyzerMessagesForSourceCode):
* UserInterface/Controllers/CSSStyleManager.js:
(WebInspector.CSSStyleManager.prototype._updateResourceContent.fetchedStyleSheetContent):
(WebInspector.CSSStyleManager.prototype._updateResourceContent.styleSheetReady):
* UserInterface/Models/CSSStyleSheet.js:
(WebInspector.CSSStyleSheet.prototype.requestContentFromBackend):
(WebInspector.CSSStyleSheet.prototype.canRequestContentFromBackend): Deleted.
* UserInterface/Models/DOMNodeStyles.js:
(WebInspector.DOMNodeStyles.prototype.changeStyleText):
* UserInterface/Models/Resource.js:
(WebInspector.Resource.prototype.canRequestContent):
(WebInspector.Resource.prototype.requestContentFromBackend):
(WebInspector.Resource.prototype.markAsFinished):
(WebInspector.Resource.prototype.markAsFailed):
(WebInspector.Resource.prototype.getImageSize):
(WebInspector.Resource.prototype.canRequestContentFromBackend): Deleted.
* UserInterface/Models/Script.js:
(WebInspector.Script.prototype.requestContentFromBackend):
(WebInspector.Script.prototype.requestScriptSyntaxTree.catch):
(WebInspector.Script.prototype.canRequestContentFromBackend): Deleted.
* UserInterface/Models/SourceCode.js:
(WebInspector.SourceCode):
(WebInspector.SourceCode.prototype.requestContent):
(WebInspector.SourceCode.prototype.requestContentFromBackend):
(WebInspector.SourceCode.prototype._processContent):
(WebInspector.SourceCode.prototype.canRequestContentFromBackend): Deleted.
(WebInspector.SourceCode.prototype.requestContentFromBackendIfNeeded): Deleted.
(WebInspector.SourceCode.prototype.servicePendingContentRequests): Deleted.
* UserInterface/Models/SourceMapResource.js:
(WebInspector.SourceMapResource):
(WebInspector.SourceMapResource.prototype.requestContentFromBackend.sourceMapResourceLoadError):
(WebInspector.SourceMapResource.prototype.requestContentFromBackend):
(WebInspector.SourceMapResource.prototype.canRequestContentFromBackend): Deleted.
(WebInspector.SourceMapResource.prototype.requestContentFromBackend.sourceMapResourceLoaded): Deleted.
* UserInterface/Views/ResourceContentView.js:
(WebInspector.ResourceContentView):
(WebInspector.ResourceContentView.prototype._contentAvailable):
(WebInspector.ResourceContentView.prototype._contentError):
* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor):
(WebInspector.SourceCodeTextEditor.prototype._contentAvailable):
(WebInspector.SourceCodeTextEditor.prototype._populateWithInlineScriptContent.scriptContentAvailable):
(WebInspector.SourceCodeTextEditor.prototype._populateWithInlineScriptContent):
(WebInspector.SourceCodeTextEditor.prototype._populateWithScriptContent):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/AnalyzerManager.js
Source/WebInspectorUI/UserInterface/Controllers/CSSStyleManager.js
Source/WebInspectorUI/UserInterface/Models/CSSStyleSheet.js
Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js
Source/WebInspectorUI/UserInterface/Models/Resource.js
Source/WebInspectorUI/UserInterface/Models/Script.js
Source/WebInspectorUI/UserInterface/Models/SourceCode.js
Source/WebInspectorUI/UserInterface/Models/SourceMapResource.js
Source/WebInspectorUI/UserInterface/Views/ResourceContentView.js
Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js