d32e6cc252
* chore: bump chromium in DEPS to 105.0.5147.0 * chore: update chromium/can_create_window.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3642216 fix minor code shear in patch * chore: update chromium/port_autofill_colors_to_the_color_pipeline.patch Xref: chromium/port_autofill_colors_to_the_color_pipeline.patch fix minor code shear in patch * chore: remove chromium/posix_replace_doubleforkandexec_with_forkandspawn.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3727368 Removing upstreamed patch * chore: update patches * chore: update patches * chore: add new enum kOffscreenDocument to switch statement Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3722498 * chore: add stub for new parent virtual method OnNewCropVersion() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3717305 * chore: remove download_schedule arg from DownloadTargetCallback invocation Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3711096 Clean up DownloadLater flags and prefs * chore: add stub for new parent virtual method OnNewCropVersion() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3717305 * chore: use base::List for extensions::Event Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3718366 Remove Event constructor overloads that take vector<base::Value> * refactor: replace ClearStorageDataOptions.origin with .storage_key Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3702946 Refactor ClearData to take StorageKey * chore: bump chromium in DEPS to 105.0.5149.0 * chore: update patches * refactor: migrate InspectableWebContents to base::Value::List Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3726326 Migrate DevToolsEmbedderMessageDispatcher to base::Value::List. * refactor: update electron_api_clipboard_mac Clipboard::ReadFindText() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3721398 Mac: Remove unused FindPasteboard C++ interface * chore: bump chromium in DEPS to 105.0.5151.0 * chore: fix code shear in chromium/build_do_not_depend_on_packed_resource_integrity.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3714995 Move Cart DB proto to //components/commerce * Revert "chore: fix code shear in chromium/build_do_not_depend_on_packed_resource_integrity.patch" This reverts commit f8de4605eb3d35152b186646fefd8e88d1df836b. * chore: fix code shear in chromium/build_do_not_depend_on_packed_resource_integrity.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3714995 Move Cart DB proto to //components/commerce * chore: update patches * chore: update ElectronAccessibilityUIMessageHandler to use base::Value::List Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3733367 Convert /chrome/browser/accessibility away from WebUI::RegisterDeprecatedMessageCallback * chore: bump chromium in DEPS to 105.0.5153.0 * chore: bump chromium in DEPS to 105.0.5155.0 * chore: bump chromium in DEPS to 105.0.5157.0 * chore: bump chromium in DEPS to 105.0.5159.0 * chore: update patches * chore: update CL reference * Replace ContentMainDelegate::InvokedIn with a variant https://chromium-review.googlesource.com/c/chromium/src/+/3705957 * Switch devtools_frontend.mojom to mojom.DictValue. https://chromium-review.googlesource.com/c/chromium/src/+/3726425 * webhid: Bind HID service with service workers https://chromium-review.googlesource.com/c/chromium/src/+/3680562 * chore: fix lint * Don't fire load-complete AX notification on macOS for unfocused windows https://chromium-review.googlesource.com/c/chromium/src/+/3695403 * chore: update patches * chore: bump chromium in DEPS to 105.0.5165.0 * chore: update patches * chore: bump chromium in DEPS to 105.0.5167.0 * chore: bump chromium in DEPS to 105.0.5169.0 * chore: bump chromium in DEPS to 105.0.5171.0 * chore: update patches * chore: bump chromium in DEPS to 105.0.5173.0 * chore: update patches * 3743346: Stop generating unsupported policies on macOS https://chromium-review.googlesource.com/c/chromium/src/+/3743346 * 3727612: [Bluetooth][Win] Refactor pairing prompt code https://chromium-review.googlesource.com/c/chromium/src/+/3727612 * 3737325: system-extensions: Move IsEnabled() out of SystemExtensionsProvider. https://chromium-review.googlesource.com/c/chromium/src/+/3737325 * 3748635: Remove RenderView from the public API. https://chromium-review.googlesource.com/c/chromium/src/+/3748635 * fixup: 3743346: Stop generating unsupported policies on macOS Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
204 lines
11 KiB
Diff
204 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 17b9ed63bd839632a5eed5bcbaa3e990472761ef..09c266f1a99e42d6c417c294d7db1d6621ec0365 100644
|
|
--- a/chrome/browser/notifications/platform_notification_service_impl.cc
|
|
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc
|
|
@@ -197,6 +197,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 b0e64049d411305d58802fd290bb0480e9b36fee..4afcf3b7a5b841409b0e1c4c2f32fd4878f12768 100644
|
|
--- a/chrome/browser/notifications/platform_notification_service_impl.h
|
|
+++ b/chrome/browser/notifications/platform_notification_service_impl.h
|
|
@@ -56,6 +56,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 c969a5d35eac7b071b46d6a8106072e571f177a5..033618eda6e1e5b90a6e9b655e38f27bf051380a 100644
|
|
--- a/content/browser/notifications/blink_notification_service_impl.cc
|
|
+++ b/content/browser/notifications/blink_notification_service_impl.cc
|
|
@@ -83,11 +83,13 @@ BlinkNotificationServiceImpl::BlinkNotificationServiceImpl(
|
|
BrowserContext* browser_context,
|
|
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
|
|
RenderProcessHost* render_process_host,
|
|
+ RenderFrameHost* render_frame_host,
|
|
const url::Origin& origin,
|
|
const GURL& document_url,
|
|
const WeakDocumentPtr& weak_document_ptr,
|
|
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()),
|
|
@@ -152,7 +154,7 @@ void BlinkNotificationServiceImpl::DisplayNonPersistentNotification(
|
|
notification_id, std::move(event_listener_remote));
|
|
|
|
browser_context_->GetPlatformNotificationService()->DisplayNotification(
|
|
- notification_id, origin_.GetURL(), document_url_,
|
|
+ render_frame_host_, notification_id, 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 20db1f61b391f7b154071f24e91fd0925e3e0df2..4816ac66d1eebe0823844b07b146707db7727c21 100644
|
|
--- a/content/browser/notifications/blink_notification_service_impl.h
|
|
+++ b/content/browser/notifications/blink_notification_service_impl.h
|
|
@@ -43,6 +43,7 @@ class CONTENT_EXPORT BlinkNotificationServiceImpl
|
|
BrowserContext* browser_context,
|
|
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
|
|
RenderProcessHost* render_process_host,
|
|
+ RenderFrameHost* render_frame_host,
|
|
const url::Origin& origin,
|
|
const GURL& document_url,
|
|
const WeakDocumentPtr& weak_document_ptr,
|
|
@@ -104,6 +105,7 @@ class CONTENT_EXPORT BlinkNotificationServiceImpl
|
|
// The notification context that owns this service instance.
|
|
raw_ptr<PlatformNotificationContextImpl> 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 41fb02d532190e82d50286e2733a6c3627bf25c8..f19bb5dcb69233733125029d8f997f7343d7e04b 100644
|
|
--- a/content/browser/notifications/blink_notification_service_impl_unittest.cc
|
|
+++ b/content/browser/notifications/blink_notification_service_impl_unittest.cc
|
|
@@ -129,7 +129,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_,
|
|
- url::Origin::Create(GURL(kTestOrigin)),
|
|
+ nullptr, url::Origin::Create(GURL(kTestOrigin)),
|
|
/*document_url=*/GURL(),
|
|
/*weak_document_ptr=*/WeakDocumentPtr(),
|
|
notification_service_remote_.BindNewPipeAndPassReceiver());
|
|
diff --git a/content/browser/notifications/platform_notification_context_impl.cc b/content/browser/notifications/platform_notification_context_impl.cc
|
|
index 61ac1d7760432bd1a4118c0929a35168a3e26f49..e2ce4aa910053b1a4fb52fcc1197943af95b02f6 100644
|
|
--- a/content/browser/notifications/platform_notification_context_impl.cc
|
|
+++ b/content/browser/notifications/platform_notification_context_impl.cc
|
|
@@ -282,6 +282,7 @@ void PlatformNotificationContextImpl::Shutdown() {
|
|
|
|
void PlatformNotificationContextImpl::CreateService(
|
|
RenderProcessHost* render_process_host,
|
|
+ RenderFrameHost* render_frame_host,
|
|
const url::Origin& origin,
|
|
const GURL& document_url,
|
|
const WeakDocumentPtr& weak_document_ptr,
|
|
@@ -289,7 +290,8 @@ void PlatformNotificationContextImpl::CreateService(
|
|
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
|
services_.push_back(std::make_unique<BlinkNotificationServiceImpl>(
|
|
this, browser_context_, service_worker_context_, render_process_host,
|
|
- origin, document_url, weak_document_ptr, std::move(receiver)));
|
|
+ render_frame_host, origin, document_url, weak_document_ptr,
|
|
+ std::move(receiver)));
|
|
}
|
|
|
|
void PlatformNotificationContextImpl::RemoveService(
|
|
diff --git a/content/browser/notifications/platform_notification_context_impl.h b/content/browser/notifications/platform_notification_context_impl.h
|
|
index 424fae79eb1c93f1fac293ae8fdeb6d067f523cc..6a2f074ad981deb15b46bd91b6d7eb5de8612403 100644
|
|
--- a/content/browser/notifications/platform_notification_context_impl.h
|
|
+++ b/content/browser/notifications/platform_notification_context_impl.h
|
|
@@ -48,6 +48,7 @@ struct NotificationDatabaseData;
|
|
class PlatformNotificationServiceProxy;
|
|
class RenderProcessHost;
|
|
class ServiceWorkerContextWrapper;
|
|
+class RenderFrameHost;
|
|
|
|
// Implementation of the Web Notification storage context. The public methods
|
|
// defined in this interface must only be called on the UI thread.
|
|
@@ -78,6 +79,7 @@ class CONTENT_EXPORT PlatformNotificationContextImpl
|
|
// |document_url| is empty when originating from a worker.
|
|
void CreateService(
|
|
RenderProcessHost* render_process_host,
|
|
+ RenderFrameHost* render_frame_host,
|
|
const url::Origin& origin,
|
|
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 db1e97364a68fdc987274f2a7a940d9d63ac111e..8b236cbd54011bc0008d56ca4213920e478f7a90 100644
|
|
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
|
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
|
@@ -2059,8 +2059,9 @@ void RenderProcessHostImpl::CreateNotificationService(
|
|
// For workers:
|
|
if (render_frame_id == MSG_ROUTING_NONE) {
|
|
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
|
|
- this, origin, /*document_url=*/GURL(),
|
|
- /*weak_document_ptr=*/WeakDocumentPtr(), std::move(receiver));
|
|
+ this, RenderFrameHost::FromID(GetID(), render_frame_id), origin,
|
|
+ /*document_url=*/GURL(), /*weak_document_ptr=*/WeakDocumentPtr(),
|
|
+ std::move(receiver));
|
|
return;
|
|
}
|
|
|
|
@@ -2068,7 +2069,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
|
RenderFrameHost* rfh = RenderFrameHost::FromID(GetID(), render_frame_id);
|
|
CHECK(rfh);
|
|
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
|
|
- this, origin, rfh->GetLastCommittedURL(), rfh->GetWeakDocumentPtr(),
|
|
+ this, rfh, origin, rfh->GetLastCommittedURL(), rfh->GetWeakDocumentPtr(),
|
|
std::move(receiver));
|
|
}
|
|
|
|
diff --git a/content/public/browser/platform_notification_service.h b/content/public/browser/platform_notification_service.h
|
|
index 9646cbeb31141e3518f51482801431f3a6010360..b13b6ab07b4931b892749c84879d9a6adb3bcb58 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 7397963a36bec7016ae92fbc4bb741825e5fb8d1..d1818311fd657d3c099cdce41898daf4ab3ede8b 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 45ad11f0fc5f0abebbc05836221528e59da6c26b..7f914f69d597dbd149d554dc0282c27ed234c7ed 100644
|
|
--- a/content/test/mock_platform_notification_service.h
|
|
+++ b/content/test/mock_platform_notification_service.h
|
|
@@ -52,6 +52,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,
|