061e2e5e73
* chore: bump chromium in DEPS to 113.0.5645.0 * chore: update patches/chromium/mas_avoid_usage_of_private_macos_apis.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4300129 Fix simple code shear * chore: update patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4297496 Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4327491 patch-fuzz update; no manual changes * chore: remove patches/chromium/fix_x11_window_restore_minimized_maximized_window.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4252946 Upstreamed by zcbenz, so local patch is no longer needed * chore: update chromium/printing.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4313019 Remove cookie parameter from PrintViewManagerBase::UpdatePrintSettings() * chore: remove NOTIMPLEMENTED BrowserProcessImpl::GetBreadcrumbPersistentStorageManager() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4247145 method removed upstream, so we do not need to add a stub for it in the subclass * chore: remove PrintViewManagerElectron::UpdatePrintSettings() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4313019 Previously, our implementation checked to see if we recognized the cookie param that was passed in. If so, we reported a bad message. Otherwise, we passed it up to the base class' UpdatePrintSettings(). CL4313019 removed the cookie param, so checking for a bad cookie param is no longer necessary / no longer possible. Since the only remaining task was to pass the work up to the base class, this commit removes the subclass implmentation entirely. * chore: update patches * chore: bump chromium in DEPS to 113.0.5647.0 * chore: bump chromium in DEPS to 113.0.5649.2 * chore: bump chromium in DEPS to 113.0.5651.0 * chore: update patches --------- 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: deepak1556 <hop2deep@gmail.com>
201 lines
11 KiB
Diff
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 aa9ce8fa016317d543752462f356ccdef6b931eb..71fc184b94286803300c396fe4845e5f17911f55 100644
|
|
--- a/chrome/browser/notifications/platform_notification_service_impl.cc
|
|
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc
|
|
@@ -200,6 +200,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 380a2da617ff5e49f780f4b89d87ceefd75bb6f7..ec78a854531b7d52fbaa5de71fc5e67180fad8c8 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 688c95eeb2a1ea60b004eb643cb5afcff48c11bd..226d1e3f01f976d8b35e6b3fbd332683d1a0f84b 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 1c1a95953c6c216b378c2ab0bfbef6eeb19cc184..2f0ce853dbb28163aa30914b5bc31be7066d60a2 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,
|
|
@@ -112,6 +113,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 00965c253f28bd3947255b2ab77bf3a0bb71f14a..e04a7eef94990dfb0e2fca2e116352fe80965303 100644
|
|
--- a/content/browser/notifications/blink_notification_service_impl_unittest.cc
|
|
+++ b/content/browser/notifications/blink_notification_service_impl_unittest.cc
|
|
@@ -136,7 +136,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 aa04c672494e5ecb9ca43eb7e0d3b49bad01e29b..ff24af7f921dc86c00bfd7151dc8d70af6f1b99a 100644
|
|
--- a/content/browser/notifications/platform_notification_context_impl.cc
|
|
+++ b/content/browser/notifications/platform_notification_context_impl.cc
|
|
@@ -283,6 +283,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,
|
|
@@ -291,7 +292,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 bbd2aa78722fc0a14ac815ca0243b83965ad8d7c..b6e0a2fce3a0fb9c449aa1bef6a0f970ef5c2d07 100644
|
|
--- a/content/browser/notifications/platform_notification_context_impl.h
|
|
+++ b/content/browser/notifications/platform_notification_context_impl.h
|
|
@@ -45,6 +45,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
|
|
// 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 829a7a2d3966682bd43a6788fa4a7d0514df2d1b..0781fb499a0c490939c2b0a0cfa72efcdb5eb0cc 100644
|
|
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
|
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
|
@@ -2115,7 +2115,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;
|
|
}
|
|
@@ -2123,7 +2123,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 d9e36712dc3fbc6a9043e2c33660090ca2f7367b..7d910583eb22fc315eb0619febe518d5c24c0c4d 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 b3ef5af4450b3f96787bc3f9935dfdf19ebaaa94..6a4309070e0f6eaa743deefb0aeb2d0be558a787 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 7cd457defa729855c8d7c9d873efab5389d025cd..2b8e644d54d93a9499adcc1bf5660d72a24e2f29 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,
|