New issue
Advanced search Search tips

Issue 845939 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Chrome , Mac , Fuchsia
Pri: 3
Type: Bug
Proj-Servicification



Sign in to add a comment

Hook up global cert fetchers when the network service is enabled.

Project Member Reported by mmenke@chromium.org, May 23 2018

Issue description

IOThread makes two calls to set up global cert/OCSP/etc fetchers on different platforms (SetURLRequestContextForNSSHttpIO and SetGlobalCertNetFetcher).  We need to call these in the network process when the network service is enabled as well.

These methods must be called on the system URLREquestContext before any other URLRequestContexts are created, and all other URLRequestContexts must be destroyed before we clear the globals, which must be cleared before the system URLRequestContext is destroyed.  These requirements are a bit onerous, but shouldn't be too hard to implement, if we add a method to ContentBrowserClient to be invoked whenever the network service is started / restarted, and have that initialize the system URLRequestContext.
 
Project Member

Comment 1 by bugdroid1@chromium.org, May 23 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cfc40b9d0aeffc727aaa9f3366b03a915041ae5e

commit cfc40b9d0aeffc727aaa9f3366b03a915041ae5e
Author: Matt Menke <mmenke@chromium.org>
Date: Wed May 23 21:54:19 2018

NetworkService: Refactor NetworkContext ownership.

NetworkContexts used to delete themselves when their mojo pipe was
closed. This was only correct behavior for NetworkContexts that live in
the out-of-process NetworkService.  Other NetworkContexts are stored in
unique_ptrs owned by the IOThread, ProfileIOData, and the
StoragePartition's NetworkContext class, so should not delete themselves.

We haven't been running into crashes due to this, but it seems less than
ideal. This CL changes things so that the NetworkService actually owns
NetworkContexts that need to be destroyed on pipe closures, and the
NetworkContexts call into it to tell the NetworkService to delete them
when the pipe is closed.  This mirrors the URLLoaderFactory ownership
model.

Bug:  845939 
Change-Id: Ie53d8b6114000b0f403839089d6ee6dec1d29932
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Reviewed-on: https://chromium-review.googlesource.com/1070427
Commit-Queue: Matt Menke <mmenke@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561265}
[modify] https://crrev.com/cfc40b9d0aeffc727aaa9f3366b03a915041ae5e/services/network/http_cache_data_remover_unittest.cc
[modify] https://crrev.com/cfc40b9d0aeffc727aaa9f3366b03a915041ae5e/services/network/network_context.cc
[modify] https://crrev.com/cfc40b9d0aeffc727aaa9f3366b03a915041ae5e/services/network/network_context.h
[modify] https://crrev.com/cfc40b9d0aeffc727aaa9f3366b03a915041ae5e/services/network/network_context_unittest.cc
[modify] https://crrev.com/cfc40b9d0aeffc727aaa9f3366b03a915041ae5e/services/network/network_service.cc
[modify] https://crrev.com/cfc40b9d0aeffc727aaa9f3366b03a915041ae5e/services/network/network_service.h

Comment 2 by mmenke@chromium.org, May 23 2018

The above CL was supposed to link to 845942 (Though it was motivated by the fix for this issue).

Comment 3 by mmenke@chromium.org, May 31 2018

Status: Started (was: Assigned)
Project Member

Comment 4 by bugdroid1@chromium.org, Jun 2 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ae4fdb1c1ff92a8d6ea3ef586097e0428848d56b

commit ae4fdb1c1ff92a8d6ea3ef586097e0428848d56b
Author: Matt Menke <mmenke@chromium.org>
Date: Sat Jun 02 06:32:54 2018

NetworkService: Hook up global cert fetchers.

Add a parameter to NetworkContextParams that, when set, causes the
NetworkContext to call SetGlobalCertNetFetcher /
SetURLRequestContextForNSSHttpIO on its URLRequestContext.

Since the URLRequestContext used to fetch certs must be created first
and destroyed last, this CL also refactors NetworkContext lifetime and
ownership so that the NetworkService can enforce that constraint,
and makes sure that the SystemNetworkContext is created before any
others.

This CL also incidentally fixes  issue 845772 , which is than when the
NetworkService is restarted and QUIC was disabled previously, QUIC
wouldn't be re-disabled until the SystemNetworkContext was re-created.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: Ie56241c514337f28dfc41faba407580360814b11
Bug: 	 845939 ,  845772 
Reviewed-on: https://chromium-review.googlesource.com/1067959
Commit-Queue: Matt Menke <mmenke@chromium.org>
Reviewed-by: Emily Stark <estark@chromium.org>
Reviewed-by: Eric Roman <eroman@chromium.org>
Reviewed-by: John Budorick <jbudorick@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Helen Li <xunjieli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563933}
[modify] https://crrev.com/ae4fdb1c1ff92a8d6ea3ef586097e0428848d56b/build/android/pylib/local/device/local_device_gtest_run.py
[modify] https://crrev.com/ae4fdb1c1ff92a8d6ea3ef586097e0428848d56b/chrome/browser/chrome_content_browser_client.cc
[modify] https://crrev.com/ae4fdb1c1ff92a8d6ea3ef586097e0428848d56b/chrome/browser/chrome_content_browser_client.h
[modify] https://crrev.com/ae4fdb1c1ff92a8d6ea3ef586097e0428848d56b/chrome/browser/io_thread.cc
[modify] https://crrev.com/ae4fdb1c1ff92a8d6ea3ef586097e0428848d56b/chrome/browser/net/profile_network_context_service.cc
[modify] https://crrev.com/ae4fdb1c1ff92a8d6ea3ef586097e0428848d56b/chrome/browser/net/system_network_context_manager.cc
[modify] https://crrev.com/ae4fdb1c1ff92a8d6ea3ef586097e0428848d56b/chrome/browser/net/system_network_context_manager.h
[modify] https://crrev.com/ae4fdb1c1ff92a8d6ea3ef586097e0428848d56b/content/browser/network_service_instance.cc
[modify] https://crrev.com/ae4fdb1c1ff92a8d6ea3ef586097e0428848d56b/content/public/browser/content_browser_client.cc
[modify] https://crrev.com/ae4fdb1c1ff92a8d6ea3ef586097e0428848d56b/content/public/browser/content_browser_client.h
[modify] https://crrev.com/ae4fdb1c1ff92a8d6ea3ef586097e0428848d56b/services/network/BUILD.gn
[modify] https://crrev.com/ae4fdb1c1ff92a8d6ea3ef586097e0428848d56b/services/network/network_context.cc
[modify] https://crrev.com/ae4fdb1c1ff92a8d6ea3ef586097e0428848d56b/services/network/network_context.h
[modify] https://crrev.com/ae4fdb1c1ff92a8d6ea3ef586097e0428848d56b/services/network/network_service.cc
[modify] https://crrev.com/ae4fdb1c1ff92a8d6ea3ef586097e0428848d56b/services/network/network_service.h
[modify] https://crrev.com/ae4fdb1c1ff92a8d6ea3ef586097e0428848d56b/services/network/network_service_unittest.cc
[modify] https://crrev.com/ae4fdb1c1ff92a8d6ea3ef586097e0428848d56b/services/network/public/mojom/network_context.mojom
[modify] https://crrev.com/ae4fdb1c1ff92a8d6ea3ef586097e0428848d56b/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter

Status: Fixed (was: Started)

Sign in to add a comment