chore: bump chromium to 100.0.4857.0 (main) (#32419)

* chore: bump chromium in DEPS to 99.0.4819.0

* chore: update patches

* chore: bump chromium in DEPS to 99.0.4824.0

* chore: update patches

* chore: bump chromium in DEPS to 99.0.4827.0

* chore: update patches

* 3352511: PiP: Add inkdrop and pointer cursor to PiP window buttons

3352511

* 3309164: webhid: Show FIDO devices in the chooser if allowed

3309164

* 3297868: hid: Add experimental HIDDevice.forget()

3297868

* 3362491: [Extensions] Move i18n API to //extensions

3362491

* MCC Refactor step0: Allow embedders to register associated_interface binders with RenderFrameHostImpl::associated_registry_.

3281481

* 3352616: [Gtk] Remove libgtk from the link-line

3352616

* 3249211: Clear-Site-Data support for partitioned cookies

3249211

* [Extensions][COIL] Use [allow|block]list in //extensions/common

3372668

* Begin ScopedUserPrefUpdate migration to modern base::Value

3376154

* [Code Health] Refactor PrefService GetDict + GetList to use base::Value

3343526

* 3354997: [CodeHealth] Remove deprecated SetDictionary method

3354997

* 3287323: Add LacrosPrefStore for lacros settings

3287323

* 3365916: [PA] Clean up remaining lazy commit code

3365916

* [MPArch] Target the external protocol error at the responsible frame.

3011560

* Pass origin to RegisterNonNetworkSubresourceURLLoaderFactories

3350608

* Linux: Send OSCrypt raw encryption key to the Network Service

3320484

* [PlzServiceWorker] Remove remaining references to PlzServiceWorker.

3359441

* chore: fixup for lint

* 3327621: Fix tablet mode detection for Win 11.

3327621

* 3342428: ax_mac: move AXTextMarker conversion utils under ui umbrella

3342428

* 3353974: Mac: Use base::Feature for overlay features

3353974

* chore: bump chromium in DEPS to 99.0.4828.0

* chore: update patches

* chore: bump chromium in DEPS to 99.0.4837.0

* chore: update patches

* chore: update patches

* 3379142: Drop FALLTHROUGH macro
Ref: 3379142

* 3381749: C++17: Allow use of std::map::try_emplace and std::map::insert_or_assign
Ref: 3381749

* chore: bump chromium in DEPS to 99.0.4839.0

* chore: update patches

* chore: bump chromium in DEPS to 99.0.4840.0

* chore: bump chromium in DEPS to 99.0.4844.0

* 3395881: [api] Deprecate Local<v8::Context> v8::Object::CreationContext()

Ref: 3395881

* chore: update patches

* chore: bump chromium in DEPS to 100.0.4845.0

* chore: update patches

* chore: bump chromium in DEPS to 100.0.4847.0

* chore: update patches

* chore: bump chromium in DEPS to 100.0.4849.0

* chore: update patches

* chore: bump chromium in DEPS to 100.0.4851.0

* chore: bump chromium in DEPS to 100.0.4853.0

* update patches

* chore: update patches

* update patches

* 3383599: Fonts Access: Remove prototype that uses a font picker.

3383599

* 3404768: Remove ALLOW_UNUSED macros

3404768

* 3374762: Remove ignore_result.h

3374762

* 3399305: [unseasoned-pdf] Apply proper frame offsets for touch selections

3399305

* 3402210: [Extensions] Don't trigger unload event for already unloaded extension

3402210

* 3410912: Combine URLLoaderClient OnReceiveResponse and OnStartLoadingResponseBody.

3410912

* 3370428: Make the AuthSchemes policy support dynamic refresh

3370428

* 3407603: Finish ScopedUserPrefUpdate migration to modern base::Value

3407603

* 3378352: ozone/x11: move code from //ui/p/x11 to //ui/ozone/p/x11

3378352

* 3370810: Delete chrome/service, AKA the Cloud Print service process.

3370810

* chore: bump chromium in DEPS to 100.0.4855.0

* chore: update patches

* fixup! 3370810: Delete chrome/service, AKA the Cloud Print service process.

* revert 3348007 to fix windows build

* 3318572: [Code health] Fix gn check errors in //extensions/browser:*

3318572

* fix printing.patch

* fix iwyu issue

* 3408515: win: Make ShorcutOperation an enum class and modernize names

3408515

* 3388333: [UIA] Remove dead code accessibility_misc_utils.h/cc

3388333

* fix windows build? i hope

* patch gn visibility of //ui/ozone/platform/x11

* missing include base/logging.h

* use BUILDFLAG for USE_NSS_CERTS

3379123

* defined(OS_*) ==> BUILDFLAG(IS_*)

https://bugs.chromium.org/p/chromium/issues/detail?id=1234043

* fixup! 3404768: Remove ALLOW_UNUSED macros

* another attempt to fix windows build

* temporarily disable the custom scheme service worker test

https://github.com/electron/electron/issues/32664

* fix loading mv3 extensions

not sure what cl broke this unfort.

* fixup! 3404768: Remove ALLOW_UNUSED macros

* patch nan

3395880

* fix node test

* fix nullptr in FindPdfFrame

* patch perfetto to fix build issue on win-ia32

bc44c3c753

* fix build for linux-x64-testing-no-run-as-node

* fix patch

* skip <webview>.capturePage() test

https://github.com/electron/electron/issues/32705

* test: fix failing tests of focus/blur events of WebContents (#32711)

* inherit stdio from app module test child processes

this prevents them from timing out due to full stdout buffers

* test to see if we can get better logs on windows ci

* try again for appveyor log things

* skip contentTracing tests on ia32

* ci: disable gpu compositing

* drop applied patch

* fix merge fail

* Revert "ci: disable gpu compositing"

This reverts commit 0344129fcb19ea3e87e06c1110d751f22eba3fec.

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: VerteDinde <khammond@slack-corp.com>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
This commit is contained in:
electron-roller[bot] 2022-02-09 18:58:52 -08:00 committed by GitHub
parent e9a43be9be
commit 28ada6ea8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
279 changed files with 1681 additions and 2236 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/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc
index 0de0532d64897c91ce0f72d165976e12e1dec03e..735da67a83b10c56d747e2a2b512f7b7d1aae142 100644
index fb0418a0c5337345c67b3692d16871047e0d1b11..a5cceb8c68a05240394479c79f8304f57c192940 100644
--- a/chrome/browser/printing/print_job.cc
+++ b/chrome/browser/printing/print_job.cc
@@ -88,6 +88,7 @@ bool PrintWithReducedRasterization(PrefService* prefs) {
@ -28,7 +28,7 @@ index 0de0532d64897c91ce0f72d165976e12e1dec03e..735da67a83b10c56d747e2a2b512f7b7
}
+#endif
#endif // defined(OS_WIN)
#endif // BUILDFLAG(IS_WIN)
@@ -355,8 +357,10 @@ void PrintJob::StartPdfToEmfConversion(
@ -55,7 +55,7 @@ index 0de0532d64897c91ce0f72d165976e12e1dec03e..735da67a83b10c56d747e2a2b512f7b7
: PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3;
}
diff --git a/chrome/browser/printing/print_job.h b/chrome/browser/printing/print_job.h
index e19f62354edb8acad722c6680296b7d2f55f51fe..51c41b4dbab81ffe5840d59ef45b661cf5c5534b 100644
index f922dc5c61ec85e6102a8e92b1b7096382dec6f0..477db7fa8517df9d4b09467ea569af3fe4c4f78c 100644
--- a/chrome/browser/printing/print_job.h
+++ b/chrome/browser/printing/print_job.h
@@ -257,6 +257,9 @@ class JobEventDetails : public base::RefCountedThreadSafe<JobEventDetails> {
@ -69,7 +69,7 @@ index e19f62354edb8acad722c6680296b7d2f55f51fe..51c41b4dbab81ffe5840d59ef45b661c
NEW_DOC,
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
index d8f67ab5116483eb2eeb4cc09f19bbcbccb74b37..4283a5743c695a7376722f80925722d9e7a6496e 100644
index fc26fd8f32e4c1edd3ca41baf0e9cdd482b25c03..aeaa88bee6b4ce499c361e1b2e93bf5fb0fd31ea 100644
--- a/chrome/browser/printing/print_job_worker.cc
+++ b/chrome/browser/printing/print_job_worker.cc
@@ -20,13 +20,13 @@
@ -87,13 +87,13 @@ index d8f67ab5116483eb2eeb4cc09f19bbcbccb74b37..4283a5743c695a7376722f80925722d9
#include "printing/backend/print_backend.h"
#include "printing/buildflags/buildflags.h"
#include "printing/mojom/print.mojom.h"
@@ -245,16 +245,21 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
#endif // defined(OS_LINUX) && defined(USE_CUPS)
@@ -239,16 +239,21 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
#endif // BUILDFLAG(IS_LINUX) && defined(USE_CUPS)
}
- mojom::ResultCode result;
{
#if defined(OS_WIN)
#if BUILDFLAG(IS_WIN)
// Blocking is needed here because Windows printer drivers are oftentimes
// not thread-safe and have to be accessed on the UI thread.
base::ScopedAllowBlocking allow_blocking;
@ -111,9 +111,22 @@ index d8f67ab5116483eb2eeb4cc09f19bbcbccb74b37..4283a5743c695a7376722f80925722d9
- GetSettingsDone(std::move(callback), result);
}
#if defined(OS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS)
diff --git a/chrome/browser/printing/print_job_worker_oop.cc b/chrome/browser/printing/print_job_worker_oop.cc
index f8e48861a2964da636afd767c0034d782ee52d6e..174d51d3b6d9f0131be36cf80199b27875d23960 100644
--- a/chrome/browser/printing/print_job_worker_oop.cc
+++ b/chrome/browser/printing/print_job_worker_oop.cc
@@ -209,7 +209,7 @@ void PrintJobWorkerOop::OnFailure() {
}
void PrintJobWorkerOop::ShowErrorDialog() {
- ShowPrintErrorDialog();
+ // [electron]: removed.
}
void PrintJobWorkerOop::UnregisterServiceManagerClient() {
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
index c9f1502da55d89de0eede73a7d39047c090594d0..c857a48e00c3535c74691f4e36d44e0478e3b15c 100644
index c759b7a7c9d197f4760a2d86f976a965a44abf9a..2d528020ba6c6411e6fd6d47ea1dd6d2e220f675 100644
--- a/chrome/browser/printing/print_view_manager_base.cc
+++ b/chrome/browser/printing/print_view_manager_base.cc
@@ -29,10 +29,10 @@
@ -208,10 +221,10 @@ index c9f1502da55d89de0eede73a7d39047c090594d0..c857a48e00c3535c74691f4e36d44e04
+ bool silent,
+ base::Value settings,
+ CompletionCallback callback) {
auto weak_this = weak_ptr_factory_.GetWeakPtr();
DisconnectFromCurrentPrintJob();
if (!weak_this)
@@ -347,7 +360,9 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
// Remember the ID for `rfh`, to enable checking that the `RenderFrameHost`
// is still valid after a possible inner message loop runs in
// `DisconnectFromCurrentPrintJob()`.
@@ -355,7 +368,9 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
// go in `ReleasePrintJob()`.
SetPrintingRFH(rfh);
@ -222,7 +235,7 @@ index c9f1502da55d89de0eede73a7d39047c090594d0..c857a48e00c3535c74691f4e36d44e04
for (auto& observer : GetObservers())
observer.OnPrintNow(rfh);
@@ -491,7 +506,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply(
@@ -499,7 +514,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply(
void PrintViewManagerBase::ScriptedPrintReply(
ScriptedPrintCallback callback,
int process_id,
@ -232,7 +245,7 @@ index c9f1502da55d89de0eede73a7d39047c090594d0..c857a48e00c3535c74691f4e36d44e04
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (!content::RenderProcessHost::FromID(process_id)) {
@@ -499,16 +515,19 @@ void PrintViewManagerBase::ScriptedPrintReply(
@@ -507,16 +523,19 @@ void PrintViewManagerBase::ScriptedPrintReply(
return;
}
@ -256,7 +269,7 @@ index c9f1502da55d89de0eede73a7d39047c090594d0..c857a48e00c3535c74691f4e36d44e04
}
void PrintViewManagerBase::NavigationStopped() {
@@ -622,12 +641,13 @@ void PrintViewManagerBase::DidPrintDocument(
@@ -630,12 +649,13 @@ void PrintViewManagerBase::DidPrintDocument(
void PrintViewManagerBase::GetDefaultPrintSettings(
GetDefaultPrintSettingsCallback callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@ -271,7 +284,7 @@ index c9f1502da55d89de0eede73a7d39047c090594d0..c857a48e00c3535c74691f4e36d44e04
content::RenderFrameHost* render_frame_host = GetCurrentTargetFrame();
auto callback_wrapper =
base::BindOnce(&PrintViewManagerBase::GetDefaultPrintSettingsReply,
@@ -645,18 +665,20 @@ void PrintViewManagerBase::UpdatePrintSettings(
@@ -653,18 +673,20 @@ void PrintViewManagerBase::UpdatePrintSettings(
base::Value job_settings,
UpdatePrintSettingsCallback callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@ -293,7 +306,7 @@ index c9f1502da55d89de0eede73a7d39047c090594d0..c857a48e00c3535c74691f4e36d44e04
content::BrowserContext* context =
web_contents() ? web_contents()->GetBrowserContext() : nullptr;
PrefService* prefs =
@@ -666,6 +688,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
@@ -674,6 +696,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
if (value > 0)
job_settings.SetIntKey(kSettingRasterizePdfDpi, value);
}
@ -301,7 +314,7 @@ index c9f1502da55d89de0eede73a7d39047c090594d0..c857a48e00c3535c74691f4e36d44e04
auto callback_wrapper =
base::BindOnce(&PrintViewManagerBase::UpdatePrintSettingsReply,
@@ -691,7 +714,7 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
@@ -699,7 +722,7 @@ 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);
@ -310,7 +323,7 @@ index c9f1502da55d89de0eede73a7d39047c090594d0..c857a48e00c3535c74691f4e36d44e04
return;
}
int process_id = render_process_host->GetID();
@@ -714,7 +737,6 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie) {
@@ -722,7 +745,6 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie) {
PrintManager::PrintingFailed(cookie);
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
@ -318,7 +331,7 @@ index c9f1502da55d89de0eede73a7d39047c090594d0..c857a48e00c3535c74691f4e36d44e04
#endif
ReleasePrinterQuery();
@@ -729,6 +751,11 @@ void PrintViewManagerBase::RemoveObserver(Observer& observer) {
@@ -737,6 +759,11 @@ void PrintViewManagerBase::RemoveObserver(Observer& observer) {
}
void PrintViewManagerBase::ShowInvalidPrinterSettingsError() {
@ -330,7 +343,7 @@ index c9f1502da55d89de0eede73a7d39047c090594d0..c857a48e00c3535c74691f4e36d44e04
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(&ShowWarningMessageBox,
l10n_util::GetStringUTF16(
@@ -739,8 +766,10 @@ void PrintViewManagerBase::RenderFrameHostStateChanged(
@@ -747,8 +774,10 @@ void PrintViewManagerBase::RenderFrameHostStateChanged(
content::RenderFrameHost* render_frame_host,
content::RenderFrameHost::LifecycleState /*old_state*/,
content::RenderFrameHost::LifecycleState new_state) {
@ -341,7 +354,7 @@ index c9f1502da55d89de0eede73a7d39047c090594d0..c857a48e00c3535c74691f4e36d44e04
}
void PrintViewManagerBase::DidStartLoading() {
@@ -808,6 +837,11 @@ void PrintViewManagerBase::OnJobDone() {
@@ -816,6 +845,11 @@ void PrintViewManagerBase::OnJobDone() {
ReleasePrintJob();
}
@ -353,7 +366,7 @@ index c9f1502da55d89de0eede73a7d39047c090594d0..c857a48e00c3535c74691f4e36d44e04
void PrintViewManagerBase::OnFailed() {
TerminatePrintJob(true);
}
@@ -869,7 +903,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
@@ -877,7 +911,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
// Disconnect the current |print_job_|.
auto weak_this = weak_ptr_factory_.GetWeakPtr();
@ -365,7 +378,7 @@ index c9f1502da55d89de0eede73a7d39047c090594d0..c857a48e00c3535c74691f4e36d44e04
if (!weak_this)
return false;
@@ -944,6 +981,13 @@ void PrintViewManagerBase::ReleasePrintJob() {
@@ -952,6 +989,13 @@ void PrintViewManagerBase::ReleasePrintJob() {
content::RenderFrameHost* rfh = printing_rfh_;
printing_rfh_ = nullptr;
@ -379,7 +392,7 @@ index c9f1502da55d89de0eede73a7d39047c090594d0..c857a48e00c3535c74691f4e36d44e04
if (!print_job_)
return;
@@ -989,7 +1033,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
@@ -1001,7 +1045,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
}
bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) {
@ -389,7 +402,7 @@ index c9f1502da55d89de0eede73a7d39047c090594d0..c857a48e00c3535c74691f4e36d44e04
if (!cookie) {
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
index 5771a3ebd76145c6cf8a2ccc33abc886802ed59f..fb3af5e3f57f868fd00716f76f70aa63c4cb99c9 100644
index 2661776307f773ac8f2c62529ec86349b045ee8f..4fa8f358ee59baed32ef4fd0684d010256206a54 100644
--- a/chrome/browser/printing/print_view_manager_base.h
+++ b/chrome/browser/printing/print_view_manager_base.h
@@ -37,6 +37,8 @@ namespace printing {
@ -412,7 +425,7 @@ index 5771a3ebd76145c6cf8a2ccc33abc886802ed59f..fb3af5e3f57f868fd00716f76f70aa63
+ CompletionCallback callback);
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Prints the document in |print_data| with settings specified in
// Prints the document in `print_data` with settings specified in
@@ -106,6 +111,7 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
ScriptedPrintCallback callback) override;
void ShowInvalidPrinterSettingsError() override;
@ -421,7 +434,7 @@ index 5771a3ebd76145c6cf8a2ccc33abc886802ed59f..fb3af5e3f57f868fd00716f76f70aa63
// Adds and removes observers for `PrintViewManagerBase` events. The order in
// which notifications are sent to observers is undefined. Observers must be
@@ -197,7 +203,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -193,7 +199,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
// Runs `callback` with `params` to reply to ScriptedPrint().
void ScriptedPrintReply(ScriptedPrintCallback callback,
int process_id,
@ -431,7 +444,7 @@ index 5771a3ebd76145c6cf8a2ccc33abc886802ed59f..fb3af5e3f57f868fd00716f76f70aa63
// 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
@@ -252,9 +259,15 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -248,9 +255,15 @@ 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;
@ -470,7 +483,7 @@ index 51ebcb4ae399018d3fd8566656596a7ef1f148af..c0fbff95137e2e5bccb9702a8cc858df
// Tells the browser that there are invalid printer settings.
ShowInvalidPrinterSettingsError();
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
index 650b5550f982fa5c5c522efaa9b8e305b7edc5e7..1b776a614d6e0f6c3ae13ef3c705bc19544cfe12 100644
index eca58f84556152ef813283332f47b08f721693ac..ca415069a57932b3883d9975da3b0625c9209ba9 100644
--- a/components/printing/renderer/print_render_frame_helper.cc
+++ b/components/printing/renderer/print_render_frame_helper.cc
@@ -39,6 +39,7 @@
@ -481,7 +494,7 @@ index 650b5550f982fa5c5c522efaa9b8e305b7edc5e7..1b776a614d6e0f6c3ae13ef3c705bc19
#include "printing/units.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
@@ -1226,7 +1227,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
@@ -1253,7 +1254,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
if (!weak_this)
return;
@ -491,7 +504,7 @@ index 650b5550f982fa5c5c522efaa9b8e305b7edc5e7..1b776a614d6e0f6c3ae13ef3c705bc19
if (!weak_this)
return;
@@ -1257,7 +1259,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
@@ -1284,7 +1286,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
receivers_.Add(this, std::move(receiver));
}
@ -500,7 +513,7 @@ index 650b5550f982fa5c5c522efaa9b8e305b7edc5e7..1b776a614d6e0f6c3ae13ef3c705bc19
ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr());
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
return;
@@ -1272,7 +1274,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
@@ -1299,7 +1301,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
// plugin node and print that instead.
auto plugin = delegate_->GetPdfElement(frame);
@ -509,7 +522,7 @@ index 650b5550f982fa5c5c522efaa9b8e305b7edc5e7..1b776a614d6e0f6c3ae13ef3c705bc19
if (!render_frame_gone_)
frame->DispatchAfterPrintEvent();
@@ -1303,7 +1305,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
@@ -1330,7 +1332,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
}
Print(frame, print_preview_context_.source_node(),
@ -519,7 +532,7 @@ index 650b5550f982fa5c5c522efaa9b8e305b7edc5e7..1b776a614d6e0f6c3ae13ef3c705bc19
if (!render_frame_gone_)
print_preview_context_.DispatchAfterPrintEvent();
// WARNING: |this| may be gone at this point. Do not do any more work here and
@@ -1350,6 +1353,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) {
@@ -1377,6 +1380,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) {
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
return;
@ -528,7 +541,7 @@ index 650b5550f982fa5c5c522efaa9b8e305b7edc5e7..1b776a614d6e0f6c3ae13ef3c705bc19
print_preview_context_.OnPrintPreview();
if (print_preview_context_.IsForArc()) {
@@ -1886,7 +1891,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
@@ -1914,7 +1919,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
return;
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
@ -538,7 +551,7 @@ index 650b5550f982fa5c5c522efaa9b8e305b7edc5e7..1b776a614d6e0f6c3ae13ef3c705bc19
// Check if |this| is still valid.
if (!weak_this)
return;
@@ -1901,7 +1907,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
@@ -1929,7 +1935,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
const blink::WebNode& node,
@ -549,7 +562,7 @@ index 650b5550f982fa5c5c522efaa9b8e305b7edc5e7..1b776a614d6e0f6c3ae13ef3c705bc19
// If still not finished with earlier print request simply ignore.
if (prep_frame_view_)
return;
@@ -1909,7 +1917,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
@@ -1937,7 +1945,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
FrameReference frame_ref(frame);
uint32_t expected_page_count = 0;
@ -558,7 +571,7 @@ index 650b5550f982fa5c5c522efaa9b8e305b7edc5e7..1b776a614d6e0f6c3ae13ef3c705bc19
DidFinishPrinting(FAIL_PRINT_INIT);
return; // Failed to init print page settings.
}
@@ -1928,8 +1936,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
@@ -1956,8 +1964,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
print_pages_params_->params->print_scaling_option;
auto self = weak_ptr_factory_.GetWeakPtr();
@ -575,7 +588,7 @@ index 650b5550f982fa5c5c522efaa9b8e305b7edc5e7..1b776a614d6e0f6c3ae13ef3c705bc19
// Check if |this| is still valid.
if (!self)
return;
@@ -2177,36 +2192,51 @@ void PrintRenderFrameHelper::IPCProcessed() {
@@ -2205,36 +2220,51 @@ void PrintRenderFrameHelper::IPCProcessed() {
}
}
@ -639,7 +652,7 @@ index 650b5550f982fa5c5c522efaa9b8e305b7edc5e7..1b776a614d6e0f6c3ae13ef3c705bc19
notify_browser_of_print_failure_ = false;
GetPrintManagerHost()->ShowInvalidPrinterSettingsError();
return false;
@@ -2350,7 +2380,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser(
@@ -2378,7 +2408,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser(
std::move(params),
base::BindOnce(
[](base::OnceClosure quit_closure, mojom::PrintPagesParamsPtr* output,
@ -648,7 +661,7 @@ index 650b5550f982fa5c5c522efaa9b8e305b7edc5e7..1b776a614d6e0f6c3ae13ef3c705bc19
*output = std::move(input);
std::move(quit_closure).Run();
},
@@ -2579,18 +2609,7 @@ void PrintRenderFrameHelper::RequestPrintPreview(PrintPreviewRequestType type) {
@@ -2623,18 +2653,7 @@ void PrintRenderFrameHelper::RequestPrintPreview(PrintPreviewRequestType type,
}
bool PrintRenderFrameHelper::CheckForCancel() {
@ -669,10 +682,10 @@ index 650b5550f982fa5c5c522efaa9b8e305b7edc5e7..1b776a614d6e0f6c3ae13ef3c705bc19
bool PrintRenderFrameHelper::PreviewPageRendered(
diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h
index 90236920457c931c86426049c6cbc30b592b597f..353178863eba37b9112e784ffa4b3519076e91b9 100644
index 2b703118bf94a82262adc293368dcfcdb67807ff..a07f307ff48f3ce5409354a5ba8d54b43325da73 100644
--- a/components/printing/renderer/print_render_frame_helper.h
+++ b/components/printing/renderer/print_render_frame_helper.h
@@ -256,7 +256,7 @@ class PrintRenderFrameHelper
@@ -254,7 +254,7 @@ class PrintRenderFrameHelper
mojo::PendingAssociatedReceiver<mojom::PrintRenderFrame> receiver);
// printing::mojom::PrintRenderFrame:
@ -681,7 +694,7 @@ index 90236920457c931c86426049c6cbc30b592b597f..353178863eba37b9112e784ffa4b3519
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
void PrintForSystemDialog() override;
void SetPrintPreviewUI(
@@ -323,7 +323,9 @@ class PrintRenderFrameHelper
@@ -321,7 +321,9 @@ class PrintRenderFrameHelper
// WARNING: |this| may be gone after this method returns.
void Print(blink::WebLocalFrame* frame,
const blink::WebNode& node,
@ -692,7 +705,7 @@ index 90236920457c931c86426049c6cbc30b592b597f..353178863eba37b9112e784ffa4b3519
// Notification when printing is done - signal tear-down/free resources.
void DidFinishPrinting(PrintingResult result);
@@ -332,12 +334,14 @@ class PrintRenderFrameHelper
@@ -330,12 +332,14 @@ class PrintRenderFrameHelper
// Initialize print page settings with default settings.
// Used only for native printing workflow.
@ -710,7 +723,7 @@ index 90236920457c931c86426049c6cbc30b592b597f..353178863eba37b9112e784ffa4b3519
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Set options for print preset from source PDF document.
diff --git a/printing/printing_context.cc b/printing/printing_context.cc
index f8f0f4bdfbb8db883f883f62f9d6e4b987d7b113..c2505f5e0049dc7ee8783056538ca4c2d0968744 100644
index 3d8281c8af9a4339bdd492c67edafc4ec6efb09d..6f8b9d42e051579cf1d0774afa771a7e45d31ff2 100644
--- a/printing/printing_context.cc
+++ b/printing/printing_context.cc
@@ -120,7 +120,6 @@ mojom::ResultCode PrintingContext::UsePdfSettings() {
@ -722,12 +735,12 @@ index f8f0f4bdfbb8db883f883f62f9d6e4b987d7b113..c2505f5e0049dc7ee8783056538ca4c2
std::unique_ptr<PrintSettings> settings =
PrintSettingsFromJobSettings(job_settings);
diff --git a/printing/printing_context.h b/printing/printing_context.h
index 7d937e7e3f19df351d410185fc4dc3b7c8937f2e..e87170e6957733f06bcc296bcca3fc331557ed46 100644
index 3f36303105b7979a1a771bf26b42596abe5b3cce..52f740bb832db4a8d76431d9bc77cab10bb7e0c7 100644
--- a/printing/printing_context.h
+++ b/printing/printing_context.h
@@ -175,6 +175,9 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext {
@@ -170,6 +170,9 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext {
std::unique_ptr<PrintSettings> TakeAndResetSettings();
bool PrintingAborted() const { return abort_printing_; }
+ // Reinitializes the settings for object reuse.
+ void ResetSettings();
@ -735,7 +748,7 @@ index 7d937e7e3f19df351d410185fc4dc3b7c8937f2e..e87170e6957733f06bcc296bcca3fc33
int job_id() const { return job_id_; }
protected:
@@ -185,9 +188,6 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext {
@@ -180,9 +183,6 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext {
static std::unique_ptr<PrintingContext> CreateImpl(Delegate* delegate,
bool skip_system_calls);