Browse Source

fix: crash in printing on Windows (#26062)

* fix: crash in printing on Windows

* update patches

Co-authored-by: Electron Bot <[email protected]>
Shelley Vohr 4 years ago
parent
commit
a461001677

+ 1 - 2
patches/chromium/.patches

@@ -73,7 +73,6 @@ add_trustedauthclient_to_urlloaderfactory.patch
 feat_allow_disabling_blink_scheduler_throttling_per_renderview.patch
 accessible_pane_view.patch
 fix_use_the_new_mediaplaypause_key_listener_for_internal_chrome.patch
-use_electron_resources_in_pdf_util.patch
 hack_plugin_response_interceptor_to_point_to_electron.patch
 fix_route_mouse_event_navigations_through_the_web_contents_delegate.patch
 feat_add_support_for_overriding_the_base_spellchecker_download_url.patch
@@ -93,10 +92,10 @@ crash_allow_disabling_compression_on_linux.patch
 allow_setting_secondary_label_via_simplemenumodel.patch
 fix_swap_global_proxies_before_initializing_the_windows_proxies.patch
 feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch
-use_electron_resources_in_icon_reader_service.patch
 fix_patch_out_profile_refs_in_accessibility_ui.patch
 remove_some_deps_that_do_not_work_on_arm64.patch
 fix_check_issecureeventinputenabled_in_constructor_before_setting.patch
 skip_atk_toolchain_check.patch
 worker_feat_add_hook_to_notify_script_ready.patch
 cherry-pick-2f5b8357dca2.patch
+fix_use_electron_generated_resources.patch

+ 53 - 0
patches/chromium/fix_use_electron_generated_resources.patch

@@ -0,0 +1,53 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Shelley Vohr <[email protected]>
+Date: Thu, 24 Sep 2020 11:10:41 -0700
+Subject: fix: use electron generated resources
+
+This patch fixes a few instances where we need to use Electron generated
+resources for IDS strings, or the IDs will be wrong and cause DCHECKS
+as they will loaded as empty strings.
+
+* IDS_UTILITY_PROCESS_UTILITY_WIN_NAME on Windows
+* IDR_PDF_MANIFEST on Linux
+* IDS_UTILITY_PROCESS_PRINTING_SERVICE_NAME on Windows
+
+diff --git a/chrome/browser/pdf/pdf_extension_util.cc b/chrome/browser/pdf/pdf_extension_util.cc
+index b471f462c1a79be50497e72bfe672bb8fad7e85b..986351b7b0f9fd62c90a2c6c134119f41412b291 100644
+--- a/chrome/browser/pdf/pdf_extension_util.cc
++++ b/chrome/browser/pdf/pdf_extension_util.cc
+@@ -8,8 +8,7 @@
+ #include "base/values.h"
+ #include "chrome/browser/browser_process.h"
+ #include "chrome/common/chrome_content_client.h"
+-#include "chrome/grit/browser_resources.h"
+-#include "chrome/grit/generated_resources.h"
++#include "electron/grit/electron_resources.h"
+ #include "components/strings/grit/components_strings.h"
+ #include "components/zoom/page_zoom_constants.h"
+ #include "pdf/pdf_features.h"
+diff --git a/chrome/browser/printing/printing_service.cc b/chrome/browser/printing/printing_service.cc
+index 2b73b110049b5e8d28b52656bbd2423e18ba07a0..8fd868b39d64c74aa189b8ca3e24c8537d91b1ba 100644
+--- a/chrome/browser/printing/printing_service.cc
++++ b/chrome/browser/printing/printing_service.cc
+@@ -6,7 +6,7 @@
+ 
+ #include "base/no_destructor.h"
+ #include "chrome/browser/service_sandbox_type.h"
+-#include "chrome/grit/generated_resources.h"
++#include "electron/grit/electron_resources.h"
+ #include "content/public/browser/service_process_host.h"
+ 
+ const mojo::Remote<printing::mojom::PrintingService>& GetPrintingService() {
+diff --git a/chrome/browser/win/icon_reader_service.cc b/chrome/browser/win/icon_reader_service.cc
+index 721e1a863cc6925908f8343002df056f2373bf0b..10b2a95162541a8ff4d010c7be864f3f41dae378 100644
+--- a/chrome/browser/win/icon_reader_service.cc
++++ b/chrome/browser/win/icon_reader_service.cc
+@@ -5,7 +5,7 @@
+ #include "chrome/browser/win/icon_reader_service.h"
+ 
+ #include "chrome/browser/service_sandbox_type.h"
+-#include "chrome/grit/generated_resources.h"
++#include "electron/grit/electron_resources.h"
+ #include "content/public/browser/service_process_host.h"
+ 
+ mojo::Remote<chrome::mojom::UtilReadIcon> LaunchIconReaderInstance() {

+ 0 - 21
patches/chromium/use_electron_resources_in_icon_reader_service.patch

@@ -1,21 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: deepak1556 <[email protected]>
-Date: Thu, 2 Jul 2020 00:27:40 -0700
-Subject: use electron resources in icon_reader_service
-
-Without this, the ID for IDS_UTILITY_PROCESS_UTILITY_WIN_NAME will be wrong on windows
-and cause a DCHECK() failure
-
-diff --git a/chrome/browser/win/icon_reader_service.cc b/chrome/browser/win/icon_reader_service.cc
-index 721e1a863cc6925908f8343002df056f2373bf0b..10b2a95162541a8ff4d010c7be864f3f41dae378 100644
---- a/chrome/browser/win/icon_reader_service.cc
-+++ b/chrome/browser/win/icon_reader_service.cc
-@@ -5,7 +5,7 @@
- #include "chrome/browser/win/icon_reader_service.h"
- 
- #include "chrome/browser/service_sandbox_type.h"
--#include "chrome/grit/generated_resources.h"
-+#include "electron/grit/electron_resources.h"
- #include "content/public/browser/service_process_host.h"
- 
- mojo::Remote<chrome::mojom::UtilReadIcon> LaunchIconReaderInstance() {

+ 0 - 23
patches/chromium/use_electron_resources_in_pdf_util.patch

@@ -1,23 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Jeremy Apthorp <[email protected]>
-Date: Mon, 10 Feb 2020 10:37:48 -0800
-Subject: use electron resources in pdf_util
-
-Without this, the ID for IDR_PDF_MANIFEST will be wrong on linux
-and cause a DCHECK(), since the resource will be loaded as an empty
-string.
-
-diff --git a/chrome/browser/pdf/pdf_extension_util.cc b/chrome/browser/pdf/pdf_extension_util.cc
-index b471f462c1a79be50497e72bfe672bb8fad7e85b..986351b7b0f9fd62c90a2c6c134119f41412b291 100644
---- a/chrome/browser/pdf/pdf_extension_util.cc
-+++ b/chrome/browser/pdf/pdf_extension_util.cc
-@@ -8,8 +8,7 @@
- #include "base/values.h"
- #include "chrome/browser/browser_process.h"
- #include "chrome/common/chrome_content_client.h"
--#include "chrome/grit/browser_resources.h"
--#include "chrome/grit/generated_resources.h"
-+#include "electron/grit/electron_resources.h"
- #include "components/strings/grit/components_strings.h"
- #include "components/zoom/page_zoom_constants.h"
- #include "pdf/pdf_features.h"