diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-02-12 11:41:55 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-03-02 10:49:46 +0000 |
commit | 945bf7974a7531685f357efd9574a5de6f14a5d0 (patch) | |
tree | 061192cc2d7316d6c8094f312996b6bf7f51bd58 | |
parent | 1652589a31403f7c5954a29fd46a298285d79bf6 (diff) | |
download | qtwebengine-chromium-945bf7974a7531685f357efd9574a5de6f14a5d0.tar.gz |
Destroy old network context before creating the replacement
Helps with updating primary network contexts.
Change-Id: Ia8a4f366951128f5501b9f684f84faa02fe458b2
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
-rw-r--r-- | chromium/content/browser/storage_partition_impl.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/chromium/content/browser/storage_partition_impl.cc b/chromium/content/browser/storage_partition_impl.cc index a9318c8de61..a306ff316a0 100644 --- a/chromium/content/browser/storage_partition_impl.cc +++ b/chromium/content/browser/storage_partition_impl.cc @@ -2278,11 +2278,15 @@ void StoragePartitionImpl::GetQuotaSettings( } void StoragePartitionImpl::InitNetworkContext() { + if (network_context_.is_bound()) { + network_context_.set_disconnect_handler(base::OnceClosure()); + network_context_.reset(); + network_context_client_receiver_.reset(); + } network_context_ = GetContentClient()->browser()->CreateNetworkContext( browser_context_, is_in_memory_, relative_partition_path_); DCHECK(network_context_); - network_context_client_receiver_.reset(); network_context_->SetClient( network_context_client_receiver_.BindNewPipeAndPassRemote()); network_context_.set_disconnect_handler(base::BindOnce( |