OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stddef.h> | 5 #include <stddef.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 bool dead_on_arrival = false; | 182 bool dead_on_arrival = false; |
183 | 183 |
184 #if defined(OS_WIN) | 184 #if defined(OS_WIN) |
185 // Use a UI message loop because ANGLE and the desktop GL platform can | 185 // Use a UI message loop because ANGLE and the desktop GL platform can |
186 // create child windows to render to. | 186 // create child windows to render to. |
187 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); | 187 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); |
188 #elif defined(OS_LINUX) && defined(USE_X11) | 188 #elif defined(OS_LINUX) && defined(USE_X11) |
189 // We need a UI loop so that we can grab the Expose events. See GLSurfaceGLX | 189 // We need a UI loop so that we can grab the Expose events. See GLSurfaceGLX |
190 // and https://crbug.com/326995. | 190 // and https://crbug.com/326995. |
191 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); | 191 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); |
192 scoped_ptr<ui::PlatformEventSource> event_source = | 192 std::unique_ptr<ui::PlatformEventSource> event_source = |
193 ui::PlatformEventSource::CreateDefault(); | 193 ui::PlatformEventSource::CreateDefault(); |
194 #elif defined(OS_LINUX) | 194 #elif defined(OS_LINUX) |
195 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT); | 195 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT); |
196 #elif defined(OS_MACOSX) | 196 #elif defined(OS_MACOSX) |
197 // This is necessary for CoreAnimation layers hosted in the GPU process to be | 197 // This is necessary for CoreAnimation layers hosted in the GPU process to be |
198 // drawn. See http://crbug.com/312462. | 198 // drawn. See http://crbug.com/312462. |
199 scoped_ptr<base::MessagePump> pump(new base::MessagePumpCFRunLoop()); | 199 std::unique_ptr<base::MessagePump> pump(new base::MessagePumpCFRunLoop()); |
200 base::MessageLoop main_message_loop(std::move(pump)); | 200 base::MessageLoop main_message_loop(std::move(pump)); |
201 #else | 201 #else |
202 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_IO); | 202 base::MessageLoop main_message_loop(base::MessageLoop::TYPE_IO); |
203 #endif | 203 #endif |
204 | 204 |
205 base::PlatformThread::SetName("CrGpuMain"); | 205 base::PlatformThread::SetName("CrGpuMain"); |
206 | 206 |
207 // In addition to disabling the watchdog if the command line switch is | 207 // In addition to disabling the watchdog if the command line switch is |
208 // present, disable the watchdog on valgrind because the code is expected | 208 // present, disable the watchdog on valgrind because the code is expected |
209 // to run slowly in that case. | 209 // to run slowly in that case. |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 gpu_info.sandboxed = StartSandboxWindows(parameters.sandbox_info); | 372 gpu_info.sandboxed = StartSandboxWindows(parameters.sandbox_info); |
373 #elif defined(OS_MACOSX) | 373 #elif defined(OS_MACOSX) |
374 gpu_info.sandboxed = Sandbox::SandboxIsCurrentlyActive(); | 374 gpu_info.sandboxed = Sandbox::SandboxIsCurrentlyActive(); |
375 #endif | 375 #endif |
376 } else { | 376 } else { |
377 dead_on_arrival = true; | 377 dead_on_arrival = true; |
378 } | 378 } |
379 | 379 |
380 logging::SetLogMessageHandler(NULL); | 380 logging::SetLogMessageHandler(NULL); |
381 | 381 |
382 scoped_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory; | 382 std::unique_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory; |
383 if (gpu::GetNativeGpuMemoryBufferType() != gfx::EMPTY_BUFFER) | 383 if (gpu::GetNativeGpuMemoryBufferType() != gfx::EMPTY_BUFFER) |
384 gpu_memory_buffer_factory = gpu::GpuMemoryBufferFactory::CreateNativeType(); | 384 gpu_memory_buffer_factory = gpu::GpuMemoryBufferFactory::CreateNativeType(); |
385 | 385 |
386 gpu::SyncPointManager sync_point_manager(false); | 386 gpu::SyncPointManager sync_point_manager(false); |
387 | 387 |
388 base::ThreadPriority io_thread_priority = base::ThreadPriority::NORMAL; | 388 base::ThreadPriority io_thread_priority = base::ThreadPriority::NORMAL; |
389 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) | 389 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
390 io_thread_priority = base::ThreadPriority::DISPLAY; | 390 io_thread_priority = base::ThreadPriority::DISPLAY; |
391 #endif | 391 #endif |
392 | 392 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 return true; | 584 return true; |
585 } | 585 } |
586 | 586 |
587 return false; | 587 return false; |
588 } | 588 } |
589 #endif // defined(OS_WIN) | 589 #endif // defined(OS_WIN) |
590 | 590 |
591 } // namespace. | 591 } // namespace. |
592 | 592 |
593 } // namespace content | 593 } // namespace content |
OLD | NEW |