| 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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 #include "ui/base/clipboard/clipboard.h" | 63 #include "ui/base/clipboard/clipboard.h" |
| 64 | 64 |
| 65 #if defined(USE_AURA) | 65 #if defined(USE_AURA) |
| 66 #include "content/browser/compositor/image_transport_factory.h" | 66 #include "content/browser/compositor/image_transport_factory.h" |
| 67 #endif | 67 #endif |
| 68 | 68 |
| 69 #if defined(OS_ANDROID) | 69 #if defined(OS_ANDROID) |
| 70 #include "base/android/jni_android.h" | 70 #include "base/android/jni_android.h" |
| 71 #include "content/browser/android/browser_startup_controller.h" | 71 #include "content/browser/android/browser_startup_controller.h" |
| 72 #include "content/browser/android/surface_texture_peer_browser_impl.h" | 72 #include "content/browser/android/surface_texture_peer_browser_impl.h" |
| 73 #include "ui/gl/gl_surface.h" | |
| 74 #endif | 73 #endif |
| 75 | 74 |
| 76 #if defined(OS_MACOSX) && !defined(OS_IOS) | 75 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 77 #include "content/browser/theme_helper_mac.h" | 76 #include "content/browser/theme_helper_mac.h" |
| 78 #endif | 77 #endif |
| 79 | 78 |
| 80 #if defined(OS_WIN) | 79 #if defined(OS_WIN) |
| 81 #include <windows.h> | 80 #include <windows.h> |
| 82 #include <commctrl.h> | 81 #include <commctrl.h> |
| 83 #include <shellapi.h> | 82 #include <shellapi.h> |
| (...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 // (this thread is UI thread, and io_thread_ is for IPCs). | 940 // (this thread is UI thread, and io_thread_ is for IPCs). |
| 942 io_thread_->SetPriority(base::kThreadPriority_Display); | 941 io_thread_->SetPriority(base::kThreadPriority_Display); |
| 943 base::PlatformThread::SetThreadPriority( | 942 base::PlatformThread::SetThreadPriority( |
| 944 base::PlatformThread::CurrentHandle(), | 943 base::PlatformThread::CurrentHandle(), |
| 945 base::kThreadPriority_Display); | 944 base::kThreadPriority_Display); |
| 946 #endif | 945 #endif |
| 947 | 946 |
| 948 #if !defined(OS_IOS) | 947 #if !defined(OS_IOS) |
| 949 HistogramSynchronizer::GetInstance(); | 948 HistogramSynchronizer::GetInstance(); |
| 950 | 949 |
| 951 #if defined(OS_ANDROID) | |
| 952 // On Android, GLSurface::InitializeOneOff() must be called before initalizing | |
| 953 // the GpuDataManagerImpl as it uses the GL bindings. crbug.com/326295 | |
| 954 if (!gfx::GLSurface::InitializeOneOff()) | |
| 955 LOG(FATAL) << "GLSurface::InitializeOneOff failed"; | |
| 956 #endif | |
| 957 | |
| 958 // Initialize the GpuDataManager before we set up the MessageLoops because | 950 // Initialize the GpuDataManager before we set up the MessageLoops because |
| 959 // otherwise we'll trigger the assertion about doing IO on the UI thread. | 951 // otherwise we'll trigger the assertion about doing IO on the UI thread. |
| 960 GpuDataManagerImpl::GetInstance()->Initialize(); | 952 GpuDataManagerImpl::GetInstance()->Initialize(); |
| 961 | 953 |
| 962 bool always_uses_gpu = IsForceCompositingModeEnabled(); | 954 bool always_uses_gpu = IsForceCompositingModeEnabled(); |
| 963 bool established_gpu_channel = false; | 955 bool established_gpu_channel = false; |
| 964 #if defined(USE_AURA) || defined(OS_ANDROID) | 956 #if defined(USE_AURA) || defined(OS_ANDROID) |
| 965 established_gpu_channel = | 957 established_gpu_channel = |
| 966 !parsed_command_line_.HasSwitch(switches::kDisableGpuProcessPrelaunch) || | 958 !parsed_command_line_.HasSwitch(switches::kDisableGpuProcessPrelaunch) || |
| 967 parsed_command_line_.HasSwitch(switches::kSingleProcess) || | 959 parsed_command_line_.HasSwitch(switches::kSingleProcess) || |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1125 base::TimeDelta::FromSeconds(delay_secs)); | 1117 base::TimeDelta::FromSeconds(delay_secs)); |
| 1126 } | 1118 } |
| 1127 | 1119 |
| 1128 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) { | 1120 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) { |
| 1129 is_tracing_startup_ = false; | 1121 is_tracing_startup_ = false; |
| 1130 TracingController::GetInstance()->DisableRecording( | 1122 TracingController::GetInstance()->DisableRecording( |
| 1131 trace_file, TracingController::TracingFileResultCallback()); | 1123 trace_file, TracingController::TracingFileResultCallback()); |
| 1132 } | 1124 } |
| 1133 | 1125 |
| 1134 } // namespace content | 1126 } // namespace content |
| OLD | NEW |