chore: bump chromium to 115.0.5786.0 (main) (#38301)

* chore: bump chromium in DEPS to 115.0.5772.0

* chore: update disable_color_correct_rendering.patch

no manual changes; patch succeeded with fuzz 2.

* chore: update chromium/build_libc_as_static_library.patch

no manual changes; patch succeeded with fuzz 2 (offset 1 line).

* chore: update chromium/feat_configure_launch_options_for_service_process.patch

Xref: 4518747

patch manually reapplied due to upstream code shear

* chore: update chromium/chore_patch_out_profile_methods_in_profile_selections_cc.patch

4502965

patch manually reapplied due to upstream code shear

* chore: update bundle_locations #include location

Xref: 4525355

* chore: Remove `extension_name` from DesktopStreamsRegistry

Xref: 4514081

* chore: bump chromium in DEPS to 115.0.5778.0

* chore: add chromium/chore_patch_out_profile_methods_in_chrome_browser_pdf.patch

Xref: 4482679

Another instance of patching out upstream references to Profile code

* refactor: add WebViewGuestDelegate::GetGuestDelegateWeakPtr()

Xref: 4515455

This approach copied from GuestViewBase::GetGuestDelegateWeakPtr() approach in that same commit.

* fixup! chore: update bundle_locations #include location

Xref: 4525355

Sync namespace use to upstream base::mac -> base::apple changes

* fixup! chore: update bundle_locations #include location

Xref: 4525355

Sync namespace use to upstream base::mac -> base::apple changes

* chore: update chromium/mas_disable_remote_accessibility.patch

Xref: 4530546

patch manually reapplied due to upstream code shear

* chore: update chromium/printing.patch

no manual changes; patch succeeded with fuzz

* chore: update chromium/build_add_electron_tracing_category.patch

Xref: 4517872

no manual changes; patch succeeded with fuzz

* chore: update chromium/feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch

Xref: 4529098

patch manually reapplied due to upstream code shear

* chromium/build_only_use_the_mas_build_config_in_the_required_components.patch

4529098

patch manually reapplied due to upstream code shear

* chore: update chromium/mas-cgdisplayusesforcetogray.patch

Xref: 4529475

no manual changes; patch succeeded with fuzz

* chore: update chromium/build_only_use_the_mas_build_config_in_the_required_components.patch

Xref: 4429011

no manual changes; patch succeeded with fuzz

* chore: remove chromium/cherry-pick-48a136e77e6d.patch

already present upstream

* chore: remove chromium/cherry-pick-e6e23ba00379.patch

already present upstream

* [Code Health] Remove value based RegisterPref for Dict and List

Xref: 4533537

* Remove `cxx17_backports.h` and adjust unittest file

Xref: 4534916

Notes: mostly just removing #include and s/base::clamp/std::clamp/

* refactor: add FakeBrowserProcess helper class

Xref: 4424072

Used in ElectronBrowserMainParts' fake_browser_process_ field. Previously
this was an BrowserProcessImpl instance, but upstream 4424072 makes that
an abstract base class. `FakeBrowserProcess` is a thin subclass with the
minimum code needed to make it concrete.

`ElectronBrowserMainParts::fake_browser_process_` is now a `shared_ptr`
instead of a `unique_ptr` so we can avoid exposing `FakeBrowserProcess`
in the header.

* fixup! refactor: add FakeBrowserProcess helper class

remove unnecessary unique_ptr

* fix: Browser::SetDockIcon() when !Browser.is_ready()

Xref: 4410741

An alternative fix for https://github.com/electron/electron/pull/36279 .
The previous fix was to call `SetSupportedScales()` ourselves (1b1609a),
but upstream has removed this API.

CC @codebytere

* fixup! chore: remove chromium/cherry-pick-e6e23ba00379.patch

* chore: update chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch

Xref: 4517404

patch manually reapplied due to upstream code shear

* chore: update patches

* chore: add dep: resource_coordinator:mojo_bindings

Xref: 4521464

* fixup! chore: add dep: resource_coordinator:mojo_bindings

chore: make lint happy

* chore: patch out Profile methods in titlebar_config

Xref: 4508143 (primary)

Xref: 4534461 (followup)

* chore: bump chromium in DEPS to 115.0.5780.0

* chore: update chromium/disable_hidden.patch

no manual changes; patch succeeded with fuzz

* chore: update chromium/sysroot.patch

Xref: 4535715

no manual changes; patch succeeded with fuzz

* chore: update chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch

Xref: 4403623

patch manually reapplied due to upstream code shear

* chore: update chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch

Xref: 4547380

patch manually reapplied due to upstream code shear

* chore: update patches

* fixup! fix: Browser::SetDockIcon() when !Browser.is_ready()

chore: iwyu image.h

* chore: bump chromium in DEPS to 115.0.5782.0

* chore: bump chromium in DEPS to 115.0.5784.0

* 4514181: CR2023: Update filled cr-input styles.

4514181

* 4521894: Remove SiteInstanceDeleting usage outside of tests.

4521894

* 4525355: Move backup_util and bundle_locations to base/apple

4525355

* 4484743: webauthn: add underlying support for calling iCloud Keychain on macOS.

4484743

* chore: fixup patch indices

* 4546398: Convert /chrome/browser to use ARC

4546398

* chore: bump chromium in DEPS to 115.0.5786.0

* chore: update patches

* 4540682: Initialize PDF SDK with policy in chrome_pdf::RenderPDFPageToDC()

4540682

* Don't import ObjC++ fn headers into electron_api_app

* 4535715: Refactor sysroot-creator.sh

4535715

* fixup! refactor: add FakeBrowserProcess helper class

* 4531903: [string][test] Create/Copy strings to old space before externalization

4531903

* 59645: Add APIs to support RSA keys with large e.

https://boringssl-review.googlesource.com/c/boringssl/+/59645

---------

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
Charles Kerr 2023-05-23 14:58:58 -05:00 committed by GitHub
parent e7b8bb4766
commit 30e992dec4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
103 changed files with 1059 additions and 1490 deletions

View file

@ -11,7 +11,7 @@ majority of changes originally come from these PRs:
This patch also fixes callback for manual user cancellation and success.
diff --git a/BUILD.gn b/BUILD.gn
index 9c4b529ba6998cd0078b2b686008d14ee3fa204c..b598c88e4992d0ba327b8c1f23c826fe3ee50e0e 100644
index ea3d57d0937407a40e3c78bdffa18bb46a92300f..48e582b206dd31014f7e61f15725a2676f222587 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -974,7 +974,6 @@ if (is_win) {
@ -34,10 +34,10 @@ index 9c4b529ba6998cd0078b2b686008d14ee3fa204c..b598c88e4992d0ba327b8c1f23c826fe
}
diff --git a/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc
index b496ff49232f449fd6cea9dc1927b833c049497b..4c12ca65c1f800ddbbb792716f09f63fff8fa7d4 100644
index 3a66a52b8d3c6da9cd8d7e9afdc8d59f528ec3d5..facaa6fbca8ee7c04f83607e62b81b9594727ada 100644
--- a/chrome/browser/printing/print_job.cc
+++ b/chrome/browser/printing/print_job.cc
@@ -91,6 +91,7 @@ bool PrintWithReducedRasterization(PrefService* prefs) {
@@ -93,6 +93,7 @@ bool PrintWithReducedRasterization(PrefService* prefs) {
return base::FeatureList::IsEnabled(features::kPrintWithReducedRasterization);
}
@ -45,7 +45,7 @@ index b496ff49232f449fd6cea9dc1927b833c049497b..4c12ca65c1f800ddbbb792716f09f63f
PrefService* GetPrefsForWebContents(content::WebContents* web_contents) {
// TODO(thestig): Figure out why crbug.com/1083911 occurred, which is likely
// because `web_contents` was null. As a result, this section has many more
@@ -105,6 +106,7 @@ content::WebContents* GetWebContents(content::GlobalRenderFrameHostId rfh_id) {
@@ -107,6 +108,7 @@ content::WebContents* GetWebContents(content::GlobalRenderFrameHostId rfh_id) {
auto* rfh = content::RenderFrameHost::FromID(rfh_id);
return rfh ? content::WebContents::FromRenderFrameHost(rfh) : nullptr;
}
@ -53,7 +53,20 @@ index b496ff49232f449fd6cea9dc1927b833c049497b..4c12ca65c1f800ddbbb792716f09f63f
#endif // BUILDFLAG(IS_WIN)
@@ -363,8 +365,10 @@ void PrintJob::StartPdfToEmfConversion(
@@ -147,10 +149,8 @@ void PrintJob::Initialize(std::unique_ptr<PrinterQuery> query,
#if BUILDFLAG(IS_WIN)
pdf_page_mapping_ = PageNumber::GetPages(settings->ranges(), page_count);
- PrefService* prefs = GetPrefsForWebContents(GetWebContents(rfh_id_));
- if (prefs && prefs->IsManagedPreference(prefs::kPdfUseSkiaRendererEnabled)) {
- use_skia_ = prefs->GetBoolean(prefs::kPdfUseSkiaRendererEnabled);
- }
+ // TODO(codebytere): should we enable this later?
+ use_skia_ = false;
#endif
auto new_doc = base::MakeRefCounted<PrintedDocument>(std::move(settings),
@@ -374,8 +374,10 @@ void PrintJob::StartPdfToEmfConversion(
const PrintSettings& settings = document()->settings();
@ -65,7 +78,7 @@ index b496ff49232f449fd6cea9dc1927b833c049497b..4c12ca65c1f800ddbbb792716f09f63f
using RenderMode = PdfRenderSettings::Mode;
RenderMode mode = print_with_reduced_rasterization
@@ -454,8 +458,10 @@ void PrintJob::StartPdfToPostScriptConversion(
@@ -465,8 +467,10 @@ void PrintJob::StartPdfToPostScriptConversion(
if (ps_level2) {
mode = PdfRenderSettings::Mode::POSTSCRIPT_LEVEL2;
} else {
@ -78,7 +91,7 @@ index b496ff49232f449fd6cea9dc1927b833c049497b..4c12ca65c1f800ddbbb792716f09f63f
: PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3;
}
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576ec12ac3a 100644
index d7a3961a5c79e4d4f9f0fc5fbd6f1c55ab65ca9d..cf200ee43464bcde31dc13c18524e58d4ac2479b 100644
--- a/chrome/browser/printing/print_view_manager_base.cc
+++ b/chrome/browser/printing/print_view_manager_base.cc
@@ -23,7 +23,9 @@
@ -91,7 +104,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
#include "chrome/browser/printing/print_job.h"
#include "chrome/browser/printing/print_job_manager.h"
#include "chrome/browser/printing/print_view_manager_common.h"
@@ -79,6 +81,20 @@ namespace printing {
@@ -83,6 +85,20 @@ namespace printing {
namespace {
@ -112,7 +125,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
void OnDidGetDefaultPrintSettings(
scoped_refptr<PrintQueriesQueue> queue,
bool want_pdf_settings,
@@ -87,9 +103,11 @@ void OnDidGetDefaultPrintSettings(
@@ -91,9 +107,11 @@ void OnDidGetDefaultPrintSettings(
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (printer_query->last_status() != mojom::ResultCode::kSuccess) {
@ -124,7 +137,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
std::move(callback).Run(nullptr);
return;
}
@@ -99,9 +117,11 @@ void OnDidGetDefaultPrintSettings(
@@ -103,9 +121,11 @@ void OnDidGetDefaultPrintSettings(
params->document_cookie = printer_query->cookie();
if (!PrintMsgPrintParamsIsValid(*params)) {
@ -136,7 +149,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
std::move(callback).Run(nullptr);
return;
}
@@ -118,7 +138,7 @@ void OnDidScriptedPrint(
@@ -122,7 +142,7 @@ void OnDidScriptedPrint(
if (printer_query->last_status() != mojom::ResultCode::kSuccess ||
!printer_query->settings().dpi()) {
@ -145,7 +158,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
return;
}
@@ -128,12 +148,13 @@ void OnDidScriptedPrint(
@@ -132,12 +152,13 @@ void OnDidScriptedPrint(
params->params.get());
params->params->document_cookie = printer_query->cookie();
if (!PrintMsgPrintParamsIsValid(*params->params)) {
@ -161,7 +174,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
queue->QueuePrinterQuery(std::move(printer_query));
}
@@ -170,9 +191,11 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
@@ -174,9 +195,11 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
: PrintManager(web_contents),
queue_(g_browser_process->print_job_manager()->queue()) {
DCHECK(queue_);
@ -174,9 +187,9 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
}
PrintViewManagerBase::~PrintViewManagerBase() {
@@ -180,7 +203,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
DisconnectFromCurrentPrintJob();
@@ -199,7 +222,10 @@ void PrintViewManagerBase::DisableThirdPartyBlocking() {
}
#endif // BUILDFLAG(IS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
-bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
+bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh,
@ -186,7 +199,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
// Remember the ID for `rfh`, to enable checking that the `RenderFrameHost`
// is still valid after a possible inner message loop runs in
// `DisconnectFromCurrentPrintJob()`.
@@ -208,7 +234,12 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
@@ -227,7 +253,12 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
#endif
SetPrintingRFH(rfh);
@ -199,7 +212,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
return true;
}
@@ -432,7 +463,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply(
@@ -451,7 +482,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply(
void PrintViewManagerBase::ScriptedPrintReply(
ScriptedPrintCallback callback,
int process_id,
@ -209,7 +222,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
#if BUILDFLAG(ENABLE_OOP_PRINTING)
@@ -447,12 +479,15 @@ void PrintViewManagerBase::ScriptedPrintReply(
@@ -466,12 +498,15 @@ void PrintViewManagerBase::ScriptedPrintReply(
return;
}
@ -227,7 +240,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
}
}
@@ -588,10 +623,12 @@ void PrintViewManagerBase::DidPrintDocument(
@@ -607,10 +642,12 @@ void PrintViewManagerBase::DidPrintDocument(
void PrintViewManagerBase::GetDefaultPrintSettings(
GetDefaultPrintSettingsCallback callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@ -240,7 +253,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
#if BUILDFLAG(ENABLE_OOP_PRINTING)
if (printing::features::kEnableOopPrintDriversJobPrint.Get() &&
#if BUILDFLAG(ENABLE_PRINT_CONTENT_ANALYSIS)
@@ -643,10 +680,12 @@ void PrintViewManagerBase::UpdatePrintSettings(
@@ -661,10 +698,12 @@ void PrintViewManagerBase::UpdatePrintSettings(
base::Value::Dict job_settings,
UpdatePrintSettingsCallback callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@ -253,7 +266,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
absl::optional<int> printer_type_value =
job_settings.FindInt(kSettingPrinterType);
@@ -657,6 +696,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
@@ -675,6 +714,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
mojom::PrinterType printer_type =
static_cast<mojom::PrinterType>(*printer_type_value);
@ -261,7 +274,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
if (printer_type != mojom::PrinterType::kExtension &&
printer_type != mojom::PrinterType::kPdf &&
printer_type != mojom::PrinterType::kLocal) {
@@ -676,6 +716,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
@@ -694,6 +734,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
if (value > 0)
job_settings.Set(kSettingRasterizePdfDpi, value);
}
@ -269,7 +282,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
std::unique_ptr<PrintSettings> print_settings =
PrintSettingsFromJobSettings(job_settings);
@@ -725,7 +766,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
@@ -743,7 +784,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
void PrintViewManagerBase::IsPrintingEnabled(
IsPrintingEnabledCallback callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@ -278,7 +291,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
}
void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
@@ -741,14 +782,14 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
@@ -759,14 +800,14 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
// didn't happen for some reason.
bad_message::ReceivedBadMessage(
render_process_host, bad_message::PVMB_SCRIPTED_PRINT_FENCED_FRAME);
@ -295,7 +308,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
return;
}
#endif
@@ -786,6 +827,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
@@ -801,6 +842,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
PrintManager::PrintingFailed(cookie, reason);
@ -303,7 +316,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
// `PrintingFailed()` can occur because asynchronous compositing results
// don't complete until after a print job has already failed and been
// destroyed. In such cases the error notification to the user will
@@ -795,7 +837,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
@@ -810,7 +852,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
print_job_->document()->cookie() == cookie) {
ShowPrintErrorDialogForGenericError();
}
@ -312,7 +325,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
ReleasePrinterQuery();
}
@@ -807,15 +849,24 @@ void PrintViewManagerBase::RemoveObserver(Observer& observer) {
@@ -822,15 +864,24 @@ void PrintViewManagerBase::RemoveObserver(Observer& observer) {
observers_.RemoveObserver(&observer);
}
@ -337,7 +350,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
}
void PrintViewManagerBase::RenderFrameDeleted(
@@ -867,7 +918,12 @@ void PrintViewManagerBase::OnJobDone() {
@@ -882,7 +933,12 @@ void PrintViewManagerBase::OnJobDone() {
// Printing is done, we don't need it anymore.
// print_job_->is_job_pending() may still be true, depending on the order
// of object registration.
@ -351,7 +364,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
ReleasePrintJob();
}
@@ -876,9 +932,10 @@ void PrintViewManagerBase::OnCanceling() {
@@ -891,9 +947,10 @@ void PrintViewManagerBase::OnCanceling() {
}
void PrintViewManagerBase::OnFailed() {
@ -363,7 +376,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
TerminatePrintJob(true);
}
@@ -888,7 +945,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() {
@@ -903,7 +960,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() {
// Is the document already complete?
if (print_job_->document() && print_job_->document()->IsComplete()) {
@ -372,7 +385,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
return true;
}
@@ -936,7 +993,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
@@ -951,7 +1008,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
// Disconnect the current `print_job_`.
auto weak_this = weak_ptr_factory_.GetWeakPtr();
@ -384,7 +397,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
if (!weak_this)
return false;
@@ -957,7 +1017,7 @@ bool PrintViewManagerBase::CreateNewPrintJob(
@@ -972,7 +1032,7 @@ bool PrintViewManagerBase::CreateNewPrintJob(
#endif
print_job_->AddObserver(*this);
@ -393,7 +406,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
return true;
}
@@ -1019,6 +1079,11 @@ void PrintViewManagerBase::ReleasePrintJob() {
@@ -1034,6 +1094,11 @@ void PrintViewManagerBase::ReleasePrintJob() {
}
#endif
@ -405,7 +418,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
if (!print_job_)
return;
@@ -1026,7 +1091,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
@@ -1041,7 +1106,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
// printing_rfh_ should only ever point to a RenderFrameHost with a live
// RenderFrame.
DCHECK(rfh->IsRenderFrameLive());
@ -414,7 +427,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
}
print_job_->RemoveObserver(*this);
@@ -1068,7 +1133,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
@@ -1083,7 +1148,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
}
bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) {
@ -423,7 +436,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
return true;
if (!cookie) {
@@ -1176,7 +1241,7 @@ void PrintViewManagerBase::ReleasePrinterQuery() {
@@ -1191,7 +1256,7 @@ void PrintViewManagerBase::ReleasePrinterQuery() {
}
void PrintViewManagerBase::CompletePrintNow(content::RenderFrameHost* rfh) {
@ -432,7 +445,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
for (auto& observer : GetObservers())
observer.OnPrintNow(rfh);
@@ -1224,7 +1289,7 @@ void PrintViewManagerBase::CompleteScriptedPrintAfterContentAnalysis(
@@ -1239,7 +1304,7 @@ void PrintViewManagerBase::CompleteScriptedPrintAfterContentAnalysis(
bool allowed) {
if (!allowed || !printing_rfh_ || IsCrashed() ||
!printing_rfh_->IsRenderFrameLive()) {
@ -442,10 +455,10 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
}
CompleteScriptedPrint(printing_rfh_, std::move(params), std::move(callback));
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
index af968282117eb3b6969b479a18765ec6908843be..59814c3f6c32c1aff0776031b37a296cc9133923 100644
index 0b07b29da7df2595270391aed19e6eecd53b9f02..a5fb7fb6aac719df0dfed116daf798314a07b244 100644
--- a/chrome/browser/printing/print_view_manager_base.h
+++ b/chrome/browser/printing/print_view_manager_base.h
@@ -46,6 +46,8 @@ namespace printing {
@@ -47,6 +47,8 @@ namespace printing {
class PrintQueriesQueue;
class PrinterQuery;
@ -454,7 +467,7 @@ index af968282117eb3b6969b479a18765ec6908843be..59814c3f6c32c1aff0776031b37a296c
// Base class for managing the print commands for a WebContents.
class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
public:
@@ -74,7 +76,10 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -80,7 +82,10 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
// Prints the current document immediately. Since the rendering is
// asynchronous, the actual printing will not be completed on the return of
// this function. Returns false if printing is impossible at the moment.
@ -466,7 +479,7 @@ index af968282117eb3b6969b479a18765ec6908843be..59814c3f6c32c1aff0776031b37a296c
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Prints the document in `print_data` with settings specified in
@@ -126,8 +131,10 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -132,8 +137,10 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
void IsPrintingEnabled(IsPrintingEnabledCallback callback) override;
void ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
ScriptedPrintCallback callback) override;
@ -477,7 +490,7 @@ index af968282117eb3b6969b479a18765ec6908843be..59814c3f6c32c1aff0776031b37a296c
// Adds and removes observers for `PrintViewManagerBase` events. The order in
// which notifications are sent to observers is undefined. Observers must be
@@ -135,6 +142,14 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -141,6 +148,14 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
void AddObserver(Observer& observer);
void RemoveObserver(Observer& observer);
@ -492,7 +505,7 @@ index af968282117eb3b6969b479a18765ec6908843be..59814c3f6c32c1aff0776031b37a296c
protected:
explicit PrintViewManagerBase(content::WebContents* web_contents);
@@ -285,7 +300,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -291,7 +306,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
// Runs `callback` with `params` to reply to ScriptedPrint().
void ScriptedPrintReply(ScriptedPrintCallback callback,
int process_id,
@ -502,7 +515,7 @@ index af968282117eb3b6969b479a18765ec6908843be..59814c3f6c32c1aff0776031b37a296c
// Requests the RenderView to render all the missing pages for the print job.
// No-op if no print job is pending. Returns true if at least one page has
@@ -355,8 +371,11 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -361,8 +377,11 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
// The current RFH that is printing with a system printing dialog.
raw_ptr<content::RenderFrameHost> printing_rfh_ = nullptr;
@ -620,7 +633,7 @@ index a65f892c435369b8a9a645ab4cc757ba8bdb68cc..50b51b702d565febf1b8bbe8cd58bcef
// Tells the browser printing failed.
PrintingFailed(int32 cookie, PrintFailureReason reason);
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a4021187426530b0d5 100644
index 2fc137bf2583006130b133008cb4c253e76449ed..13260dc05853f565c39f001332857c232ab73e9f 100644
--- a/components/printing/renderer/print_render_frame_helper.cc
+++ b/components/printing/renderer/print_render_frame_helper.cc
@@ -45,6 +45,7 @@
@ -631,7 +644,7 @@ index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a402118742
#include "printing/units.h"
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
@@ -1314,7 +1315,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
@@ -1317,7 +1318,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
if (!weak_this)
return;
@ -641,7 +654,7 @@ index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a402118742
if (!weak_this)
return;
@@ -1345,7 +1347,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
@@ -1348,7 +1350,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
receivers_.Add(this, std::move(receiver));
}
@ -650,7 +663,7 @@ index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a402118742
ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr());
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
return;
@@ -1360,7 +1362,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
@@ -1363,7 +1365,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
// plugin node and print that instead.
auto plugin = delegate_->GetPdfElement(frame);
@ -659,7 +672,7 @@ index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a402118742
if (!render_frame_gone_)
frame->DispatchAfterPrintEvent();
@@ -1439,7 +1441,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
@@ -1442,7 +1444,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
}
Print(frame, print_preview_context_.source_node(),
@ -669,7 +682,7 @@ index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a402118742
if (!render_frame_gone_)
print_preview_context_.DispatchAfterPrintEvent();
// WARNING: |this| may be gone at this point. Do not do any more work here and
@@ -1490,6 +1493,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) {
@@ -1493,6 +1496,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) {
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
return;
@ -678,7 +691,7 @@ index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a402118742
print_preview_context_.OnPrintPreview();
#if BUILDFLAG(IS_CHROMEOS_ASH)
@@ -2107,7 +2112,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
@@ -2110,7 +2115,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
return;
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
@ -688,7 +701,7 @@ index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a402118742
// Check if |this| is still valid.
if (!weak_this)
return;
@@ -2122,7 +2128,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
@@ -2125,7 +2131,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
const blink::WebNode& node,
@ -699,7 +712,7 @@ index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a402118742
// If still not finished with earlier print request simply ignore.
if (prep_frame_view_)
return;
@@ -2130,7 +2138,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
@@ -2133,7 +2141,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
FrameReference frame_ref(frame);
uint32_t expected_page_count = 0;
@ -708,7 +721,7 @@ index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a402118742
DidFinishPrinting(FAIL_PRINT_INIT);
return; // Failed to init print page settings.
}
@@ -2149,8 +2157,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
@@ -2152,8 +2160,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
print_pages_params_->params->print_scaling_option;
auto self = weak_ptr_factory_.GetWeakPtr();
@ -793,7 +806,7 @@ index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a402118742
std::move(quit_closure).Run();
},
diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h
index 63376c5e434a8e2afa8e6c0f194377c6b5b8aff5..901dd4671ecee953927ab746eb974dcc1d04612a 100644
index 9376c3f858bea408d07ba09d988eaa300b4f550b..d62e09ca4ace8fe094a6b71c05e4ced1170ef056 100644
--- a/components/printing/renderer/print_render_frame_helper.h
+++ b/components/printing/renderer/print_render_frame_helper.h
@@ -253,7 +253,7 @@ class PrintRenderFrameHelper
@ -834,10 +847,10 @@ index 63376c5e434a8e2afa8e6c0f194377c6b5b8aff5..901dd4671ecee953927ab746eb974dcc
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Set options for print preset from source PDF document.
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index aa0030b7e54a411afd858803fa884f7e25783115..b2f8d8dab348d031510b3ff8a5cf5854feb77282 100644
index 7f8aea52f3aa4e3538125de9faa9215a9bb19af5..6c5c6f0771c72ac300e07398d4ed9bd3ce9a6ae3 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -2868,8 +2868,9 @@ source_set("browser") {
@@ -2881,8 +2881,9 @@ source_set("browser") {
"//ppapi/shared_impl",
]