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" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
13 #include "base/metrics/statistics_recorder.h" | 13 #include "base/metrics/statistics_recorder.h" |
14 #include "base/rand_util.h" | 14 #include "base/rand_util.h" |
15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
16 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
17 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" | 17 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
18 #include "base/threading/platform_thread.h" | 18 #include "base/threading/platform_thread.h" |
19 #include "base/trace_event/trace_event.h" | 19 #include "base/trace_event/trace_event.h" |
20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
21 #include "content/child/child_process.h" | 21 #include "content/child/child_process.h" |
22 #include "content/common/content_constants_internal.h" | 22 #include "content/common/content_constants_internal.h" |
23 #include "content/common/gpu/gpu_config.h" | |
24 #include "content/common/gpu/gpu_memory_buffer_factory.h" | |
25 #include "content/common/gpu_host_messages.h" | 23 #include "content/common/gpu_host_messages.h" |
26 #include "content/common/sandbox_linux/sandbox_linux.h" | 24 #include "content/common/sandbox_linux/sandbox_linux.h" |
27 #include "content/gpu/gpu_child_thread.h" | 25 #include "content/gpu/gpu_child_thread.h" |
28 #include "content/gpu/gpu_process.h" | 26 #include "content/gpu/gpu_process.h" |
29 #include "content/gpu/gpu_watchdog_thread.h" | 27 #include "content/gpu/gpu_watchdog_thread.h" |
30 #include "content/public/common/content_client.h" | 28 #include "content/public/common/content_client.h" |
31 #include "content/public/common/content_switches.h" | 29 #include "content/public/common/content_switches.h" |
32 #include "content/public/common/main_function_params.h" | 30 #include "content/public/common/main_function_params.h" |
33 #include "gpu/command_buffer/service/gpu_switches.h" | 31 #include "gpu/command_buffer/service/gpu_switches.h" |
34 #include "gpu/command_buffer/service/sync_point_manager.h" | 32 #include "gpu/command_buffer/service/sync_point_manager.h" |
35 #include "gpu/config/gpu_info_collector.h" | 33 #include "gpu/config/gpu_info_collector.h" |
36 #include "gpu/config/gpu_switches.h" | 34 #include "gpu/config/gpu_switches.h" |
37 #include "gpu/config/gpu_util.h" | 35 #include "gpu/config/gpu_util.h" |
38 #include "gpu/ipc/common/gpu_memory_buffer_support.h" | 36 #include "gpu/ipc/common/gpu_memory_buffer_support.h" |
| 37 #include "gpu/ipc/service/gpu_config.h" |
| 38 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" |
39 #include "ui/events/platform/platform_event_source.h" | 39 #include "ui/events/platform/platform_event_source.h" |
40 #include "ui/gl/gl_context.h" | 40 #include "ui/gl/gl_context.h" |
41 #include "ui/gl/gl_implementation.h" | 41 #include "ui/gl/gl_implementation.h" |
42 #include "ui/gl/gl_surface.h" | 42 #include "ui/gl/gl_surface.h" |
43 #include "ui/gl/gl_switches.h" | 43 #include "ui/gl/gl_switches.h" |
44 #include "ui/gl/gpu_switching_manager.h" | 44 #include "ui/gl/gpu_switching_manager.h" |
45 | 45 |
46 #if defined(OS_WIN) | 46 #if defined(OS_WIN) |
47 #include <dwmapi.h> | 47 #include <dwmapi.h> |
48 #include <windows.h> | 48 #include <windows.h> |
(...skipping 323 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<GpuMemoryBufferFactory> gpu_memory_buffer_factory; | 382 scoped_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 = 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 |
393 GpuProcess gpu_process(io_thread_priority); | 393 GpuProcess gpu_process(io_thread_priority); |
394 | 394 |
(...skipping 189 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 |