Skip to content

Commit bb82faf

Browse files
pfaffeDevtools-frontend LUCI CQ
authored andcommitted
[throttling] Eagerly update network conditions on request to show indicators early
Bug: 40434685 Change-Id: I9bfb22744f4eb7920190f72ba422264adee51ba9 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/7157021 Auto-Submit: Philip Pfaffe <[email protected]> Reviewed-by: Eric Leese <[email protected]> Commit-Queue: Eric Leese <[email protected]>
1 parent 5facf58 commit bb82faf

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

front_end/core/sdk/NetworkManager.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,12 @@ export class NetworkDispatcher implements ProtocolProxyApi.NetworkDispatcher {
10351035
appliedNetworkConditionsId,
10361036
};
10371037
this.getExtraInfoBuilder(requestId).addRequestExtraInfo(extraRequestInfo);
1038+
1039+
const networkRequest = this.#requestsById.get(requestId);
1040+
if (appliedNetworkConditionsId && networkRequest) {
1041+
networkRequest.setAppliedNetworkConditions(appliedNetworkConditionsId);
1042+
this.updateNetworkRequest(networkRequest);
1043+
}
10381044
}
10391045

10401046
responseReceivedEarlyHints({

front_end/core/sdk/NetworkRequest.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,6 +1629,10 @@ export class NetworkRequest extends Common.ObjectWrapper.ObjectWrapper<EventType
16291629
);
16301630
}
16311631

1632+
setAppliedNetworkConditions(appliedNetworkConditionsId: string): void {
1633+
this.#appliedNetworkConditionsId = appliedNetworkConditionsId;
1634+
}
1635+
16321636
hasExtraRequestInfo(): boolean {
16331637
return this.#hasExtraRequestInfo;
16341638
}

0 commit comments

Comments
 (0)