Commit 82befc59 authored by skyostil's avatar skyostil Committed by Commit bot

gpu: Don't destroy the ui::PlatformEventSource too early

This patch fixes a bug introduced by r438239 where the
ui::PlatformEventSource was destroyed before entering the GPU message
loop.

BUG=674350

Review-Url: https://codereview.chromium.org/2584513002
Cr-Commit-Position: refs/heads/master@{#439465}
parent 501041ec
......@@ -201,6 +201,7 @@ int GpuMain(const MainFunctionParams& parameters) {
// 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;
std::unique_ptr<ui::PlatformEventSource> event_source;
if (command_line.HasSwitch(switches::kHeadless)) {
main_message_loop.reset(
new base::MessageLoop(base::MessageLoop::TYPE_DEFAULT));
......@@ -214,8 +215,7 @@ int GpuMain(const MainFunctionParams& parameters) {
// We need a UI loop so that we can grab the Expose events. See GLSurfaceGLX
// and https://crbug.com/326995.
main_message_loop.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI));
std::unique_ptr<ui::PlatformEventSource> event_source =
ui::PlatformEventSource::CreateDefault();
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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment