| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 #if defined(OS_ANDROID) | 77 #if defined(OS_ANDROID) |
| 78 #include "base/android/jni_android.h" | 78 #include "base/android/jni_android.h" |
| 79 #include "content/browser/android/browser_startup_controller.h" | 79 #include "content/browser/android/browser_startup_controller.h" |
| 80 #include "content/browser/android/surface_texture_peer_browser_impl.h" | 80 #include "content/browser/android/surface_texture_peer_browser_impl.h" |
| 81 #include "content/browser/android/tracing_controller_android.h" | 81 #include "content/browser/android/tracing_controller_android.h" |
| 82 #include "ui/gl/gl_surface.h" | 82 #include "ui/gl/gl_surface.h" |
| 83 #endif | 83 #endif |
| 84 | 84 |
| 85 #if defined(OS_MACOSX) && !defined(OS_IOS) | 85 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 86 #include "content/browser/theme_helper_mac.h" | 86 #include "content/browser/theme_helper_mac.h" |
| 87 #include "ui/compositor/compositor.h" |
| 87 #endif | 88 #endif |
| 88 | 89 |
| 89 #if defined(OS_WIN) | 90 #if defined(OS_WIN) |
| 90 #include <windows.h> | 91 #include <windows.h> |
| 91 #include <commctrl.h> | 92 #include <commctrl.h> |
| 92 #include <shellapi.h> | 93 #include <shellapi.h> |
| 93 | 94 |
| 94 #include "content/browser/system_message_window_win.h" | 95 #include "content/browser/system_message_window_win.h" |
| 95 #include "content/common/sandbox_win.h" | 96 #include "content/common/sandbox_win.h" |
| 96 #include "net/base/winsock_init.h" | 97 #include "net/base/winsock_init.h" |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:GPUProcessHostShim"); | 748 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:GPUProcessHostShim"); |
| 748 GpuProcessHostUIShim::DestroyAll(); | 749 GpuProcessHostUIShim::DestroyAll(); |
| 749 } | 750 } |
| 750 // Cancel pending requests and prevent new requests. | 751 // Cancel pending requests and prevent new requests. |
| 751 if (resource_dispatcher_host_) { | 752 if (resource_dispatcher_host_) { |
| 752 TRACE_EVENT0("shutdown", | 753 TRACE_EVENT0("shutdown", |
| 753 "BrowserMainLoop::Subsystem:ResourceDispatcherHost"); | 754 "BrowserMainLoop::Subsystem:ResourceDispatcherHost"); |
| 754 resource_dispatcher_host_.get()->Shutdown(); | 755 resource_dispatcher_host_.get()->Shutdown(); |
| 755 } | 756 } |
| 756 | 757 |
| 757 #if defined(USE_AURA) | 758 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 758 { | 759 if (IsDelegatedRendererEnabled()) |
| 760 ui::Compositor::Terminate(); |
| 761 #endif |
| 762 |
| 763 #if defined(USE_AURA) || defined(OS_MACOSX) |
| 764 if (ShouldInitializeBrowserGpuChannelAndTransportSurface()) { |
| 759 TRACE_EVENT0("shutdown", | 765 TRACE_EVENT0("shutdown", |
| 760 "BrowserMainLoop::Subsystem:ImageTransportFactory"); | 766 "BrowserMainLoop::Subsystem:ImageTransportFactory"); |
| 761 ImageTransportFactory::Terminate(); | 767 ImageTransportFactory::Terminate(); |
| 762 } | 768 } |
| 763 #endif | 769 #endif |
| 764 | 770 |
| 765 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) | 771 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 766 ZygoteHostImpl::GetInstance()->TearDownAfterLastChild(); | 772 ZygoteHostImpl::GetInstance()->TearDownAfterLastChild(); |
| 767 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) | 773 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 768 | 774 |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1066 #if defined(USE_X11) | 1072 #if defined(USE_X11) |
| 1067 if (!gfx::GetXDisplay()) | 1073 if (!gfx::GetXDisplay()) |
| 1068 return false; | 1074 return false; |
| 1069 #endif | 1075 #endif |
| 1070 | 1076 |
| 1071 // Env creates the compositor. Aura widgets need the compositor to be created | 1077 // Env creates the compositor. Aura widgets need the compositor to be created |
| 1072 // before they can be initialized by the browser. | 1078 // before they can be initialized by the browser. |
| 1073 aura::Env::CreateInstance(true); | 1079 aura::Env::CreateInstance(true); |
| 1074 #endif // defined(USE_AURA) | 1080 #endif // defined(USE_AURA) |
| 1075 | 1081 |
| 1082 // Create the compositor for the non-Aura delegated renderer on Mac. |
| 1083 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 1084 if (IsDelegatedRendererEnabled()) |
| 1085 ui::Compositor::Initialize(); |
| 1086 #endif |
| 1087 |
| 1076 if (parts_) | 1088 if (parts_) |
| 1077 parts_->ToolkitInitialized(); | 1089 parts_->ToolkitInitialized(); |
| 1078 | 1090 |
| 1079 return true; | 1091 return true; |
| 1080 } | 1092 } |
| 1081 | 1093 |
| 1082 void BrowserMainLoop::MainMessageLoopRun() { | 1094 void BrowserMainLoop::MainMessageLoopRun() { |
| 1083 #if defined(OS_ANDROID) | 1095 #if defined(OS_ANDROID) |
| 1084 // Android's main message loop is the Java message loop. | 1096 // Android's main message loop is the Java message loop. |
| 1085 NOTREACHED(); | 1097 NOTREACHED(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1130 base::TimeDelta::FromSeconds(delay_secs)); | 1142 base::TimeDelta::FromSeconds(delay_secs)); |
| 1131 } | 1143 } |
| 1132 | 1144 |
| 1133 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) { | 1145 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) { |
| 1134 is_tracing_startup_ = false; | 1146 is_tracing_startup_ = false; |
| 1135 TracingController::GetInstance()->DisableRecording( | 1147 TracingController::GetInstance()->DisableRecording( |
| 1136 trace_file, base::Bind(&OnStoppedStartupTracing)); | 1148 trace_file, base::Bind(&OnStoppedStartupTracing)); |
| 1137 } | 1149 } |
| 1138 | 1150 |
| 1139 } // namespace content | 1151 } // namespace content |
| OLD | NEW |