electron/patches/chromium/notification_provenance.patch
electron-roller[bot] 4bcbc955dd
chore: bump chromium to 130.0.6695.0 (main) (#43454)
* chore: bump chromium in DEPS to 130.0.6673.0

* chore: bump chromium in DEPS to 130.0.6675.0

* chore: bump chromium in DEPS to 130.0.6677.2

* chore: bump chromium in DEPS to 130.0.6679.0

* 5802981: [Partitioned Popins] UKM

https://chromium-review.googlesource.com/c/chromium/src/+/5802981

* 5799275: ash: Create //chrome/browser/ui/ash/web_view

https://chromium-review.googlesource.com/c/chromium/src/+/5799275

* 5791853: [PWA] Allow WebContentsImpl::CreateNewWindow() to use new web contents for loading url

https://chromium-review.googlesource.com/c/chromium/src/+/5791853

* 5805208: Move third_party/jacoco to a cipd/ subdirectory.

https://chromium-review.googlesource.com/c/chromium/src/+/5805208

* chore: fixup patch indices

* 5771091: Introduce InputManager class for handling input in Viz.

https://chromium-review.googlesource.com/c/chromium/src/+/5771091

* 5498921: [Permission] Remove SubscribeToPermissionStatusChange from PermissionManager

https://chromium-review.googlesource.com/c/chromium/src/+/5498921

* 5791853: [PWA] Allow WebContentsImpl::CreateNewWindow() to use new web contents for loading url

https://chromium-review.googlesource.com/c/chromium/src/+/5791853

* 5801311: Don't use int for bindings

https://chromium-review.googlesource.com/c/chromium/src/+/5801311

* 5548827: [Web Install] Define the web-app-installation PermissionPolicy

https://chromium-review.googlesource.com/c/chromium/src/+/5548827

* 5786325: Add Infrastructure for Hand tracking permission

https://chromium-review.googlesource.com/c/chromium/src/+/5786325

* chore: fixup patch indices

* chore: bump chromium in DEPS to 130.0.6681.0

* [Views AX] Move BrowserAccessibility* to //ui/accessibility/platform

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5520052

* chore: e patches all

* Don't have default arguments on virtual functions in render_frame_host.h

https://chromium-review.googlesource.com/c/chromium/src/+/5809399

* test: log if loadURL fails in base url test

* chore: bump chromium in DEPS to 130.0.6683.2

* chore: fix support_mixed_sandbox_with_zygote.patch

content: restore old DisableJit behavior

https://chromium-review.googlesource.com/c/chromium/src/+/5804255

* chore: update patch indices

* chore: bump chromium in DEPS to 130.0.6685.0

* Parallel process launching

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5015584

* chore: update feat_expose_documentloader_setdefersloading_on_webdocumentloader.patch

No manual changes; patch applied with fuzz 1

* chore: e patches all

* chore: bump chromium in DEPS to 130.0.6687.0

* chore: bump chromium in DEPS to 130.0.6689.0

* chore: bump chromium in DEPS to 130.0.6691.0

* chore: bump chromium in DEPS to 130.0.6693.0

* chore: update patches

* chore: bump chromium in DEPS to 130.0.6695.0

* chore: free up macos disk space as soon as possible

* 5824143: Use checked in source lists for third_party/boringssl

https://chromium-review.googlesource.com/c/chromium/src/+/5824143

* chore: update patches

* 5824122: Extensions: Add a new view type enum for developer tools contexts

https://chromium-review.googlesource.com/c/chromium/src/+/5824122

* 5806109: Option for JavaScriptExecuteRequestForTests() to ignore content settings

https://chromium-review.googlesource.com/c/chromium/src/+/5806109

* build: free up disk space on gn check too

* 5799369: [Refactoring] Make allow_http1_for_streaming_upload flags false.

https://chromium-review.googlesource.com/c/chromium/src/+/5799369

* fixup! 5015584: Parallel process launching | https://chromium-review.googlesource.com/c/chromium/src/+/5015584

* Disable failing test for short-term

See: https://github.com/electron/electron/issues/43730

* oops

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: clavin <clavin@electronjs.org>
2024-09-17 18:12:11 -07:00

201 lines
11 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <jeremya@chromium.org>
Date: Fri, 5 Oct 2018 14:22:06 -0700
Subject: notification_provenance.patch
Pass RenderFrameHost through to PlatformNotificationService
so Electron can identify which renderer a notification came from.
diff --git a/chrome/browser/notifications/platform_notification_service_impl.cc b/chrome/browser/notifications/platform_notification_service_impl.cc
index 412e1fb55f901c573455fbea722f5f371e0c0566..725b67ea1ab00bc3a834221a77e2b722b8720032 100644
--- a/chrome/browser/notifications/platform_notification_service_impl.cc
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc
@@ -218,6 +218,7 @@ bool PlatformNotificationServiceImpl::WasClosedProgrammatically(
// TODO(awdf): Rename to DisplayNonPersistentNotification (Similar for Close)
void PlatformNotificationServiceImpl::DisplayNotification(
+ content::RenderFrameHost* render_frame_host,
const std::string& notification_id,
const GURL& origin,
const GURL& document_url,
diff --git a/chrome/browser/notifications/platform_notification_service_impl.h b/chrome/browser/notifications/platform_notification_service_impl.h
index c173f8a6cde9ab519075987fa451afb63c6580a9..4a1f128d9252a4a858d5ba8c6991bb183de7f064 100644
--- a/chrome/browser/notifications/platform_notification_service_impl.h
+++ b/chrome/browser/notifications/platform_notification_service_impl.h
@@ -57,6 +57,7 @@ class PlatformNotificationServiceImpl
// content::PlatformNotificationService implementation.
void DisplayNotification(
+ content::RenderFrameHost* render_frame_host,
const std::string& notification_id,
const GURL& origin,
const GURL& document_url,
diff --git a/content/browser/notifications/blink_notification_service_impl.cc b/content/browser/notifications/blink_notification_service_impl.cc
index 027ba5088355441ed2dd1abe563277df7c1d3737..65837dcf0c2cd0bcc0c000fc3fe5eb2ddd6f7b5f 100644
--- a/content/browser/notifications/blink_notification_service_impl.cc
+++ b/content/browser/notifications/blink_notification_service_impl.cc
@@ -87,12 +87,14 @@ BlinkNotificationServiceImpl::BlinkNotificationServiceImpl(
BrowserContext* browser_context,
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
RenderProcessHost* render_process_host,
+ RenderFrameHost* render_frame_host,
const blink::StorageKey& storage_key,
const GURL& document_url,
const WeakDocumentPtr& weak_document_ptr,
RenderProcessHost::NotificationServiceCreatorType creator_type,
mojo::PendingReceiver<blink::mojom::NotificationService> receiver)
: notification_context_(notification_context),
+ render_frame_host_(render_frame_host),
browser_context_(browser_context),
service_worker_context_(std::move(service_worker_context)),
render_process_host_id_(render_process_host->GetID()),
@@ -184,7 +186,7 @@ void BlinkNotificationServiceImpl::DisplayNonPersistentNotification(
creator_type_);
browser_context_->GetPlatformNotificationService()->DisplayNotification(
- notification_id, storage_key_.origin().GetURL(), document_url_,
+ render_frame_host_, notification_id, storage_key_.origin().GetURL(), document_url_,
platform_notification_data, notification_resources);
}
diff --git a/content/browser/notifications/blink_notification_service_impl.h b/content/browser/notifications/blink_notification_service_impl.h
index e7cc73f375ada7ee8715d331c3d372e0f59a0cdf..c0a142bea4a9a30c10dbb30c72fedce9ab4d1e62 100644
--- a/content/browser/notifications/blink_notification_service_impl.h
+++ b/content/browser/notifications/blink_notification_service_impl.h
@@ -44,6 +44,7 @@ class CONTENT_EXPORT BlinkNotificationServiceImpl
BrowserContext* browser_context,
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
RenderProcessHost* render_process_host,
+ RenderFrameHost* render_frame_host,
const blink::StorageKey& storage_key,
const GURL& document_url,
const WeakDocumentPtr& weak_document_ptr,
@@ -113,6 +114,7 @@ class CONTENT_EXPORT BlinkNotificationServiceImpl
raw_ptr<PlatformNotificationContextImpl, DanglingUntriaged>
notification_context_;
+ raw_ptr<RenderFrameHost> render_frame_host_;
raw_ptr<BrowserContext> browser_context_;
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_;
diff --git a/content/browser/notifications/blink_notification_service_impl_unittest.cc b/content/browser/notifications/blink_notification_service_impl_unittest.cc
index fe56b0bde4480765e5dffe5afb6ddf73ca8d63c8..93de0ace3dabf526d737897d42df35a5c2accab2 100644
--- a/content/browser/notifications/blink_notification_service_impl_unittest.cc
+++ b/content/browser/notifications/blink_notification_service_impl_unittest.cc
@@ -132,7 +132,7 @@ class BlinkNotificationServiceImplTest : public ::testing::Test {
notification_service_ = std::make_unique<BlinkNotificationServiceImpl>(
notification_context_.get(), &browser_context_,
embedded_worker_helper_->context_wrapper(), &render_process_host_,
- storage_key_,
+ nullptr, storage_key_,
/*document_url=*/GURL(),
contents_.get()->GetPrimaryMainFrame()->GetWeakDocumentPtr(),
RenderProcessHost::NotificationServiceCreatorType::kDocument,
diff --git a/content/browser/notifications/platform_notification_context_impl.cc b/content/browser/notifications/platform_notification_context_impl.cc
index 77c6f5d3e5845b23a13d413cbf014c71bfd3482a..03b8449a8b8572441a0dde11da74b042f791ea70 100644
--- a/content/browser/notifications/platform_notification_context_impl.cc
+++ b/content/browser/notifications/platform_notification_context_impl.cc
@@ -280,6 +280,7 @@ void PlatformNotificationContextImpl::Shutdown() {
void PlatformNotificationContextImpl::CreateService(
RenderProcessHost* render_process_host,
+ RenderFrameHost* render_frame_host,
const blink::StorageKey& storage_key,
const GURL& document_url,
const WeakDocumentPtr& weak_document_ptr,
@@ -288,7 +289,7 @@ void PlatformNotificationContextImpl::CreateService(
DCHECK_CURRENTLY_ON(BrowserThread::UI);
services_.push_back(std::make_unique<BlinkNotificationServiceImpl>(
this, browser_context_, service_worker_context_, render_process_host,
- storage_key, document_url, weak_document_ptr, creator_type,
+ render_frame_host, storage_key, document_url, weak_document_ptr, creator_type,
std::move(receiver)));
}
diff --git a/content/browser/notifications/platform_notification_context_impl.h b/content/browser/notifications/platform_notification_context_impl.h
index 46b071609e56e8602b04d1cd9f5f4ebd7e4f4ae1..6092383e0f8f1c0d829a8ef8af53a78664457539 100644
--- a/content/browser/notifications/platform_notification_context_impl.h
+++ b/content/browser/notifications/platform_notification_context_impl.h
@@ -47,6 +47,7 @@ class PlatformNotificationServiceProxy;
class RenderProcessHost;
class ServiceWorkerContextWrapper;
class WeakDocumentPtr;
+class RenderFrameHost;
// Implementation of the Web Notification storage context. The public methods
// defined in this interface must only be called on the UI thread.
@@ -80,6 +81,7 @@ class CONTENT_EXPORT PlatformNotificationContextImpl
// service is created by a dedicated worker, or is `nullptr` otherwise.
void CreateService(
RenderProcessHost* render_process_host,
+ RenderFrameHost* render_frame_host,
const blink::StorageKey& storage_key,
const GURL& document_url,
const WeakDocumentPtr& weak_document_ptr,
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 2384b382b914746cd2870d70647cbd990baed933..4d3e038b4ebf53726c96f8de9898c14169199366 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -2045,7 +2045,7 @@ void RenderProcessHostImpl::CreateNotificationService(
case RenderProcessHost::NotificationServiceCreatorType::kSharedWorker:
case RenderProcessHost::NotificationServiceCreatorType::kDedicatedWorker: {
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
- this, storage_key, /*document_url=*/GURL(), weak_document_ptr,
+ this, rfh, storage_key, /*document_url=*/GURL(), weak_document_ptr,
creator_type, std::move(receiver));
break;
}
@@ -2053,7 +2053,7 @@ void RenderProcessHostImpl::CreateNotificationService(
CHECK(rfh);
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
- this, storage_key, rfh->GetLastCommittedURL(), weak_document_ptr,
+ this, rfh, storage_key, rfh->GetLastCommittedURL(), weak_document_ptr,
creator_type, std::move(receiver));
break;
}
diff --git a/content/public/browser/platform_notification_service.h b/content/public/browser/platform_notification_service.h
index 82db1db4175fb9f4ee7490d5a163164ef4495ecb..4f51683be14ba6ee657a290c7747969e052a88ca 100644
--- a/content/public/browser/platform_notification_service.h
+++ b/content/public/browser/platform_notification_service.h
@@ -26,6 +26,8 @@ struct PlatformNotificationData;
namespace content {
+class RenderFrameHost;
+
// The service using which notifications can be presented to the user. There
// should be a unique instance of the PlatformNotificationService depending
// on the browsing context being used.
@@ -41,6 +43,7 @@ class CONTENT_EXPORT PlatformNotificationService {
// This method must be called on the UI thread. |document_url| is empty when
// the display notification originates from a worker.
virtual void DisplayNotification(
+ RenderFrameHost* render_frame_host,
const std::string& notification_id,
const GURL& origin,
const GURL& document_url,
diff --git a/content/test/mock_platform_notification_service.cc b/content/test/mock_platform_notification_service.cc
index 32a0cf38389989d3e1c287ad4a3f26b6d3615370..8a788f243e913ef26246b5ea4ac4ac5c1dfc4b86 100644
--- a/content/test/mock_platform_notification_service.cc
+++ b/content/test/mock_platform_notification_service.cc
@@ -29,6 +29,7 @@ MockPlatformNotificationService::MockPlatformNotificationService(
MockPlatformNotificationService::~MockPlatformNotificationService() = default;
void MockPlatformNotificationService::DisplayNotification(
+ RenderFrameHost* render_frame_host,
const std::string& notification_id,
const GURL& origin,
const GURL& document_url,
diff --git a/content/test/mock_platform_notification_service.h b/content/test/mock_platform_notification_service.h
index 5e91d867ba1b04358ecb670ba407adc65793b417..a0c5eaafd9ec2242927fe9170e9acd4069f654a0 100644
--- a/content/test/mock_platform_notification_service.h
+++ b/content/test/mock_platform_notification_service.h
@@ -53,6 +53,7 @@ class MockPlatformNotificationService : public PlatformNotificationService {
// PlatformNotificationService implementation.
void DisplayNotification(
+ RenderFrameHost* render_frame_host,
const std::string& notification_id,
const GURL& origin,
const GURL& document_url,