Files
palemoon27/devtools/client/netmonitor/panel.js
T
roytam1 7f9fb739f6 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1166365 - Pluralize dropdown logic. r=Gijs,Margaret (d99325586b)
- Bug 1234833 - Fix handling of some PostData parameters. r=vporof (bf45f32ba4)
- Bug 1186498 - Let the "cached" of transferredSize can be localized. r=jsantell (0abb05e279)
- bug 1158264 - Flag requests coming from service workers. r=vporof (3650f04b89)
- Bug 1240876 - Don't wait for load to enable "Copy as cURL" command [r=vporof] (7ceaf15b2c)
- Bug 1240959 - Properly calculate total size. r=vporof (67e5bf1cd9)
- Bug 1223037 - Move the network monitor toolbar to the top. r=vporof (ce0606d60e)
- Bug 1244725: DevTools: Show text of a HTTP response for video live streaming content types r=Honza (1a2fb93642)
- Bug 1219771 - allow SVG images to be copied as a data: URI; r=vporof (51cf954fb6)
- Bug 1222583 - Negative url filtering for network monitor. r=vporof (c26e255a12)
- minor revert (16f475356c)
- Bug 1194561 - Change globe to broken lock for insecure resources r=jryans (6766dc0f6d)
- Bug 1252807 - Fix eslint warnings in the Net panel. r=pbro (e77dd377c1)
- Bug 1252346 - Some DevTools files missing Services. r=ochameau (7619d52bef)
- Bug 1252807 - Fix eslint warnings in the Net panel. r=pbro (f913ffcbe5)
- Bug 1235699 - Increase the timeout of browser_animation_toggle_button_resets_on_navigate.js (01e4ad0ce7)
- Bug 1181839 - Include inspector/test/head.js (which imports shared-head.js) in animationinspector's tests and removes code duplication. r=pbro (d855de2b1e)
- Bug 1258305 - Update all occurences of ViewHelpers.L10N and MultiL10N to use the new module, r=jsantell (b080a336c9)
- Bug 1412825 - fix lz4 deprecated attribute with clang and c++14; r=RyanVM (059d86484b)
- Bug 1245886 - Refactor performance tests, r=jsantell (8d01a6a376)
- Bug 1258302 - Create a categories module instead of placing everything in global.js, r=jsantell (5e75d47255)
- Bug 1258309 - Update all occurences of ViewHelpers.Prefs to use the new module, r=jsantell (d28803cb1c)
- fix some 1245886 fallout (366156f165)
2024-05-14 22:16:06 +08:00

71 lines
1.8 KiB
JavaScript

/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript 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 promise = require("promise");
const EventEmitter = require("devtools/shared/event-emitter");
function NetMonitorPanel(iframeWindow, toolbox) {
this.panelWin = iframeWindow;
this._toolbox = toolbox;
this._view = this.panelWin.NetMonitorView;
this._controller = this.panelWin.NetMonitorController;
this._controller._target = this.target;
EventEmitter.decorate(this);
}
exports.NetMonitorPanel = NetMonitorPanel;
NetMonitorPanel.prototype = {
/**
* Open is effectively an asynchronous constructor.
*
* @return object
* A promise that is resolved when the NetMonitor completes opening.
*/
open: Task.async(function*() {
if (this._opening) {
return this._opening;
}
let deferred = promise.defer();
this._opening = deferred.promise;
// Local monitoring needs to make the target remote.
if (!this.target.isRemote) {
yield this.target.makeRemote();
}
yield this._controller.startupNetMonitor();
this.isReady = true;
this.emit("ready");
deferred.resolve(this);
return this._opening;
}),
// DevToolPanel API
get target() {
return this._toolbox.target;
},
destroy: Task.async(function*() {
if (this._destroying) {
return this._destroying;
}
let deferred = promise.defer();
this._destroying = deferred.promise;
yield this._controller.shutdownNetMonitor();
this.emit("destroyed");
deferred.resolve();
return this._destroying;
})
};