We need mime sniffing in the network service.
We need mime sniffing in the network service. content/browser/loader/mime_sniffing_resource_handler.cc is the inspiration.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/287591bd8b0165fcabb427ff595d141a9ae89b4b commit 287591bd8b0165fcabb427ff595d141a9ae89b4b Author: John Abd-El-Malek <jam@chromium.org> Date: Thu Jul 20 22:28:30 2017 Add mime sniffing to the network service. This doesn't handle all the cases (e.g. plugins, downloads) but these don't work yet with the network service. However it does fix 900 new wpt tests that started failing after r487304 since these generated *worker.html files weren't being served with a mime type which was causing their load to fail. BUG= 746144 , 729849 Change-Id: I232c9af1dca32f1c641736c8ccd61978096559ef Reviewed-on: https://chromium-review.googlesource.com/577507 Reviewed-by: Matt Menke <mmenke@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: John Abd-El-Malek <jam@chromium.org> Cr-Commit-Position: refs/heads/master@{#488445} [modify] https://crrev.com/287591bd8b0165fcabb427ff595d141a9ae89b4b/content/browser/loader/mime_sniffing_resource_handler.cc [modify] https://crrev.com/287591bd8b0165fcabb427ff595d141a9ae89b4b/content/browser/loader/mime_sniffing_resource_handler.h [modify] https://crrev.com/287591bd8b0165fcabb427ff595d141a9ae89b4b/content/browser/loader/navigation_url_loader_network_service.cc [modify] https://crrev.com/287591bd8b0165fcabb427ff595d141a9ae89b4b/content/child/resource_dispatcher.cc [modify] https://crrev.com/287591bd8b0165fcabb427ff595d141a9ae89b4b/content/common/BUILD.gn [add] https://crrev.com/287591bd8b0165fcabb427ff595d141a9ae89b4b/content/common/loader_util.cc [add] https://crrev.com/287591bd8b0165fcabb427ff595d141a9ae89b4b/content/common/loader_util.h [modify] https://crrev.com/287591bd8b0165fcabb427ff595d141a9ae89b4b/content/network/DEPS [modify] https://crrev.com/287591bd8b0165fcabb427ff595d141a9ae89b4b/content/network/url_loader_impl.cc [modify] https://crrev.com/287591bd8b0165fcabb427ff595d141a9ae89b4b/content/network/url_loader_impl.h [modify] https://crrev.com/287591bd8b0165fcabb427ff595d141a9ae89b4b/content/network/url_loader_unittest.cc [modify] https://crrev.com/287591bd8b0165fcabb427ff595d141a9ae89b4b/content/public/common/url_loader_factory.mojom [add] https://crrev.com/287591bd8b0165fcabb427ff595d141a9ae89b4b/content/test/data/content-sniffer-test4.html [add] https://crrev.com/287591bd8b0165fcabb427ff595d141a9ae89b4b/content/test/data/content-sniffer-test4.html.mock-http-headers
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/01db9e6de868980ffa29bca92f644c43e1c9b154 commit 01db9e6de868980ffa29bca92f644c43e1c9b154 Author: John Abd-El-Malek <jam@chromium.org> Date: Fri Jul 21 22:33:15 2017 Add UMA for how often the first read sniffs the final mime type. This is to figure out whether we need to buffer data in the network service's URLLoaderImpl. BUG= 746144 Change-Id: I10a0b5923b8d9fefdceee98bbc07671e53ab4f8d Reviewed-on: https://chromium-review.googlesource.com/581742 Commit-Queue: John Abd-El-Malek <jam@chromium.org> Reviewed-by: Ilya Sherman <isherman@chromium.org> Reviewed-by: Matt Menke <mmenke@chromium.org> Reviewed-by: Steven Holte <holte@chromium.org> Cr-Commit-Position: refs/heads/master@{#488776} [modify] https://crrev.com/01db9e6de868980ffa29bca92f644c43e1c9b154/content/browser/loader/mime_sniffing_resource_handler.cc [modify] https://crrev.com/01db9e6de868980ffa29bca92f644c43e1c9b154/content/browser/loader/mime_sniffing_resource_handler.h [modify] https://crrev.com/01db9e6de868980ffa29bca92f644c43e1c9b154/tools/metrics/histograms/histograms.xml
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d44c753cbd42942191e3dce2e66afadd951f1735 commit d44c753cbd42942191e3dce2e66afadd951f1735 Author: John Abd-El-Malek <jam@chromium.org> Date: Tue Jul 25 01:34:54 2017 Revert "Add UMA for how often the first read sniffs the final mime type." This reverts commit 01db9e6de868980ffa29bca92f644c43e1c9b154. Reason for revert: got the data I was curious about. Original change's description: > Add UMA for how often the first read sniffs the final mime type. > > This is to figure out whether we need to buffer data in the network service's URLLoaderImpl. > > BUG= 746144 > > Change-Id: I10a0b5923b8d9fefdceee98bbc07671e53ab4f8d > Reviewed-on: https://chromium-review.googlesource.com/581742 > Commit-Queue: John Abd-El-Malek <jam@chromium.org> > Reviewed-by: Ilya Sherman <isherman@chromium.org> > Reviewed-by: Matt Menke <mmenke@chromium.org> > Reviewed-by: Steven Holte <holte@chromium.org> > Cr-Commit-Position: refs/heads/master@{#488776} TBR=isherman@chromium.org,jam@chromium.org,asvitkine@chromium.org,mmenke@chromium.org,holte@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 746144 Change-Id: I4b388fbf13e69dd9f8d937234920315011588801 Reviewed-on: https://chromium-review.googlesource.com/583519 Reviewed-by: John Abd-El-Malek <jam@chromium.org> Reviewed-by: Matt Menke <mmenke@chromium.org> Commit-Queue: Matt Menke <mmenke@chromium.org> Cr-Commit-Position: refs/heads/master@{#489179} [modify] https://crrev.com/d44c753cbd42942191e3dce2e66afadd951f1735/content/browser/loader/mime_sniffing_resource_handler.cc [modify] https://crrev.com/d44c753cbd42942191e3dce2e66afadd951f1735/content/browser/loader/mime_sniffing_resource_handler.h [modify] https://crrev.com/d44c753cbd42942191e3dce2e66afadd951f1735/tools/metrics/histograms/histograms.xml
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/de362b5d381df14baf1f926d2474ddf5a75d50c9 commit de362b5d381df14baf1f926d2474ddf5a75d50c9 Author: John Abd-El-Malek <jam@chromium.org> Date: Wed Jul 26 18:16:59 2017 Handle mime type sniffing in the network service when multiple reads are required. BUG= 746144 Change-Id: Ib336dd6e84b777f4772816686d8686f4c7cb5926 Reviewed-on: https://chromium-review.googlesource.com/584112 Reviewed-by: Matt Menke <mmenke@chromium.org> Commit-Queue: John Abd-El-Malek <jam@chromium.org> Cr-Commit-Position: refs/heads/master@{#489700} [modify] https://crrev.com/de362b5d381df14baf1f926d2474ddf5a75d50c9/content/common/net_adapters.cc [modify] https://crrev.com/de362b5d381df14baf1f926d2474ddf5a75d50c9/content/common/net_adapters.h [modify] https://crrev.com/de362b5d381df14baf1f926d2474ddf5a75d50c9/content/network/url_loader_impl.cc [modify] https://crrev.com/de362b5d381df14baf1f926d2474ddf5a75d50c9/content/network/url_loader_impl.h [modify] https://crrev.com/de362b5d381df14baf1f926d2474ddf5a75d50c9/content/network/url_loader_unittest.cc
Apologies, applied the wrong component in bulk.
Comment 1 by jam@chromium.org
, Jul 19 2017