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

Unified Diff: third_party/WebKit/Source/devtools/front_end/devtools.js

Issue 2039013002: [DevTools] Fix problem with loading source maps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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 | « chrome/browser/devtools/devtools_ui_bindings.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/devtools.js
diff --git a/third_party/WebKit/Source/devtools/front_end/devtools.js b/third_party/WebKit/Source/devtools/front_end/devtools.js
index f9c05b2c74478b1c71c0139a5673d6f89bfff5f5..1e8c833e8a0ae576bb846e5f67470e8741ef818c 100644
--- a/third_party/WebKit/Source/devtools/front_end/devtools.js
+++ b/third_party/WebKit/Source/devtools/front_end/devtools.js
@@ -302,10 +302,28 @@ DevToolsAPIImpl.prototype = {
/**
* @param {number} id
* @param {string} chunk
+ * @param {boolean} encoded
*/
- streamWrite: function(id, chunk)
+ streamWrite: function(id, chunk, encoded)
{
- this._dispatchOnInspectorFrontendAPI("streamWrite", [id, chunk]);
+ this._dispatchOnInspectorFrontendAPI("streamWrite", [id, encoded ? this._decodeBase64(chunk) : chunk]);
+ },
+
+ /**
+ * @param {string} chunk
+ * @return {string}
+ */
+ _decodeBase64: function(chunk)
+ {
+ var request = new XMLHttpRequest();
+ request.open("GET", "data:text/plain;base64," + chunk, false);
+ request.send(null);
+ if (request.status === 200) {
+ return request.responseText;
+ } else {
+ console.error("Error while decoding chunk in streamWrite");
+ return "";
+ }
}
}
« no previous file with comments | « chrome/browser/devtools/devtools_ui_bindings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698