Bug 1464461 - make dispatchMessagesAdd use batching; r=nchevobbe
☠☠ backed out by cf26f1c33da6 ☠ ☠
authoryulia <ystartsev@mozilla.com>
Thu, 28 Jun 2018 12:00:55 +0200
changeset 424805 50f7f633bb7d
parent 424804 6c9488ed5ebd
child 424806 014fa1322e94
push id65854
push userystartsev@mozilla.com
push dateTue, 03 Jul 2018 11:46:45 +0000
treeherderautoland@001370fe21e3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnchevobbe
bugs1464461
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1464461 - make dispatchMessagesAdd use batching; r=nchevobbe MozReview-Commit-ID: 7sCFIfC2ovi
devtools/client/webconsole/webconsole-output-wrapper.js
--- a/devtools/client/webconsole/webconsole-output-wrapper.js
+++ b/devtools/client/webconsole/webconsole-output-wrapper.js
@@ -256,22 +256,22 @@ WebConsoleOutputWrapper.prototype = {
             }
           }
         }.bind(this));
       });
     } else {
       promise = Promise.resolve();
     }
 
-    this.batchedMessagesAdd(packet);
+    this.batchedMessageAdd(packet);
     return promise;
   },
 
   dispatchMessagesAdd: function(messages) {
-    store.dispatch(actions.messagesAdd(messages));
+    this.batchedMessagesAdd(messages);
   },
 
   dispatchMessagesClear: function() {
     // We might still have pending message additions and updates when the clear action is
     // triggered, so we need to flush them to make sure we don't have unexpected behavior
     // in the ConsoleOutput.
     this.queuedMessageAdds = [];
     this.queuedMessageUpdates = [];
@@ -368,21 +368,26 @@ WebConsoleOutputWrapper.prototype = {
     this.setTimeoutIfNeeded();
   },
 
   batchedRequestUpdates: function(message) {
     this.queuedRequestUpdates.push(message);
     this.setTimeoutIfNeeded();
   },
 
-  batchedMessagesAdd: function(message) {
+  batchedMessageAdd: function(message) {
     this.queuedMessageAdds.push(message);
     this.setTimeoutIfNeeded();
   },
 
+  batchedMessagesAdd: function(messages) {
+    this.queuedMessageAdds = this.queuedMessageAdds.concat(messages);
+    this.setTimeoutIfNeeded();
+  },
+
   dispatchClearHistory: function() {
     store.dispatch(actions.clearHistory());
   },
 
   /**
    * Returns a Promise that resolves once any async dispatch is finally dispatched.
    */
   waitAsyncDispatches: function() {