From 26155c8a000b922cfaaf80e338ef21a55a0b5162 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Fri, 31 May 2019 13:05:35 -0700 Subject: [PATCH] fix: handle gzipped chrome WebUI resources (#18531) Fixes: #18503 Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1576232 For whatever reason Chromium made this change and then made the default //content behavior to return false for all IsDataResourceGzipped requests. This PR updates our ContentClient impl to return the correct values. Notes: Fixed issues where some `chrome://*` URLs would not render correctly --- atom/app/atom_content_client.cc | 4 ++++ atom/app/atom_content_client.h | 1 + 2 files changed, 5 insertions(+) diff --git a/atom/app/atom_content_client.cc b/atom/app/atom_content_client.cc index ff5dce323d..17effdfa07 100644 --- a/atom/app/atom_content_client.cc +++ b/atom/app/atom_content_client.cc @@ -268,4 +268,8 @@ void AtomContentClient::AddContentDecryptionModules( } } +bool AtomContentClient::IsDataResourceGzipped(int resource_id) const { + return ui::ResourceBundle::GetSharedInstance().IsGzipped(resource_id); +} + } // namespace atom diff --git a/atom/app/atom_content_client.h b/atom/app/atom_content_client.h index f7095f6ab0..9c7034df43 100644 --- a/atom/app/atom_content_client.h +++ b/atom/app/atom_content_client.h @@ -31,6 +31,7 @@ class AtomContentClient : public content::ContentClient { void AddContentDecryptionModules( std::vector* cdms, std::vector* cdm_host_file_paths) override; + bool IsDataResourceGzipped(int resource_id) const override; private: DISALLOW_COPY_AND_ASSIGN(AtomContentClient);