| 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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 #if !defined(OS_IOS) | 72 #if !defined(OS_IOS) |
| 73 #include "content/browser/renderer_host/render_process_host_impl.h" | 73 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 74 #endif | 74 #endif |
| 75 | 75 |
| 76 #if defined(OS_ANDROID) | 76 #if defined(OS_ANDROID) |
| 77 #include "base/android/jni_android.h" | 77 #include "base/android/jni_android.h" |
| 78 #include "content/browser/android/browser_startup_controller.h" | 78 #include "content/browser/android/browser_startup_controller.h" |
| 79 #include "content/browser/android/surface_texture_peer_browser_impl.h" | 79 #include "content/browser/android/surface_texture_peer_browser_impl.h" |
| 80 #include "content/browser/android/tracing_controller_android.h" | 80 #include "content/browser/android/tracing_controller_android.h" |
| 81 #include "content/browser/screen_orientation/screen_orientation_delegate_android
.h" |
| 82 #include "content/public/browser/screen_orientation_provider.h" |
| 81 #include "ui/gl/gl_surface.h" | 83 #include "ui/gl/gl_surface.h" |
| 82 #endif | 84 #endif |
| 83 | 85 |
| 84 #if defined(OS_MACOSX) && !defined(OS_IOS) | 86 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 85 #include "content/browser/bootstrap_sandbox_mac.h" | 87 #include "content/browser/bootstrap_sandbox_mac.h" |
| 86 #include "content/browser/cocoa/system_hotkey_helper_mac.h" | 88 #include "content/browser/cocoa/system_hotkey_helper_mac.h" |
| 87 #include "content/browser/theme_helper_mac.h" | 89 #include "content/browser/theme_helper_mac.h" |
| 88 #endif | 90 #endif |
| 89 | 91 |
| 90 #if defined(OS_WIN) | 92 #if defined(OS_WIN) |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 TRACE_EVENT0("startup", "BrowserMainLoop::InitStartupTracing"); | 535 TRACE_EVENT0("startup", "BrowserMainLoop::InitStartupTracing"); |
| 534 InitStartupTracing(parsed_command_line_); | 536 InitStartupTracing(parsed_command_line_); |
| 535 } | 537 } |
| 536 #endif // !defined(OS_IOS) | 538 #endif // !defined(OS_IOS) |
| 537 | 539 |
| 538 #if defined(OS_ANDROID) | 540 #if defined(OS_ANDROID) |
| 539 { | 541 { |
| 540 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:SurfaceTexturePeer"); | 542 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:SurfaceTexturePeer"); |
| 541 SurfaceTexturePeer::InitInstance(new SurfaceTexturePeerBrowserImpl()); | 543 SurfaceTexturePeer::InitInstance(new SurfaceTexturePeerBrowserImpl()); |
| 542 } | 544 } |
| 545 |
| 546 { |
| 547 TRACE_EVENT0("startup", |
| 548 "BrowserMainLoop::Subsystem:ScreenOrientationProvider"); |
| 549 screen_orientation_delegate_.reset( |
| 550 new ScreenOrientationDelegateAndroid()); |
| 551 ScreenOrientationProvider::SetDelegate(screen_orientation_delegate_.get()); |
| 552 } |
| 543 #endif | 553 #endif |
| 544 | 554 |
| 545 if (parsed_command_line_.HasSwitch(switches::kMemoryMetrics)) { | 555 if (parsed_command_line_.HasSwitch(switches::kMemoryMetrics)) { |
| 546 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:MemoryObserver"); | 556 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:MemoryObserver"); |
| 547 memory_observer_.reset(new MemoryObserver()); | 557 memory_observer_.reset(new MemoryObserver()); |
| 548 base::MessageLoop::current()->AddTaskObserver(memory_observer_.get()); | 558 base::MessageLoop::current()->AddTaskObserver(memory_observer_.get()); |
| 549 } | 559 } |
| 550 | 560 |
| 551 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) | 561 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) |
| 552 trace_memory_controller_.reset(new base::debug::TraceMemoryController( | 562 trace_memory_controller_.reset(new base::debug::TraceMemoryController( |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 | 1207 |
| 1198 void BrowserMainLoop::EndStartupTracing() { | 1208 void BrowserMainLoop::EndStartupTracing() { |
| 1199 is_tracing_startup_ = false; | 1209 is_tracing_startup_ = false; |
| 1200 TracingController::GetInstance()->DisableRecording( | 1210 TracingController::GetInstance()->DisableRecording( |
| 1201 TracingController::CreateFileSink( | 1211 TracingController::CreateFileSink( |
| 1202 startup_trace_file_, | 1212 startup_trace_file_, |
| 1203 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1213 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
| 1204 } | 1214 } |
| 1205 | 1215 |
| 1206 } // namespace content | 1216 } // namespace content |
| OLD | NEW |