зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1686723 - [devtools] Remove unused network throttling code from RDM client code. r=bomsy,devtools-backward-compat-reviewers.
Now that network resources are enabled on the server, RDM is using the network actor to control network throttling. We can remove all the RDM client code that was still trying to call the responsive actor. We can't remove the methods from the ResponsiveActor yet though, since the Netmonitor will use it when there's no network resource server side support, which is still the case for the Browser Toolbox. Differential Revision: https://phabricator.services.mozilla.com/D102766
This commit is contained in:
Родитель
94f2937a1d
Коммит
36456c9b0e
|
@ -37,11 +37,7 @@ function testNetworkThrottlingSelectorLabel(ui, expected) {
|
|||
}
|
||||
|
||||
var testNetworkThrottlingState = async function(ui, expected) {
|
||||
const front =
|
||||
ui.hasResourceWatcherSupport && ui.networkFront
|
||||
? ui.networkFront
|
||||
: ui.responsiveFront;
|
||||
const state = await front.getNetworkThrottling();
|
||||
const state = await ui.networkFront.getNetworkThrottling();
|
||||
Assert.deepEqual(
|
||||
state,
|
||||
expected,
|
||||
|
|
|
@ -123,12 +123,6 @@ class ResponsiveUI {
|
|||
return this.resourceWatcher.watcherFront;
|
||||
}
|
||||
|
||||
get hasResourceWatcherSupport() {
|
||||
return this.resourceWatcher.hasResourceWatcherSupport(
|
||||
this.resourceWatcher.TYPES.NETWORK_EVENT
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Open RDM while preserving the state of the page.
|
||||
*/
|
||||
|
@ -415,9 +409,7 @@ class ResponsiveUI {
|
|||
{ onAvailable: this.onNetworkResourceAvailable }
|
||||
);
|
||||
|
||||
if (this.hasResourceWatcherSupport) {
|
||||
this.networkFront = await this.watcherFront.getNetworkParentActor();
|
||||
}
|
||||
this.networkFront = await this.watcherFront.getNetworkParentActor();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -851,18 +843,13 @@ class ResponsiveUI {
|
|||
* (This is always immediate, so it's always false.)
|
||||
*/
|
||||
async updateNetworkThrottling(enabled, profile) {
|
||||
const throttlingFront =
|
||||
this.hasResourceWatcherSupport && this.networkFront
|
||||
? this.networkFront
|
||||
: this.responsiveFront;
|
||||
|
||||
if (!enabled) {
|
||||
await throttlingFront.clearNetworkThrottling();
|
||||
await this.networkFront.clearNetworkThrottling();
|
||||
return false;
|
||||
}
|
||||
const data = throttlingProfiles.find(({ id }) => id == profile);
|
||||
const { download, upload, latency } = data;
|
||||
await throttlingFront.setNetworkThrottling({
|
||||
await this.networkFront.setNetworkThrottling({
|
||||
downloadThroughput: download,
|
||||
uploadThroughput: upload,
|
||||
latency,
|
||||
|
|
Загрузка…
Ссылка в новой задаче