Bug 1370171 - Remove sdk/core/heritage from Netmonitor; r=rickychien draft
authorJan Odvarko <odvarko@gmail.com>
Mon, 05 Jun 2017 12:16:11 +0200
changeset 588974 41d0084f27f1afc591c7e330fbda7a8da210b622
parent 588783 8a3aa1701537ea6b8334f432cd030d260d492fa3
child 631725 7dc31e2af73865d7002122b73162175ad4773623
push id62204
push userjodvarko@mozilla.com
push dateMon, 05 Jun 2017 10:17:19 +0000
reviewersrickychien
bugs1370171
milestone55.0a1
Bug 1370171 - Remove sdk/core/heritage from Netmonitor; r=rickychien MozReview-Commit-ID: H4Dj0As4eiY
devtools/client/netmonitor/src/har/har-automation.js
--- a/devtools/client/netmonitor/src/har/har-automation.js
+++ b/devtools/client/netmonitor/src/har/har-automation.js
@@ -2,17 +2,16 @@
  * 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/. */
 
 /* eslint-disable mozilla/reject-some-requires */
 
 "use strict";
 
 const { Ci } = require("chrome");
-const { Class } = require("sdk/core/heritage");
 const Services = require("Services");
 
 loader.lazyRequireGetter(this, "HarCollector", "devtools/client/netmonitor/har/har-collector", true);
 loader.lazyRequireGetter(this, "HarExporter", "devtools/client/netmonitor/har/har-exporter", true);
 loader.lazyRequireGetter(this, "HarUtils", "devtools/client/netmonitor/har/har-utils", true);
 
 const prefDomain = "devtools.netmonitor.har.";
 
@@ -31,17 +30,21 @@ const trace = {
  * auto-export work: devtools.netmonitor.har.enableAutoExportToFile
  *
  * HAR files are stored within directory that is specified in this
  * preference: devtools.netmonitor.har.defaultLogDir
  *
  * If the default log directory preference isn't set the following
  * directory is used by default: <profile>/har/logs
  */
-var HarAutomation = Class({
+function HarAutomation(toolbox) {
+  this.initialize(toolbox);
+}
+
+HarAutomation.prototype = {
   // Initialization
 
   initialize: function (toolbox) {
     this.toolbox = toolbox;
 
     let target = toolbox.target;
     target.makeRemote().then(() => {
       this.startMonitoring(target.client, target.form);
@@ -196,17 +199,17 @@ var HarAutomation = Class({
   },
 
   /**
    * Fetches the full text of a string.
    */
   getString: function (stringGrip) {
     return this.webConsoleClient.getString(stringGrip);
   },
-});
+};
 
 // Helpers
 
 function TabWatcher(toolbox, listener) {
   this.target = toolbox.target;
   this.listener = listener;
 
   this.onTabNavigated = this.onTabNavigated.bind(this);