Bug 1370171 - Remove sdk/core/heritage from Netmonitor; r=rickychien
MozReview-Commit-ID: H4Dj0As4eiY
--- 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);