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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/memory_pressure_monitor.h" | 10 #include "base/memory/memory_pressure_monitor.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
83 #if defined(OS_ANDROID) | 83 #if defined(OS_ANDROID) |
84 #include "base/android/jni_android.h" | 84 #include "base/android/jni_android.h" |
85 #include "content/browser/android/browser_startup_controller.h" | 85 #include "content/browser/android/browser_startup_controller.h" |
86 #include "content/browser/android/browser_surface_texture_manager.h" | 86 #include "content/browser/android/browser_surface_texture_manager.h" |
87 #include "content/browser/android/tracing_controller_android.h" | 87 #include "content/browser/android/tracing_controller_android.h" |
88 #include "content/browser/screen_orientation/screen_orientation_delegate_android .h" | 88 #include "content/browser/screen_orientation/screen_orientation_delegate_android .h" |
89 #include "content/public/browser/screen_orientation_provider.h" | 89 #include "content/public/browser/screen_orientation_provider.h" |
90 #include "ui/gl/gl_surface.h" | 90 #include "ui/gl/gl_surface.h" |
91 #endif | 91 #endif |
92 | 92 |
93 #if defined(OS_MACOSX) | |
94 #include "media/base/mac/avfoundation_glue.h" | |
95 #endif | |
96 | |
93 #if defined(OS_MACOSX) && !defined(OS_IOS) | 97 #if defined(OS_MACOSX) && !defined(OS_IOS) |
94 #include "base/memory/memory_pressure_monitor_mac.h" | 98 #include "base/memory/memory_pressure_monitor_mac.h" |
95 #include "content/browser/bootstrap_sandbox_mac.h" | 99 #include "content/browser/bootstrap_sandbox_mac.h" |
96 #include "content/browser/cocoa/system_hotkey_helper_mac.h" | 100 #include "content/browser/cocoa/system_hotkey_helper_mac.h" |
97 #include "content/browser/compositor/browser_compositor_view_mac.h" | 101 #include "content/browser/compositor/browser_compositor_view_mac.h" |
98 #include "content/browser/theme_helper_mac.h" | 102 #include "content/browser/theme_helper_mac.h" |
99 #endif | 103 #endif |
100 | 104 |
101 #if defined(OS_WIN) | 105 #if defined(OS_WIN) |
102 #include <windows.h> | 106 #include <windows.h> |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
640 // Prior to any processing happening on the io thread, we create the | 644 // Prior to any processing happening on the io thread, we create the |
641 // plugin service as it is predominantly used from the io thread, | 645 // plugin service as it is predominantly used from the io thread, |
642 // but must be created on the main thread. The service ctor is | 646 // but must be created on the main thread. The service ctor is |
643 // inexpensive and does not invoke the io_thread() accessor. | 647 // inexpensive and does not invoke the io_thread() accessor. |
644 { | 648 { |
645 TRACE_EVENT0("startup", "BrowserMainLoop::CreateThreads:PluginService"); | 649 TRACE_EVENT0("startup", "BrowserMainLoop::CreateThreads:PluginService"); |
646 PluginService::GetInstance()->Init(); | 650 PluginService::GetInstance()->Init(); |
647 } | 651 } |
648 #endif | 652 #endif |
649 | 653 |
654 #if defined(OS_MACOSX) | |
655 // Initialize AVFoundation if supported, for audio and video. | |
656 AVFoundationGlue::InitializeAVFoundation(); | |
jam
2015/05/27 14:54:37
btw do you have timings on how long this takes to
tommi (sloooow) - chröme
2015/05/27 15:54:53
Added perf trace. I'm building right now on my lap
| |
657 #endif | |
658 | |
650 // Need to initialize in-process GpuDataManager before creating threads. | 659 // Need to initialize in-process GpuDataManager before creating threads. |
651 // It's unsafe to append the gpu command line switches to the global | 660 // It's unsafe to append the gpu command line switches to the global |
652 // CommandLine::ForCurrentProcess object after threads are created. | 661 // CommandLine::ForCurrentProcess object after threads are created. |
653 if (UsingInProcessGpu()) { | 662 if (UsingInProcessGpu()) { |
654 bool initialize_gpu_data_manager = true; | 663 bool initialize_gpu_data_manager = true; |
655 #if defined(OS_ANDROID) | 664 #if defined(OS_ANDROID) |
656 if (!gfx::GLSurface::InitializeOneOff()) { | 665 if (!gfx::GLSurface::InitializeOneOff()) { |
657 // Single-process Android WebView supports no gpu. | 666 // Single-process Android WebView supports no gpu. |
658 LOG(ERROR) << "GLSurface::InitializeOneOff failed"; | 667 LOG(ERROR) << "GLSurface::InitializeOneOff failed"; |
659 initialize_gpu_data_manager = false; | 668 initialize_gpu_data_manager = false; |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1329 | 1338 |
1330 void BrowserMainLoop::EndStartupTracing() { | 1339 void BrowserMainLoop::EndStartupTracing() { |
1331 is_tracing_startup_ = false; | 1340 is_tracing_startup_ = false; |
1332 TracingController::GetInstance()->DisableRecording( | 1341 TracingController::GetInstance()->DisableRecording( |
1333 TracingController::CreateFileSink( | 1342 TracingController::CreateFileSink( |
1334 startup_trace_file_, | 1343 startup_trace_file_, |
1335 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1344 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
1336 } | 1345 } |
1337 | 1346 |
1338 } // namespace content | 1347 } // namespace content |
OLD | NEW |