mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
* chore: bump chromium in DEPS to 89.0.4386.0 * update patches * 2596667: Reland "[printing] Mojofy PrintHostMsg_CheckForCancel" https://chromium-review.googlesource.com/c/chromium/src/+/2596667 (cherry picked from commit70fb0fe694) * fixup for 2596667: Reland "[printing] Mojofy PrintHostMsg_CheckForCancel * 2596880: Refactor frame detach helpers to return a bool indicating success. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2596880 * 2596880: Refactor frame detach helpers to return a bool indicating success. https://chromium-review.googlesource.com/c/chromium/src/+/2596880 * 2615203: [Code health] Convert DispatchCallback to OnceCallback Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2615203 * 2587618: Refactor contrast tracking in NativeTheme Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2587618 * 2596289: Use ContextMenuDataMediaType Mojo enum instead of the native one Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2596289 * 2587049: Move blink.mojom.DragOperation to //ui/base/dragdrop Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2587049 * 2585255: Move web_isolated_world_ids.h from public/platform to renderer/platform/bindings in blink Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2585255 * 2602887: Convert CheckForUpdates callback to OnceCallback Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2602887 * 2601061: Convert ChromeManagementAPIDelegate to OnceCallback Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2601061 * 2600391: Convert MessagingDelegate to OnceCallback Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2600391 * 2583590: webui: Remove UseWebUIBindingsForURL Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2583590 * 2562002: Deprecate ResourceType in ExtensionsBrowserClient Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2562002 * chore: handle AXPropertyFilter::SCRIPT in accessibility_ui Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2563923 * chore: add DISPLAY_CAPTURE permission to converter Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2551098 * fix: add utility class for linting * 2614784: Remove SchemeRegistry APIs for handling local and secure schemes Ref; https://chromium-review.googlesource.com/c/chromium/src/+/2614784 * chore: bump chromium in DEPS to 89.0.4387.0 * 2618392: Rename PAGE to ENTRY in NAVIGATION_TYPE values. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2618392 * 2616421: Factor out DnsConfigService::Watcher logic Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2616421 * chore: update Chromium patch indices * 2617866: Componentize OptimizationHintsComponentInstaller for reuse on iOS Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2617866 * refactor: refactor x11 event handling, xeventobserver is now x11:eventobserver Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2577887 Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2585750 * 2595524: [XProto] Use x11 namespace instead of gfx for //ui/gfx/x Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2595524 * build: change ui namespace to x11 Ref:c38f8571a8:ui/gfx/x/xproto_util.h;dlc=ba9145d0c7f2b10e869e2ba482ca05b75ca35812 * 2600437: [XProto] Remove old property setters/getters from x11_util Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2600437 * chore: remove deleted headers * 2402398: Adding ViewsAXTreeManager output to chrome://accessibility Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2402398 * chore: revert to old version of circleci for mac builds Ref: https://gn.googlesource.com/gn/+/0d67e272bdb8145f87d238bc0b2cb8bf80ccec90 * fix: remove outdated --experimental-wasm-bigint flag * chore: bump chromium in DEPS to 89.0.4389.0 * update patches * 2592803: [Extensions] Use policy-enforced update URL in ManagementApi Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2592803 * 2599731: Make network::DataElement a union with absl::variant Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2599731 * 2614784: Remove SchemeRegistry APIs for handling local and secure schemes https://chromium-review.googlesource.com/c/chromium/src/+/2614784 * 2624711: Inline and remove peekLast() https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2624711 * chore: add patch to fix blink prefs fetching during frame swap Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> * update patches * fix: do not make invalid SKImageRep in FrameSubscriber Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2572896 * Revert "2616421: Factor out DnsConfigService::Watcher logic" This reverts commit7214406ecb. * 2616421: Factor out DnsConfigService::Watcher logic https://chromium-review.googlesource.com/c/chromium/src/+/2616421 * chore: bump chromium in DEPS to 89.0.4388.2 * chore: update patches * 2581958: [api] Dehandlify FunctionTemplate initialization Ref: https://chromium-review.googlesource.com/c/v8/v8/+/2581958 * Revert "2592803: [Extensions] Use policy-enforced update URL in ManagementApi" This reverts commit00f4041cc9. * 2572896: Prevent making invalid SkImageReps Ref: https://chromium-review.googlesource.com/c/chromium/src/+/2572896 * fix: sandbox exit event to preload test * fix: restore clipboard_win patch * ci: force delete user app data directories * chore: clean up typing on webview-spec * docs: undocument display-capture ses.permission option Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: VerteDinde <khammond@slack-corp.com> Co-authored-by: VerteDinde <keeleymhammond@gmail.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
168 lines
9.2 KiB
Diff
168 lines
9.2 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 RenderProcessHost through to PlatformNotificationService
|
|
so Electron can identify which renderer a notification came from.
|
|
|
|
diff --git a/content/browser/notifications/blink_notification_service_impl.cc b/content/browser/notifications/blink_notification_service_impl.cc
|
|
index d756a1b8cfeba5900c95863ca29cb15d9e1b15e4..3159df3456483453b9b362bb8942b45160d67b4d 100644
|
|
--- a/content/browser/notifications/blink_notification_service_impl.cc
|
|
+++ b/content/browser/notifications/blink_notification_service_impl.cc
|
|
@@ -87,9 +87,11 @@ BlinkNotificationServiceImpl::BlinkNotificationServiceImpl(
|
|
PlatformNotificationContextImpl* notification_context,
|
|
BrowserContext* browser_context,
|
|
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
|
|
+ RenderProcessHost* render_process_host,
|
|
const url::Origin& origin,
|
|
mojo::PendingReceiver<blink::mojom::NotificationService> receiver)
|
|
: notification_context_(notification_context),
|
|
+ render_process_host_(render_process_host),
|
|
browser_context_(browser_context),
|
|
service_worker_context_(std::move(service_worker_context)),
|
|
origin_(origin),
|
|
@@ -150,8 +152,9 @@ void BlinkNotificationServiceImpl::DisplayNonPersistentNotification(
|
|
notification_id, std::move(event_listener_remote));
|
|
|
|
GetNotificationService(browser_context_)
|
|
- ->DisplayNotification(notification_id, origin_.GetURL(),
|
|
- platform_notification_data, notification_resources);
|
|
+ ->DisplayNotification(render_process_host_, notification_id,
|
|
+ origin_.GetURL(), platform_notification_data,
|
|
+ notification_resources);
|
|
}
|
|
|
|
void BlinkNotificationServiceImpl::CloseNonPersistentNotification(
|
|
diff --git a/content/browser/notifications/blink_notification_service_impl.h b/content/browser/notifications/blink_notification_service_impl.h
|
|
index 5253f6be778cc78571b3df0a33d364a9b1e6ef52..dc5307e6500b0bfb5da83e8d8ff8886b91133522 100644
|
|
--- a/content/browser/notifications/blink_notification_service_impl.h
|
|
+++ b/content/browser/notifications/blink_notification_service_impl.h
|
|
@@ -40,6 +40,7 @@ class CONTENT_EXPORT BlinkNotificationServiceImpl
|
|
PlatformNotificationContextImpl* notification_context,
|
|
BrowserContext* browser_context,
|
|
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
|
|
+ RenderProcessHost* render_process_host,
|
|
const url::Origin& origin,
|
|
mojo::PendingReceiver<blink::mojom::NotificationService> receiver);
|
|
~BlinkNotificationServiceImpl() override;
|
|
@@ -99,6 +100,7 @@ class CONTENT_EXPORT BlinkNotificationServiceImpl
|
|
// The notification context that owns this service instance.
|
|
PlatformNotificationContextImpl* notification_context_;
|
|
|
|
+ RenderProcessHost* render_process_host_;
|
|
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 dcb0b03f0b814238860a17f88c1d7ed00546dad4..17184d672af88947c04b30de0aa62acda84084fb 100644
|
|
--- a/content/browser/notifications/blink_notification_service_impl_unittest.cc
|
|
+++ b/content/browser/notifications/blink_notification_service_impl_unittest.cc
|
|
@@ -139,7 +139,7 @@ class BlinkNotificationServiceImplTest : public ::testing::Test {
|
|
|
|
notification_service_ = std::make_unique<BlinkNotificationServiceImpl>(
|
|
notification_context_.get(), &browser_context_,
|
|
- embedded_worker_helper_->context_wrapper(),
|
|
+ embedded_worker_helper_->context_wrapper(), nullptr,
|
|
url::Origin::Create(GURL(kTestOrigin)),
|
|
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 15ba957ffdd3742912b7f7cac3e7ac57931c8954..5dc153c2a0f5680e05e7f397b2102982b28021bc 100644
|
|
--- a/content/browser/notifications/platform_notification_context_impl.cc
|
|
+++ b/content/browser/notifications/platform_notification_context_impl.cc
|
|
@@ -257,12 +257,13 @@ void PlatformNotificationContextImpl::Shutdown() {
|
|
}
|
|
|
|
void PlatformNotificationContextImpl::CreateService(
|
|
+ RenderProcessHost* render_process_host,
|
|
const url::Origin& origin,
|
|
mojo::PendingReceiver<blink::mojom::NotificationService> receiver) {
|
|
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
|
services_.push_back(std::make_unique<BlinkNotificationServiceImpl>(
|
|
- this, browser_context_, service_worker_context_, origin,
|
|
- std::move(receiver)));
|
|
+ this, browser_context_, service_worker_context_, render_process_host,
|
|
+ origin, 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 f9b6a18aa73968506ddeca13de69b368f4ca8606..d45cb1c32be1b5c76840dafcd96fd06cb7c92d10 100644
|
|
--- a/content/browser/notifications/platform_notification_context_impl.h
|
|
+++ b/content/browser/notifications/platform_notification_context_impl.h
|
|
@@ -24,6 +24,7 @@
|
|
#include "content/common/content_export.h"
|
|
#include "content/public/browser/browser_thread.h"
|
|
#include "content/public/browser/platform_notification_context.h"
|
|
+#include "content/public/browser/render_process_host.h"
|
|
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
|
#include "third_party/blink/public/mojom/notifications/notification_service.mojom.h"
|
|
|
|
@@ -67,6 +68,7 @@ class CONTENT_EXPORT PlatformNotificationContextImpl
|
|
|
|
// Creates a BlinkNotificationServiceImpl that is owned by this context.
|
|
void CreateService(
|
|
+ RenderProcessHost* render_process_host,
|
|
const url::Origin& origin,
|
|
mojo::PendingReceiver<blink::mojom::NotificationService> receiver);
|
|
|
|
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
|
index 6eb6699bad25f92bbcd2267d5cd9f92acdf8e5ca..7662384242619d32f5133757674fddae40615873 100644
|
|
--- a/content/browser/renderer_host/render_process_host_impl.cc
|
|
+++ b/content/browser/renderer_host/render_process_host_impl.cc
|
|
@@ -2091,7 +2091,7 @@ void RenderProcessHostImpl::CreateNotificationService(
|
|
mojo::PendingReceiver<blink::mojom::NotificationService> receiver) {
|
|
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
|
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
|
|
- origin, std::move(receiver));
|
|
+ this, origin, std::move(receiver));
|
|
}
|
|
|
|
void RenderProcessHostImpl::CreateWebSocketConnector(
|
|
diff --git a/content/public/browser/platform_notification_service.h b/content/public/browser/platform_notification_service.h
|
|
index ca61088079c4150fcf389504ddcf26bcf6bf69cd..d9c034c39890eef1fe3d95c6d7c0ae68eb711a89 100644
|
|
--- a/content/public/browser/platform_notification_service.h
|
|
+++ b/content/public/browser/platform_notification_service.h
|
|
@@ -27,6 +27,8 @@ struct PlatformNotificationData;
|
|
|
|
namespace content {
|
|
|
|
+class RenderProcessHost;
|
|
+
|
|
// 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 {
|
|
// Displays the notification described in |notification_data| to the user.
|
|
// This method must be called on the UI thread.
|
|
virtual void DisplayNotification(
|
|
+ RenderProcessHost* render_process_host,
|
|
const std::string& notification_id,
|
|
const GURL& origin,
|
|
const blink::PlatformNotificationData& notification_data,
|
|
diff --git a/content/test/mock_platform_notification_service.cc b/content/test/mock_platform_notification_service.cc
|
|
index 2f5b8be21c8b37bb6a0c7fe52c87cb7f9debbca0..7934f6e625584466ff0aabc69583343c728759ea 100644
|
|
--- a/content/test/mock_platform_notification_service.cc
|
|
+++ b/content/test/mock_platform_notification_service.cc
|
|
@@ -30,6 +30,7 @@ MockPlatformNotificationService::MockPlatformNotificationService(
|
|
MockPlatformNotificationService::~MockPlatformNotificationService() = default;
|
|
|
|
void MockPlatformNotificationService::DisplayNotification(
|
|
+ RenderProcessHost* render_process_host,
|
|
const std::string& notification_id,
|
|
const GURL& origin,
|
|
const blink::PlatformNotificationData& notification_data,
|
|
diff --git a/content/test/mock_platform_notification_service.h b/content/test/mock_platform_notification_service.h
|
|
index 6d108f9884f7e8f608b70ec33d286a06346e7456..4650a01c2d090c5957eb7a7e21f124489513142a 100644
|
|
--- a/content/test/mock_platform_notification_service.h
|
|
+++ b/content/test/mock_platform_notification_service.h
|
|
@@ -47,6 +47,7 @@ class MockPlatformNotificationService : public PlatformNotificationService {
|
|
|
|
// PlatformNotificationService implementation.
|
|
void DisplayNotification(
|
|
+ RenderProcessHost* render_process_host,
|
|
const std::string& notification_id,
|
|
const GURL& origin,
|
|
const blink::PlatformNotificationData& notification_data,
|