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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 #include "content/browser/android/browser_startup_controller.h" | 115 #include "content/browser/android/browser_startup_controller.h" |
116 #include "content/browser/android/browser_surface_texture_manager.h" | 116 #include "content/browser/android/browser_surface_texture_manager.h" |
117 #include "content/browser/android/scoped_surface_request_manager.h" | 117 #include "content/browser/android/scoped_surface_request_manager.h" |
118 #include "content/browser/android/tracing_controller_android.h" | 118 #include "content/browser/android/tracing_controller_android.h" |
119 #include "content/browser/media/android/browser_media_player_manager.h" | 119 #include "content/browser/media/android/browser_media_player_manager.h" |
120 #include "content/browser/renderer_host/context_provider_factory_impl_android.h" | 120 #include "content/browser/renderer_host/context_provider_factory_impl_android.h" |
121 #include "content/browser/screen_orientation/screen_orientation_delegate_android
.h" | 121 #include "content/browser/screen_orientation/screen_orientation_delegate_android
.h" |
122 #include "content/public/browser/screen_orientation_provider.h" | 122 #include "content/public/browser/screen_orientation_provider.h" |
123 #include "gpu/ipc/client/android/in_process_surface_texture_manager.h" | 123 #include "gpu/ipc/client/android/in_process_surface_texture_manager.h" |
124 #include "media/base/android/media_client_android.h" | 124 #include "media/base/android/media_client_android.h" |
| 125 #include "ui/android/screen_android.h" |
| 126 #include "ui/display/screen.h" |
125 #include "ui/gl/gl_surface.h" | 127 #include "ui/gl/gl_surface.h" |
126 #endif | 128 #endif |
127 | 129 |
128 #if defined(OS_MACOSX) | 130 #if defined(OS_MACOSX) |
129 #include "base/memory/memory_pressure_monitor_mac.h" | 131 #include "base/memory/memory_pressure_monitor_mac.h" |
130 #include "content/browser/bootstrap_sandbox_manager_mac.h" | 132 #include "content/browser/bootstrap_sandbox_manager_mac.h" |
131 #include "content/browser/cocoa/system_hotkey_helper_mac.h" | 133 #include "content/browser/cocoa/system_hotkey_helper_mac.h" |
132 #include "content/browser/mach_broker_mac.h" | 134 #include "content/browser/mach_broker_mac.h" |
133 #include "content/browser/renderer_host/browser_compositor_view_mac.h" | 135 #include "content/browser/renderer_host/browser_compositor_view_mac.h" |
134 #include "content/browser/theme_helper_mac.h" | 136 #include "content/browser/theme_helper_mac.h" |
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 NOTREACHED(); | 962 NOTREACHED(); |
961 } | 963 } |
962 | 964 |
963 TRACE_EVENT_END0("startup", "BrowserMainLoop::CreateThreads:start"); | 965 TRACE_EVENT_END0("startup", "BrowserMainLoop::CreateThreads:start"); |
964 } | 966 } |
965 created_threads_ = true; | 967 created_threads_ = true; |
966 return result_code_; | 968 return result_code_; |
967 } | 969 } |
968 | 970 |
969 int BrowserMainLoop::PreMainMessageLoopRun() { | 971 int BrowserMainLoop::PreMainMessageLoopRun() { |
| 972 #if defined(OS_ANDROID) |
| 973 // Let screen instance be overridable by parts. |
| 974 ui::SetScreenAndroid(); |
| 975 #endif |
| 976 |
970 if (parts_) { | 977 if (parts_) { |
971 TRACE_EVENT0("startup", | 978 TRACE_EVENT0("startup", |
972 "BrowserMainLoop::CreateThreads:PreMainMessageLoopRun"); | 979 "BrowserMainLoop::CreateThreads:PreMainMessageLoopRun"); |
973 | 980 |
974 parts_->PreMainMessageLoopRun(); | 981 parts_->PreMainMessageLoopRun(); |
975 } | 982 } |
976 | 983 |
977 // If the UI thread blocks, the whole UI is unresponsive. | 984 // If the UI thread blocks, the whole UI is unresponsive. |
978 // Do not allow disk IO from the UI thread. | 985 // Do not allow disk IO from the UI thread. |
979 base::ThreadRestrictions::SetIOAllowed(false); | 986 base::ThreadRestrictions::SetIOAllowed(false); |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1620 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = | 1627 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = |
1621 audio_thread_->task_runner(); | 1628 audio_thread_->task_runner(); |
1622 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), | 1629 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), |
1623 std::move(worker_task_runner), | 1630 std::move(worker_task_runner), |
1624 MediaInternals::GetInstance()); | 1631 MediaInternals::GetInstance()); |
1625 } | 1632 } |
1626 CHECK(audio_manager_); | 1633 CHECK(audio_manager_); |
1627 } | 1634 } |
1628 | 1635 |
1629 } // namespace content | 1636 } // namespace content |
OLD | NEW |