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 "content/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 #include "content/browser/android/browser_startup_controller.h" | 114 #include "content/browser/android/browser_startup_controller.h" |
115 #include "content/browser/android/browser_surface_texture_manager.h" | 115 #include "content/browser/android/browser_surface_texture_manager.h" |
116 #include "content/browser/android/scoped_surface_request_manager.h" | 116 #include "content/browser/android/scoped_surface_request_manager.h" |
117 #include "content/browser/android/tracing_controller_android.h" | 117 #include "content/browser/android/tracing_controller_android.h" |
118 #include "content/browser/media/android/browser_media_player_manager.h" | 118 #include "content/browser/media/android/browser_media_player_manager.h" |
119 #include "content/browser/renderer_host/context_provider_factory_impl_android.h" | 119 #include "content/browser/renderer_host/context_provider_factory_impl_android.h" |
120 #include "content/browser/screen_orientation/screen_orientation_delegate_android .h" | 120 #include "content/browser/screen_orientation/screen_orientation_delegate_android .h" |
121 #include "content/public/browser/screen_orientation_provider.h" | 121 #include "content/public/browser/screen_orientation_provider.h" |
122 #include "gpu/ipc/client/android/in_process_surface_texture_manager.h" | 122 #include "gpu/ipc/client/android/in_process_surface_texture_manager.h" |
123 #include "media/base/android/media_client_android.h" | 123 #include "media/base/android/media_client_android.h" |
124 #include "ui/android/screen_android.h" | |
125 #include "ui/display/screen.h" | |
124 #include "ui/gl/gl_surface.h" | 126 #include "ui/gl/gl_surface.h" |
125 #endif | 127 #endif |
126 | 128 |
127 #if defined(OS_MACOSX) | 129 #if defined(OS_MACOSX) |
128 #include "base/memory/memory_pressure_monitor_mac.h" | 130 #include "base/memory/memory_pressure_monitor_mac.h" |
129 #include "content/browser/bootstrap_sandbox_manager_mac.h" | 131 #include "content/browser/bootstrap_sandbox_manager_mac.h" |
130 #include "content/browser/cocoa/system_hotkey_helper_mac.h" | 132 #include "content/browser/cocoa/system_hotkey_helper_mac.h" |
131 #include "content/browser/mach_broker_mac.h" | 133 #include "content/browser/mach_broker_mac.h" |
132 #include "content/browser/renderer_host/browser_compositor_view_mac.h" | 134 #include "content/browser/renderer_host/browser_compositor_view_mac.h" |
133 #include "content/browser/theme_helper_mac.h" | 135 #include "content/browser/theme_helper_mac.h" |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
728 base::kNullProcessId); | 730 base::kNullProcessId); |
729 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 731 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
730 HostSharedBitmapManager::current(), "HostSharedBitmapManager", nullptr); | 732 HostSharedBitmapManager::current(), "HostSharedBitmapManager", nullptr); |
731 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 733 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
732 skia::SkiaMemoryDumpProvider::GetInstance(), "Skia", nullptr); | 734 skia::SkiaMemoryDumpProvider::GetInstance(), "Skia", nullptr); |
733 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 735 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
734 sql::SqlMemoryDumpProvider::GetInstance(), "Sql", nullptr); | 736 sql::SqlMemoryDumpProvider::GetInstance(), "Sql", nullptr); |
735 } | 737 } |
736 | 738 |
737 int BrowserMainLoop::PreCreateThreads() { | 739 int BrowserMainLoop::PreCreateThreads() { |
740 #if defined(OS_ANDROID) | |
741 // Let screen instance be overridable by parts. | |
742 display::Screen::SetScreenInstance(ui::CreateScreenAndroid()); | |
boliu
2016/11/11 19:54:48
linux puts this in PreMainMessageLoopRun
Tima Vaisburd
2016/11/11 21:32:25
Sometimes it is in PreCreateThreads, though under
boliu
2016/11/11 21:36:10
it hurts start up perf more
Tima Vaisburd
2016/11/11 23:44:43
Done.
The relevant tests seem to pass again.
| |
743 #endif | |
744 | |
738 if (parts_) { | 745 if (parts_) { |
739 TRACE_EVENT0("startup", | 746 TRACE_EVENT0("startup", |
740 "BrowserMainLoop::CreateThreads:PreCreateThreads"); | 747 "BrowserMainLoop::CreateThreads:PreCreateThreads"); |
741 | 748 |
742 result_code_ = parts_->PreCreateThreads(); | 749 result_code_ = parts_->PreCreateThreads(); |
743 } | 750 } |
744 | 751 |
745 const base::CommandLine* command_line = | 752 const base::CommandLine* command_line = |
746 base::CommandLine::ForCurrentProcess(); | 753 base::CommandLine::ForCurrentProcess(); |
747 // Note that we do not initialize a new FeatureList when calling this for | 754 // Note that we do not initialize a new FeatureList when calling this for |
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1606 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = | 1613 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = |
1607 audio_thread_->task_runner(); | 1614 audio_thread_->task_runner(); |
1608 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), | 1615 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), |
1609 std::move(worker_task_runner), | 1616 std::move(worker_task_runner), |
1610 MediaInternals::GetInstance()); | 1617 MediaInternals::GetInstance()); |
1611 } | 1618 } |
1612 CHECK(audio_manager_); | 1619 CHECK(audio_manager_); |
1613 } | 1620 } |
1614 | 1621 |
1615 } // namespace content | 1622 } // namespace content |
OLD | NEW |