Bug 1488376 - Use target.getFront to instantiate ReflowFront; r=ochameau
authoryulia <ystartsev@mozilla.com>
Tue, 09 Oct 2018 10:01:19 +0000
changeset 495887 1ddd5aa749b44eb18599b4a304fefef780889f85
parent 495886 e4bdaf04bcb7ab6bff9403fa5959bc91e941b4c2
child 495888 cd094f46a5eb09e6bc26d24be244c7177b6ccd8f
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1488376
milestone64.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 1488376 - Use target.getFront to instantiate ReflowFront; r=ochameau Differential Revision: https://phabricator.services.mozilla.com/D7888
devtools/client/inspector/shared/reflow-tracker.js
--- a/devtools/client/inspector/shared/reflow-tracker.js
+++ b/devtools/client/inspector/shared/reflow-tracker.js
@@ -1,18 +1,16 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-const { ReflowFront } = require("devtools/shared/fronts/reflow");
-
 /**
  * Simple utility class that listens to reflows on a given target if and only if a
  * listener is actively listening to reflows.
  *
  * @param {Object} target
  *        The current target (as in toolbox target)
  */
 function ReflowTracker(target) {
@@ -22,32 +20,30 @@ function ReflowTracker(target) {
   this.listeners = new Map();
 
   this.reflowFront = null;
 
   this.onReflow = this.onReflow.bind(this);
 }
 
 ReflowTracker.prototype = {
-
   destroy() {
     if (this.reflowFront) {
       this.stopTracking();
       this.reflowFront.destroy();
       this.reflowFront = null;
     }
 
     this.listeners.clear();
   },
 
   startTracking() {
     // Initialize reflow front if necessary.
     if (!this.reflowFront && this.target.form.reflowActor) {
-      const { client, form } = this.target;
-      this.reflowFront = ReflowFront(client, form);
+      this.reflowFront = this.target.getFront("reflow");
     }
 
     if (this.reflowFront) {
       this.reflowFront.on("reflows", this.onReflow);
       this.reflowFront.start();
     }
   },