electron/patches/chromium/add_contentgpuclient_precreatemessageloop_callback.patch
Electron Bot d362be5cd9 chore: bump chromium to f156cb7658ec5382f5623a05841c6 (master) (#19096)
* chore: bump chromium in DEPS to 37cd06a295cf156cb7658ec5382f5623a05841c6

* update patches

* fix: replace NO_TRAFFIC_ANNOTATION_YET with MISSING_TRAFFIC_ANNOTATION

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1653256
2019-07-03 14:48:55 -07:00

48 lines
2.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Milan Burda <milan.burda@gmail.com>
Date: Thu, 11 Apr 2019 14:49:20 +0200
Subject: Add ContentGpuClient::PreCreateMessageLoop() callback
Invoke in GpuMain after SetErrorMode, before starting the message loop.
Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set.
This should be upstreamed
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index 877495568fddbc7dae5835ead41faf37be77208a..362c01039826ee5764d170da17cc7111617a8de2 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -236,6 +236,10 @@ int GpuMain(const MainFunctionParams& parameters) {
logging::SetLogMessageHandler(GpuProcessLogMessageHandler);
+ auto* client = GetContentClient()->gpu();
+ if (client)
+ client->PreCreateMessageLoop();
+
// We are experiencing what appear to be memory-stomp issues in the GPU
// process. These issues seem to be impacting the task executor and listeners
// registered to it. Create the task executor on the heap to guard against
@@ -339,7 +343,6 @@ int GpuMain(const MainFunctionParams& parameters) {
: base::ThreadPriority::NORMAL;
GpuProcess gpu_process(io_thread_priority);
- auto* client = GetContentClient()->gpu();
if (client)
client->PostIOThreadCreated(gpu_process.io_task_runner());
diff --git a/content/public/gpu/content_gpu_client.h b/content/public/gpu/content_gpu_client.h
index 20e31e1bd96395cb4350aa6ae84cc16c4ca2116b..d89af81ef9426c197a62027b514011afd10ea3ce 100644
--- a/content/public/gpu/content_gpu_client.h
+++ b/content/public/gpu/content_gpu_client.h
@@ -35,6 +35,10 @@ class CONTENT_EXPORT ContentGpuClient {
public:
virtual ~ContentGpuClient() {}
+ // Allows the embedder to perform platform-specific initialization before
+ // creating the message loop.
+ virtual void PreCreateMessageLoop() {}
+
// Initializes the registry. |registry| will be passed to a ConnectionFilter
// (which lives on the IO thread). Unlike other childthreads, the client must
// register additional interfaces on this registry rather than just creating