add_contentgpuclient_precreatemessageloop_callback.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Milan Burda <[email protected]>
  3. Date: Thu, 11 Apr 2019 14:49:20 +0200
  4. Subject: add_contentgpuclient_precreatemessageloop_callback.patch
  5. This adds a ContentGpuClient::PreCreateMessageLoop() callback.
  6. Invoke in GpuMain after SetErrorMode, before starting the message loop.
  7. Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set.
  8. This should be upstreamed.
  9. diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
  10. index 0a56e27b49e101f4ac3bd1a0d386c3977666bb6d..d0ccfac9c90d1427778222badb6246aaa1f7b8a4 100644
  11. --- a/content/gpu/gpu_main.cc
  12. +++ b/content/gpu/gpu_main.cc
  13. @@ -259,6 +259,10 @@ int GpuMain(const MainFunctionParams& parameters) {
  14. logging::SetLogMessageHandler(GpuProcessLogMessageHandler);
  15. + auto* client = GetContentClient()->gpu();
  16. + if (client)
  17. + client->PreCreateMessageLoop();
  18. +
  19. // We are experiencing what appear to be memory-stomp issues in the GPU
  20. // process. These issues seem to be impacting the task executor and listeners
  21. // registered to it. Create the task executor on the heap to guard against
  22. @@ -371,7 +375,6 @@ int GpuMain(const MainFunctionParams& parameters) {
  23. GpuProcess gpu_process(io_thread_priority);
  24. #endif
  25. - auto* client = GetContentClient()->gpu();
  26. if (client)
  27. client->PostIOThreadCreated(gpu_process.io_task_runner());
  28. diff --git a/content/public/gpu/content_gpu_client.h b/content/public/gpu/content_gpu_client.h
  29. index f68558bd2c4ff725443b0d6893ebe7da07c26a00..3dda58157f32dbc9c7d9001192c30a3a1c152437 100644
  30. --- a/content/public/gpu/content_gpu_client.h
  31. +++ b/content/public/gpu/content_gpu_client.h
  32. @@ -39,6 +39,10 @@ class CONTENT_EXPORT ContentGpuClient {
  33. public:
  34. virtual ~ContentGpuClient() {}
  35. + // Allows the embedder to perform platform-specific initialization before
  36. + // creating the message loop.
  37. + virtual void PreCreateMessageLoop() {}
  38. +
  39. // Called during initialization once the GpuService has been initialized.
  40. virtual void GpuServiceInitialized() {}