mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
* chore: bump chromium in DEPS to 148.0.7765.0 * chore: bump chromium in DEPS to 148.0.7766.0 * fix(patch-conflict): update packed_resources dep name after upstream rename Upstream renamed //chrome:packed_resources_integrity_header to //chrome:packed_resources. Updated the patch to guard the new dependency name with !is_electron_build while preserving the same intent. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7714543 Co-Authored-By: Claude <noreply@anthropic.com> * fix(patch-conflict): update code_cache_host_impl.cc for upstream includes and TODO Upstream added #include <stdint.h> and a TODO comment in code_cache_host_impl.cc which conflicted with the Electron code cache custom schemes patch. Resolved by keeping both upstream additions and the Electron ProcessLockURLIsCodeCacheScheme function. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7615151 Co-Authored-By: Claude <noreply@anthropic.com> * chore: update patch hunk headers Co-Authored-By: Claude <noreply@anthropic.com> * 7700837: update RecordContentToVisibleTimeRequest from mojom to native struct Upstream typemapped RecordContentToVisibleTimeRequest from a Mojo struct to a native C++ struct. Updated OSR virtual method signatures from blink::mojom::RecordContentToVisibleTimeRequestPtr to std::optional<blink::RecordContentToVisibleTimeRequest> and blink::RecordContentToVisibleTimeRequest to match. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7700837 Co-Authored-By: Claude <noreply@anthropic.com> * 7714579: update WebString::FromASCII to FromUTF8 Upstream renamed blink::WebString::FromASCII to FromAscii. Updated Electron's usage to FromUTF8 which is equivalent for ASCII scheme strings and avoids a dependency on the renamed method. Also fixed blink::String::FromUTF8 to use the String constructor directly. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7714579 Co-Authored-By: Claude <noreply@anthropic.com> * 7696480: add stream_info dep after StreamInfo extraction Upstream extracted extensions::StreamInfo from PdfViewerStreamManager to a standalone class in extensions/browser/mime_handler/stream_info.h. Added the new target as a dependency since Electron's streams_private and pdf_viewer_private APIs use PdfViewerStreamManager which now depends on the separate StreamInfo target. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7696480 Co-Authored-By: Claude <noreply@anthropic.com> * chore: bump chromium in DEPS to 148.0.7768.0 * fix(patch-conflict): update PiP patch for new toggle_mute_button in overlay window Upstream added a toggle_mute_button to the live caption dialog controls in VideoOverlayWindowViews::SetLiveCaptionDialogVisibility. Extended the existing #if 0 guard to include the new button handling since Electron disables live caption dialog functionality. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7682308 Co-Authored-By: Claude <noreply@anthropic.com> * fix(patch-conflict): update packed_resource_integrity patch after upstream dep removal Upstream removed the deps += [ "//chrome:packed_resources" ] line from the if (!is_win) block in chrome/browser/BUILD.gn. The Electron patch no longer needs to guard this dep with !is_electron_build in this location since the dep was already relocated by an earlier upstream CL. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7714543 Co-Authored-By: Claude <noreply@anthropic.com> * fix(patch-conflict): update WebSocket throttling revert for DisconnectWebSocketOnBFCache guard Upstream added a DisconnectWebSocketOnBFCacheEnabled() runtime feature check that wraps the WebSocket BFCache feature registration. Updated the Electron revert patch to place the kAllowAggressiveThrottlingWithWebSocket ternary inside the new conditional guard. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7698838 Co-Authored-By: Claude <noreply@anthropic.com> * fix(patch-conflict): update SCContentSharingPicker patch for upstream native picker refactor Upstream added is_native_picker and filter_ based native picker session validation to ScreenCaptureKitDeviceMac. Electron's patch uses its own native picker approach (active_streams_ counter + direct SCContentSharingPicker API), so marked the new upstream parameters as [[maybe_unused]] and kept Electron's implementation. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7713560 Co-Authored-By: Claude <noreply@anthropic.com> * chore: update patch hunk headers Co-Authored-By: Claude <noreply@anthropic.com> * 7708800: update StartDragging signature to use RenderFrameHost Upstream refactored StartDragging to take a RenderFrameHost& instead of separate source_origin and source_rwh parameters. Updated OffScreenWebContentsView to match the new signature and derive the RenderWidgetHostImpl from the RenderFrameHost internally. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7708800 Co-Authored-By: Claude <noreply@anthropic.com> * 7682308: add toggle_mute_button to chromium_src build sources Upstream added a ToggleMuteButton to the PiP overlay window controls. Added the new toggle_mute_button.cc/h source files to Electron's chromium_src/BUILD.gn to resolve linker errors. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7682308 Co-Authored-By: Claude <noreply@anthropic.com> * chore: update patches after main rebase * fixup! 7708800: update StartDragging signature to use RenderFrameHost fix linting * 7705541: [trap-handler] Track individual Wasm memories | https://chromium-review.googlesource.com/c/v8/v8/+/7705541 Moved the SetUpWebAssemblyTrapHandler() call to before the V8 isolate is created * fixup! fix utility process tests --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Keeley Hammond <khammond@slack-corp.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
202 lines
11 KiB
Diff
202 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 9e1af7cab8052f02a65ca212c3777b1b1773b8ab..5a421620a971f87dd5e86cd4252de5ea5c4bd309 100644
|
|
--- a/chrome/browser/notifications/platform_notification_service_impl.cc
|
|
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc
|
|
@@ -266,6 +266,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 76c0d0763cdb85888c5b02e62006ad30ca6a80ff..eec3dce46eb283b0721dc66ce5f1b254c490476a 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 2fd342198d04c5d7fa7e80c0893a905a22ff4601..b907b5588541337576e96bbee7c2c29c1b7355a5 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->GetDeprecatedID()),
|
|
@@ -198,7 +200,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 89edc47028e80170bcc0f11a0f27d30067d1ef6c..313bbe4f1815c7e2042d4a4600f922031727d274 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,
|
|
@@ -119,6 +120,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 6e0a316a22753e6fd437739d5d9769c438b82e31..bd14d2f98d35ff85f71c03e7d05f0b6d20cad774 100644
|
|
--- a/content/browser/notifications/blink_notification_service_impl_unittest.cc
|
|
+++ b/content/browser/notifications/blink_notification_service_impl_unittest.cc
|
|
@@ -135,7 +135,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 b433a6bb12880e26068cff3e542b9a45576292ba..85e2db609f92fefda0f293f74d9e9fd48f4cb686 100644
|
|
--- a/content/browser/notifications/platform_notification_context_impl.cc
|
|
+++ b/content/browser/notifications/platform_notification_context_impl.cc
|
|
@@ -286,6 +286,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,
|
|
@@ -294,7 +295,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 9bf238e64af483294ae3c3f18a4e9aed49a8658d..b9b2a4c8c387b8e8b4eb1f02fc0f891ceaa105a0 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 bdf3d9ca4192818a33438dde4dd23ba40996bf00..3d7ccd3becf0ff3cc7003b9159dec7765d5f82c6 100644
|
|
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
|
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
|
@@ -2385,7 +2385,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;
|
|
}
|
|
@@ -2393,7 +2393,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 ea62ad4af02c6e4dcc3115985ad62f7a3a141acd..e5a561bc059fb34686b1976ada599fafc50849fe 100644
|
|
--- a/content/test/mock_platform_notification_service.cc
|
|
+++ b/content/test/mock_platform_notification_service.cc
|
|
@@ -28,6 +28,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,
|