Commit 17308745 authored by Joey Arhar's avatar Joey Arhar Committed by Commit Bot

[DevTools] Clear network overrides on Network.disable

This clears network overrides for throttling and offline when
InspectorNetworkAgent is closed in order to prevent navigator.onLine
from returning "false" after DevTools is closed. This unifies the
behavior we currently have for individual requests when we set offline
because individual requests aren't throttled after DevTools is closed
because we stop setting a throttling profile id on requests because an
InspectorNetworkAgent instance is required to set the id.

Bug: 972337
Change-Id: I83dee7147314f54441cd335565bc872a64a3ac3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1652800
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681089}
parent db27cd40
......@@ -1362,6 +1362,8 @@ void InspectorNetworkAgent::Enable() {
Response InspectorNetworkAgent::disable() {
DCHECK(!pending_request_type_);
if (IsMainThread())
GetNetworkStateNotifier().ClearOverride();
instrumenting_agents_->RemoveInspectorNetworkAgent(this);
agent_state_.ClearAllFields();
resources_data_->Clear();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment