Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(947)

Unified Diff: content/gpu/gpu_main.cc

Issue 2540513002: Move GPU proc message loop to heap (Closed)
Patch Set: Add bugs to comment Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/gpu/gpu_main.cc
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index 51c2868899c077360575fbf89cab0518e99bc7a0..a529db776818dba3ba9a39c0baf9ff2ca58d5c60 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -193,31 +193,41 @@ int GpuMain(const MainFunctionParams& parameters) {
logging::SetLogMessageHandler(GpuProcessLogMessageHandler);
+ // We are experiencing what appear to be memory-stomp issues in the GPU
+ // process. These issues seem to be impacting the message loop and listeners
+ // registered to it. Create the message loop on the heap to guard against
+ // this.
+ // TODO(ericrk): Revisit this once we assess its impact on crbug.com/662802
+ // and crbug.com/609252.
+ std::unique_ptr<base::MessageLoop> main_message_loop;
+
#if defined(OS_WIN)
// OK to use default non-UI message loop because all GPU windows run on
// dedicated thread.
- base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT);
+ main_message_loop.reset(
+ new base::MessageLoop(base::MessageLoop::TYPE_DEFAULT));
#elif defined(USE_X11)
// We need a UI loop so that we can grab the Expose events. See GLSurfaceGLX
// and https://crbug.com/326995.
- base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI);
+ main_message_loop.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI));
std::unique_ptr<ui::PlatformEventSource> event_source =
ui::PlatformEventSource::CreateDefault();
#elif defined(USE_OZONE) && defined(OZONE_X11)
// If we might be running Ozone X11 we need a UI loop to grab Expose events.
// See GLSurfaceGLX and https://crbug.com/326995.
- base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI);
+ main_message_loop.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI));
#elif defined(USE_OZONE)
- base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT);
+ main_message_loop.reset(
+ new base::MessageLoop(base::MessageLoop::TYPE_DEFAULT));
#elif defined(OS_LINUX)
#error "Unsupported Linux platform."
#elif defined(OS_MACOSX)
// This is necessary for CoreAnimation layers hosted in the GPU process to be
// drawn. See http://crbug.com/312462.
std::unique_ptr<base::MessagePump> pump(new base::MessagePumpCFRunLoop());
- base::MessageLoop main_message_loop(std::move(pump));
+ main_message_loop.reset(new base::MessageLoop(std::move(pump)));
#else
- base::MessageLoop main_message_loop(base::MessageLoop::TYPE_IO);
+ main_message_loop.reset(new base::MessageLoop(base::MessageLoop::TYPE_IO));
#endif
base::PlatformThread::SetName("CrGpuMain");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698