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

Unified Diff: Source/WebCore/inspector/front-end/Resource.js

Issue 10911336: Merge 127902 - Web Inspector: [REGRESSION] Content is not available for dynamically loaded script s… (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/http/tests/inspector/resources-test.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/inspector/front-end/Resource.js
===================================================================
--- Source/WebCore/inspector/front-end/Resource.js (revision 128734)
+++ Source/WebCore/inspector/front-end/Resource.js (working copy)
@@ -311,13 +311,12 @@
this._contentRequested = true;
/**
- * @param {?Protocol.Error} error
* @param {string} content
* @param {boolean} contentEncoded
*/
- function callback(error, content, contentEncoded)
+ function contentLoaded(content, contentEncoded)
{
- this._content = error ? null : content;
+ this._content = content;
this._contentEncoded = contentEncoded;
var callbacks = this._pendingContentCallbacks.slice();
for (var i = 0; i < callbacks.length; ++i)
@@ -325,7 +324,34 @@
this._pendingContentCallbacks.length = 0;
delete this._contentRequested;
}
- PageAgent.getResourceContent(this.frameId, this.url, callback.bind(this));
+
+ /**
+ * @param {?Protocol.Error} error
+ * @param {string} content
+ * @param {boolean} contentEncoded
+ */
+ function resourceContentLoaded(error, content, contentEncoded)
+ {
+ if (error)
+ console.error("Resource content request failed: " + error);
+ contentLoaded.call(this, error ? null : content, contentEncoded);
+ }
+
+ if (this.request) {
+ /**
+ * @param {string} content
+ * @param {boolean} contentEncoded
+ * @param {string} mimeType
+ */
+ function requestContentLoaded(content, contentEncoded, mimeType)
+ {
+ contentLoaded.call(this, content, contentEncoded);
+ }
+
+ this.request.requestContent(requestContentLoaded.bind(this));
+ return;
+ }
+ PageAgent.getResourceContent(this.frameId, this.url, resourceContentLoaded.bind(this));
},
/**
« no previous file with comments | « LayoutTests/http/tests/inspector/resources-test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698