Revert "Re-enable RendererSideContentDecoding for Navigations and SXG"

This reverts commit 468d896aa9ff99143bc4da03bfab116c360bebc1.

Reason for revert:DownloadContentTest.CompressedResponseWithContentDispositionInsufficientResources failure on multiple bots

List of failed builders:

Builder: linux-chromeos-chrome
https://ci.chromium.org/p/chrome/builders/ci/linux-chromeos-chrome
First failing build:
https://ci.chromium.org/p/chrome/builders/ci/linux-chromeos-chrome/b8718844112705093041
Step "content_browsertests (retry shards) on Ubuntu-22.04 or Ubuntu-20.04" failing on builder "chromium/ci/fuchsia-arm64-cast-receiver-rel"

Builder: fuchsia-arm64-cast-receiver-rel
https://ci.chromium.org/p/chromium/builders/ci/fuchsia-arm64-cast-receiver-rel
First failing build:
https://ci.chromium.org/p/chromium/builders/ci/fuchsia-arm64-cast-receiver-rel/b8718845082436844721
Step "content_browsertests (retry shards) on Ubuntu-22.04" failing on builder "chromium/ci/fuchsia-x64-cast-receiver-rel"

Builder: fuchsia-x64-cast-receiver-rel
https://ci.chromium.org/p/chromium/builders/ci/fuchsia-x64-cast-receiver-rel
First failing build:
https://ci.chromium.org/p/chromium/builders/ci/fuchsia-x64-cast-receiver-rel/b8718843408303503537


Original change's description:
> Re-enable RendererSideContentDecoding for Navigations and SXG
>
> This CL re-enables the `RendererSideContentDecoding` feature for
> navigation requests and for Signed Exchanges (SXG) loadings.
>
> Previously, this feature was disabled for these requests [1][2] because
> responses ultimately consumed by the browser process require decoded
> content, but the feature caused the network service to skip decoding.
> This impacted:
> - Downloads triggered by `Content-Disposition: attachment`.
> - Signed Exchanges (SXG), where the outer response's encoded payload
>   must be decoded before parsing can occur in the browser process.
>
> This change introduces a unified solution using a new
> `ContentDecodingInterceptor` mechanism to correctly handle these cases
> while allowing standard navigations to potentially benefit from
> client-side (renderer) decoding:
>
> 1.  The `client_side_content_decoding_enabled` flag is set again in
>     `CreateResourceRequestForNavigation` when the feature flag is
>     enabled.
> 2.  The network service (`URLRequestHttpJob`) now consistently skips
>     decoding if this flag is set, regardless of content type (the
>     previous SXG exception is removed). It reports the skipped encoding
>     types via `URLResponseHead::client_side_content_decoding_types`.
> 3.  A new Mojo IPC, `NetworkService::InterceptUrlLoaderForBodyDecoding`,
>     and a browser-side helper,
>     `ContentDecodingInterceptor::InterceptOnNetworkService`, are added.
>     These allow the browser process to request the network service to
>     insert a decoding interceptor on demand.
> 4.  Crucially, both `NavigationRequest` (before checking for downloads)
>     and `SignedExchangeLoader` (before processing the SXG response) now
>     check if `client_side_content_decoding_types` is populated. If
>     decoding was skipped by the network service, they call
>     `InterceptOnNetworkService`. This ensures a decoding step, performed
>     within the network service process, is inserted before the body
>     reaches the download manager or the SXG parsing logic.
>
> This approach allows standard navigation responses destined for a
> renderer to bypass network service decoding (if the feature is enabled),
> while guaranteeing that downloads and SXG outer responses are correctly
> decoded before being consumed by browser-process logic.
>
> This CL also add a new `switch (reason)` case in the
> ConvertInterruptReasonToMojoNetworkRequestStatus() method to handle the
> mojo data pipe creation error case correctly. This case is tested by the
> new test CompressedResponseWithContentDispositionInsufficientResources
> in DownloadContentTest.
>
> [1]: https://crrev.com/c/6399553
> [2]: https://crrev.com/c/6399234
>
>
> Bug: 391950057
> Fixed: 406877444
> Change-Id: I9535db61464dfd0fd3c8e128affa7aa4ac6c3fc2
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6399776
> Reviewed-by: Adam Rice <ricea@chromium.org>
> Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
> Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Reviewed-by: Min Qin <qinmin@chromium.org>
> Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1440565}

Bug: 391950057
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I87e46de67bcbad0b0e656e3f58bc81c747a13784
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6420243
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Mikihito Matsuura <mikt@google.com>
Commit-Queue: Mikihito Matsuura <mikt@google.com>
Cr-Commit-Position: refs/heads/main@{#1440677}
12 files changed
tree: 678e1d5f7f3752fb4e84820a521b2ce7805a2332
  1. android_webview/
  2. apps/
  3. ash/
  4. base/
  5. build/
  6. build_overrides/
  7. buildtools/
  8. cc/
  9. chrome/
  10. chromecast/
  11. chromeos/
  12. codelabs/
  13. components/
  14. content/
  15. crypto/
  16. dbus/
  17. device/
  18. docs/
  19. extensions/
  20. fuchsia_web/
  21. gin/
  22. google_apis/
  23. gpu/
  24. headless/
  25. infra/
  26. ios/
  27. ipc/
  28. media/
  29. mojo/
  30. native_client_sdk/
  31. net/
  32. pdf/
  33. ppapi/
  34. printing/
  35. remoting/
  36. rlz/
  37. sandbox/
  38. services/
  39. skia/
  40. sql/
  41. storage/
  42. styleguide/
  43. testing/
  44. third_party/
  45. tools/
  46. ui/
  47. url/
  48. webkit/
  49. .clang-format
  50. .clang-tidy
  51. .clangd
  52. .git-blame-ignore-revs
  53. .gitallowed
  54. .gitattributes
  55. .gitignore
  56. .gitmodules
  57. .gn
  58. .mailmap
  59. .rustfmt.toml
  60. .vpython3
  61. .yapfignore
  62. ATL_OWNERS
  63. AUTHORS
  64. BUILD.gn
  65. CODE_OF_CONDUCT.md
  66. codereview.settings
  67. CPPLINT.cfg
  68. CRYPTO_OWNERS
  69. DEPS
  70. DIR_METADATA
  71. LICENSE
  72. LICENSE.chromium_os
  73. OWNERS
  74. PRESUBMIT.py
  75. PRESUBMIT_test.py
  76. PRESUBMIT_test_mocks.py
  77. README.md
  78. WATCHLISTS
README.md

Logo Chromium

Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.

The project's web site is https://www.chromium.org.

To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.

Documentation in the source is rooted in docs/README.md.

Learn how to Get Around the Chromium Source Code Directory Structure.

For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.

If you found a bug, please file it at https://crbug.com/new.