Bug 923600 - don't pretty print RDP packets when devtools.debugger.log is false; r=robcee

This commit is contained in:
Nick Fitzgerald 2013-10-06 11:45:07 -07:00
Родитель 681cf82bdb
Коммит 9d1738c70b
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -7,6 +7,8 @@
"use strict";
Components.utils.import("resource://gre/modules/NetUtil.jsm");
let wantLogging = Services.prefs.getBoolPref("devtools.debugger.log");
/**
* An adapter that handles data transfers between the debugger client and
* server. It can work with both nsIPipe and nsIServerSocket transports so
@ -66,8 +68,9 @@ DebuggerTransport.prototype = {
* they are passed to this method.
*/
send: function DT_send(aPacket) {
// TODO (bug 709088): remove pretty printing when the protocol is done.
let data = JSON.stringify(aPacket, null, 2);
let data = wantLogging
? JSON.stringify(aPacket, null, 2)
: JSON.stringify(aPacket);
data = this._converter.ConvertFromUnicode(data);
data = data.length + ':' + data;
this._outgoing += data;