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 ""; |
+ } |
} |
} |