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 b038165b89ebedb77f30f62e16f3409bec716881..f3a91417f68c5ed57a954f58d7eafead6c55e625 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/devtools.js |
+++ b/third_party/WebKit/Source/devtools/front_end/devtools.js |
@@ -303,10 +303,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 ""; |
+ } |
} |
} |