Bug 1141618 - Disable reader worker logging by default. r=Mossop a=readinglist
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Tue, 10 Mar 2015 13:01:10 -0700
changeset 248419 569f5001706570cc73b0aba67d05092175ecc552
parent 248418 bf9ea14440703f1d1560f4398d7ee0c95b358845
child 248420 b18bdcfaba790d7f8261306bcf9d16fb97411a5c
push id7837
push userjwein@mozilla.com
push dateFri, 27 Mar 2015 00:27:16 +0000
treeherdermozilla-aurora@cb0db44ce60e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMossop, readinglist
bugs1141618
milestone38.0a2
Bug 1141618 - Disable reader worker logging by default. r=Mossop a=readinglist
toolkit/components/reader/ReaderWorker.js
--- a/toolkit/components/reader/ReaderWorker.js
+++ b/toolkit/components/reader/ReaderWorker.js
@@ -4,33 +4,37 @@
 
 "use strict";
 
 /**
  * A worker dedicated to handle parsing documents for reader view.
  */
 
 importScripts("resource://gre/modules/workers/require.js",
-	          "resource://gre/modules/reader/JSDOMParser.js",
-	          "resource://gre/modules/reader/Readability.js");
+              "resource://gre/modules/reader/JSDOMParser.js",
+              "resource://gre/modules/reader/Readability.js");
 
 let PromiseWorker = require("resource://gre/modules/workers/PromiseWorker.js");
 
+const DEBUG = false;
+
 let worker = new PromiseWorker.AbstractWorker();
 worker.dispatch = function(method, args = []) {
   return Agent[method](...args);
 };
 worker.postMessage = function(result, ...transfers) {
   self.postMessage(result, ...transfers);
 };
 worker.close = function() {
   self.close();
 };
 worker.log = function(...args) {
-  dump("ReaderWorker: " + args.join(" ") + "\n");
+  if (DEBUG) {
+    dump("ReaderWorker: " + args.join(" ") + "\n");
+  }
 };
 
 self.addEventListener("message", msg => worker.handleMessage(msg));
 
 let Agent = {
   /**
    * Parses structured article data from a document.
    *