Bug 1357486: Part 0d - Propagate clonable console message args to the parent process. r?aswan
MozReview-Commit-ID: Bkecqr7hRvx
--- a/toolkit/components/processsingleton/ContentProcessSingleton.js
+++ b/toolkit/components/processsingleton/ContentProcessSingleton.js
@@ -74,17 +74,21 @@ ContentProcessSingleton.prototype = {
// When the sum of argument sizes reaches MSG_MGR_CONSOLE_MAX_SIZE,
// replace all arguments with "<truncated>".
let totalArgLength = 0;
// Walk through the arguments, checking the type and size.
for (let arg of consoleMsg.arguments) {
if ((typeof arg == "object" || typeof arg == "function") &&
arg !== null) {
- arg = unavailString;
+ try {
+ arg = Cu.cloneInto(arg, {});
+ } catch (e) {
+ arg = unavailString;
+ }
totalArgLength += unavailStringLength;
} else if (typeof arg == "string") {
totalArgLength += arg.length * 2; // 2-bytes per char
} else {
totalArgLength += MSG_MGR_CONSOLE_VAR_SIZE;
}
if (totalArgLength <= MSG_MGR_CONSOLE_MAX_SIZE) {