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 <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/metrics/statistics_recorder.h" | 14 #include "base/metrics/statistics_recorder.h" |
15 #include "base/rand_util.h" | 15 #include "base/rand_util.h" |
| 16 #include "base/run_loop.h" |
16 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
17 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
18 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" | 19 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
19 #include "base/threading/platform_thread.h" | 20 #include "base/threading/platform_thread.h" |
20 #include "base/trace_event/trace_event.h" | 21 #include "base/trace_event/trace_event.h" |
21 #include "build/build_config.h" | 22 #include "build/build_config.h" |
22 #include "content/child/child_process.h" | 23 #include "content/child/child_process.h" |
23 #include "content/common/content_constants_internal.h" | 24 #include "content/common/content_constants_internal.h" |
24 #include "content/common/gpu_host_messages.h" | 25 #include "content/common/gpu_host_messages.h" |
25 #include "content/common/sandbox_linux/sandbox_linux.h" | 26 #include "content/common/sandbox_linux/sandbox_linux.h" |
(...skipping 12 matching lines...) Expand all Loading... |
38 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" | 39 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" |
39 #include "ui/events/platform/platform_event_source.h" | 40 #include "ui/events/platform/platform_event_source.h" |
40 #include "ui/gl/gl_context.h" | 41 #include "ui/gl/gl_context.h" |
41 #include "ui/gl/gl_implementation.h" | 42 #include "ui/gl/gl_implementation.h" |
42 #include "ui/gl/gl_surface.h" | 43 #include "ui/gl/gl_surface.h" |
43 #include "ui/gl/gl_switches.h" | 44 #include "ui/gl/gl_switches.h" |
44 #include "ui/gl/gpu_switching_manager.h" | 45 #include "ui/gl/gpu_switching_manager.h" |
45 #include "ui/gl/init/gl_factory.h" | 46 #include "ui/gl/init/gl_factory.h" |
46 | 47 |
47 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
| 49 #include <windows.h> |
48 #include <dwmapi.h> | 50 #include <dwmapi.h> |
49 #include <windows.h> | |
50 #endif | 51 #endif |
51 | 52 |
52 #if defined(OS_ANDROID) | 53 #if defined(OS_ANDROID) |
53 #include "base/trace_event/memory_dump_manager.h" | 54 #include "base/trace_event/memory_dump_manager.h" |
54 #include "components/tracing/common/graphics_memory_dump_provider_android.h" | 55 #include "components/tracing/common/graphics_memory_dump_provider_android.h" |
55 #endif | 56 #endif |
56 | 57 |
57 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
58 #include "base/win/scoped_com_initializer.h" | 59 #include "base/win/scoped_com_initializer.h" |
59 #include "base/win/windows_version.h" | 60 #include "base/win/windows_version.h" |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 watchdog_thread->AddPowerObserver(); | 411 watchdog_thread->AddPowerObserver(); |
411 | 412 |
412 #if defined(OS_ANDROID) | 413 #if defined(OS_ANDROID) |
413 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 414 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
414 tracing::GraphicsMemoryDumpProvider::GetInstance(), "AndroidGraphics", | 415 tracing::GraphicsMemoryDumpProvider::GetInstance(), "AndroidGraphics", |
415 nullptr); | 416 nullptr); |
416 #endif | 417 #endif |
417 | 418 |
418 { | 419 { |
419 TRACE_EVENT0("gpu", "Run Message Loop"); | 420 TRACE_EVENT0("gpu", "Run Message Loop"); |
420 main_message_loop.Run(); | 421 base::RunLoop().Run(); |
421 } | 422 } |
422 | 423 |
423 child_thread->StopWatchdog(); | 424 child_thread->StopWatchdog(); |
424 | 425 |
425 return 0; | 426 return 0; |
426 } | 427 } |
427 | 428 |
428 namespace { | 429 namespace { |
429 | 430 |
430 void GetGpuInfoFromCommandLine(gpu::GPUInfo& gpu_info, | 431 void GetGpuInfoFromCommandLine(gpu::GPUInfo& gpu_info, |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 return true; | 619 return true; |
619 } | 620 } |
620 | 621 |
621 return false; | 622 return false; |
622 } | 623 } |
623 #endif // defined(OS_WIN) | 624 #endif // defined(OS_WIN) |
624 | 625 |
625 } // namespace. | 626 } // namespace. |
626 | 627 |
627 } // namespace content | 628 } // namespace content |
OLD | NEW |