| 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 { |
| 656 // Initialize AVFoundation if supported, for audio and video. |
| 657 TRACE_EVENT0("startup", |
| 658 "BrowserMainLoop::CreateThreads:InitializeAVFoundation"); |
| 659 AVFoundationGlue::InitializeAVFoundation(); |
| 660 } |
| 661 #endif |
| 662 |
| 650 // Need to initialize in-process GpuDataManager before creating threads. | 663 // Need to initialize in-process GpuDataManager before creating threads. |
| 651 // It's unsafe to append the gpu command line switches to the global | 664 // It's unsafe to append the gpu command line switches to the global |
| 652 // CommandLine::ForCurrentProcess object after threads are created. | 665 // CommandLine::ForCurrentProcess object after threads are created. |
| 653 if (UsingInProcessGpu()) { | 666 if (UsingInProcessGpu()) { |
| 654 bool initialize_gpu_data_manager = true; | 667 bool initialize_gpu_data_manager = true; |
| 655 #if defined(OS_ANDROID) | 668 #if defined(OS_ANDROID) |
| 656 if (!gfx::GLSurface::InitializeOneOff()) { | 669 if (!gfx::GLSurface::InitializeOneOff()) { |
| 657 // Single-process Android WebView supports no gpu. | 670 // Single-process Android WebView supports no gpu. |
| 658 LOG(ERROR) << "GLSurface::InitializeOneOff failed"; | 671 LOG(ERROR) << "GLSurface::InitializeOneOff failed"; |
| 659 initialize_gpu_data_manager = false; | 672 initialize_gpu_data_manager = false; |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1329 | 1342 |
| 1330 void BrowserMainLoop::EndStartupTracing() { | 1343 void BrowserMainLoop::EndStartupTracing() { |
| 1331 is_tracing_startup_ = false; | 1344 is_tracing_startup_ = false; |
| 1332 TracingController::GetInstance()->DisableRecording( | 1345 TracingController::GetInstance()->DisableRecording( |
| 1333 TracingController::CreateFileSink( | 1346 TracingController::CreateFileSink( |
| 1334 startup_trace_file_, | 1347 startup_trace_file_, |
| 1335 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1348 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
| 1336 } | 1349 } |
| 1337 | 1350 |
| 1338 } // namespace content | 1351 } // namespace content |
| OLD | NEW |