| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 #if defined(OS_ANDROID) | 79 #if defined(OS_ANDROID) |
| 80 #include "base/android/jni_android.h" | 80 #include "base/android/jni_android.h" |
| 81 #include "content/browser/android/browser_startup_controller.h" | 81 #include "content/browser/android/browser_startup_controller.h" |
| 82 #include "content/browser/android/surface_texture_peer_browser_impl.h" | 82 #include "content/browser/android/surface_texture_peer_browser_impl.h" |
| 83 #include "content/browser/android/tracing_controller_android.h" | 83 #include "content/browser/android/tracing_controller_android.h" |
| 84 #include "ui/gl/gl_surface.h" | 84 #include "ui/gl/gl_surface.h" |
| 85 #endif | 85 #endif |
| 86 | 86 |
| 87 #if defined(OS_MACOSX) && !defined(OS_IOS) | 87 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 88 #include "content/browser/bootstrap_sandbox_mac.h" |
| 88 #include "content/browser/theme_helper_mac.h" | 89 #include "content/browser/theme_helper_mac.h" |
| 89 #endif | 90 #endif |
| 90 | 91 |
| 91 #if defined(OS_WIN) | 92 #if defined(OS_WIN) |
| 92 #include <windows.h> | 93 #include <windows.h> |
| 93 #include <commctrl.h> | 94 #include <commctrl.h> |
| 94 #include <shellapi.h> | 95 #include <shellapi.h> |
| 95 | 96 |
| 96 #include "content/browser/system_message_window_win.h" | 97 #include "content/browser/system_message_window_win.h" |
| 97 #include "content/common/sandbox_win.h" | 98 #include "content/common/sandbox_win.h" |
| (...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1025 TRACE_EVENT_SCOPE_THREAD); | 1026 TRACE_EVENT_SCOPE_THREAD); |
| 1026 BrowserThread::PostTask( | 1027 BrowserThread::PostTask( |
| 1027 BrowserThread::IO, FROM_HERE, base::Bind( | 1028 BrowserThread::IO, FROM_HERE, base::Bind( |
| 1028 base::IgnoreResult(&GpuProcessHost::Get), | 1029 base::IgnoreResult(&GpuProcessHost::Get), |
| 1029 GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, | 1030 GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, |
| 1030 CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP)); | 1031 CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP)); |
| 1031 } | 1032 } |
| 1032 | 1033 |
| 1033 #if defined(OS_MACOSX) | 1034 #if defined(OS_MACOSX) |
| 1034 ThemeHelperMac::GetInstance(); | 1035 ThemeHelperMac::GetInstance(); |
| 1035 #endif | 1036 { |
| 1037 TRACE_EVENT0("startup", |
| 1038 "BrowserMainLoop::BrowserThreadsStarted:BootstrapSandbox"); |
| 1039 CHECK(GetBootstrapSandbox()); |
| 1040 } |
| 1041 #endif // defined(OS_MACOSX) |
| 1042 |
| 1036 #endif // !defined(OS_IOS) | 1043 #endif // !defined(OS_IOS) |
| 1037 | 1044 |
| 1038 return result_code_; | 1045 return result_code_; |
| 1039 } | 1046 } |
| 1040 | 1047 |
| 1041 bool BrowserMainLoop::InitializeToolkit() { | 1048 bool BrowserMainLoop::InitializeToolkit() { |
| 1042 TRACE_EVENT0("startup", "BrowserMainLoop::InitializeToolkit"); | 1049 TRACE_EVENT0("startup", "BrowserMainLoop::InitializeToolkit"); |
| 1043 // TODO(evan): this function is rather subtle, due to the variety | 1050 // TODO(evan): this function is rather subtle, due to the variety |
| 1044 // of intersecting ifdefs we have. To keep it easy to follow, there | 1051 // of intersecting ifdefs we have. To keep it easy to follow, there |
| 1045 // are no #else branches on any #ifs. | 1052 // are no #else branches on any #ifs. |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 base::TimeDelta::FromSeconds(delay_secs)); | 1138 base::TimeDelta::FromSeconds(delay_secs)); |
| 1132 } | 1139 } |
| 1133 | 1140 |
| 1134 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) { | 1141 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) { |
| 1135 is_tracing_startup_ = false; | 1142 is_tracing_startup_ = false; |
| 1136 TracingController::GetInstance()->DisableRecording( | 1143 TracingController::GetInstance()->DisableRecording( |
| 1137 trace_file, base::Bind(&OnStoppedStartupTracing)); | 1144 trace_file, base::Bind(&OnStoppedStartupTracing)); |
| 1138 } | 1145 } |
| 1139 | 1146 |
| 1140 } // namespace content | 1147 } // namespace content |
| OLD | NEW |