Bug 1464461 - Make dispatchMessagesAdd use batching; r=nchevobbe a=ritu
authoryulia <ystartsev@mozilla.com>
Thu, 28 Jun 2018 12:00:55 +0200
changeset 480700 f7804a5125040903dc4832b5629974f8affaa3eb
parent 480699 ba2081206f9fb2c6e1b3f59f09e899b105702cf6
child 480701 3f296e84fdc6680d002bb8a845b716a0c5e6797b
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnchevobbe, ritu
bugs1464461
milestone62.0
Bug 1464461 - Make dispatchMessagesAdd use batching; r=nchevobbe a=ritu 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
@@ -245,22 +245,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 = [];
@@ -357,21 +357,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() {