| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 NOTREACHED(); | 908 NOTREACHED(); |
| 909 } | 909 } |
| 910 | 910 |
| 911 TRACE_EVENT_END0("startup", "BrowserMainLoop::CreateThreads:start"); | 911 TRACE_EVENT_END0("startup", "BrowserMainLoop::CreateThreads:start"); |
| 912 } | 912 } |
| 913 created_threads_ = true; | 913 created_threads_ = true; |
| 914 return result_code_; | 914 return result_code_; |
| 915 } | 915 } |
| 916 | 916 |
| 917 int BrowserMainLoop::PreMainMessageLoopRun() { | 917 int BrowserMainLoop::PreMainMessageLoopRun() { |
| 918 #if defined(MOJO_SHELL_CLIENT) | |
| 919 if (IsRunningInMojoShell()) { | 918 if (IsRunningInMojoShell()) { |
| 920 MojoShellConnectionImpl::Create(); | 919 MojoShellConnectionImpl::Create(); |
| 921 MojoShellConnectionImpl::Get()->BindToCommandLinePlatformChannel(); | 920 MojoShellConnectionImpl::Get()->BindToCommandLinePlatformChannel(); |
| 922 #if defined(USE_AURA) | 921 #if defined(MOJO_SHELL_CLIENT) && defined(USE_AURA) |
| 923 views::WindowManagerConnection::Create( | 922 views::WindowManagerConnection::Create( |
| 924 MojoShellConnection::Get()->GetShell()); | 923 MojoShellConnection::Get()->GetShell()); |
| 925 #endif | 924 #endif |
| 926 } | 925 } |
| 927 #endif | |
| 928 | 926 |
| 929 if (parts_) { | 927 if (parts_) { |
| 930 TRACE_EVENT0("startup", | 928 TRACE_EVENT0("startup", |
| 931 "BrowserMainLoop::CreateThreads:PreMainMessageLoopRun"); | 929 "BrowserMainLoop::CreateThreads:PreMainMessageLoopRun"); |
| 932 TRACK_SCOPED_REGION( | 930 TRACK_SCOPED_REGION( |
| 933 "Startup", "BrowserMainLoop::PreMainMessageLoopRun"); | 931 "Startup", "BrowserMainLoop::PreMainMessageLoopRun"); |
| 934 | 932 |
| 935 parts_->PreMainMessageLoopRun(); | 933 parts_->PreMainMessageLoopRun(); |
| 936 } | 934 } |
| 937 | 935 |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 | 1184 |
| 1187 int BrowserMainLoop::BrowserThreadsStarted() { | 1185 int BrowserMainLoop::BrowserThreadsStarted() { |
| 1188 TRACE_EVENT0("startup", "BrowserMainLoop::BrowserThreadsStarted"); | 1186 TRACE_EVENT0("startup", "BrowserMainLoop::BrowserThreadsStarted"); |
| 1189 | 1187 |
| 1190 #if !defined(OS_IOS) | 1188 #if !defined(OS_IOS) |
| 1191 // Bring up Mojo IPC and shell as early as possible. | 1189 // Bring up Mojo IPC and shell as early as possible. |
| 1192 mojo_ipc_support_.reset(new IPC::ScopedIPCSupport( | 1190 mojo_ipc_support_.reset(new IPC::ScopedIPCSupport( |
| 1193 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) | 1191 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) |
| 1194 ->task_runner())); | 1192 ->task_runner())); |
| 1195 mojo_shell_context_.reset(new MojoShellContext); | 1193 mojo_shell_context_.reset(new MojoShellContext); |
| 1196 #endif | 1194 #endif // !defined(OS_IOS) |
| 1197 | 1195 |
| 1198 #if !defined(OS_IOS) | 1196 #if !defined(OS_IOS) |
| 1199 indexed_db_thread_.reset(new base::Thread("IndexedDB")); | 1197 indexed_db_thread_.reset(new base::Thread("IndexedDB")); |
| 1200 indexed_db_thread_->Start(); | 1198 indexed_db_thread_->Start(); |
| 1201 #endif | 1199 #endif |
| 1202 | 1200 |
| 1203 #if !defined(OS_IOS) | 1201 #if !defined(OS_IOS) |
| 1204 HistogramSynchronizer::GetInstance(); | 1202 HistogramSynchronizer::GetInstance(); |
| 1205 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) | 1203 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
| 1206 // Up the priority of the UI thread. | 1204 // Up the priority of the UI thread. |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1470 DCHECK(is_tracing_startup_for_duration_); | 1468 DCHECK(is_tracing_startup_for_duration_); |
| 1471 | 1469 |
| 1472 is_tracing_startup_for_duration_ = false; | 1470 is_tracing_startup_for_duration_ = false; |
| 1473 TracingController::GetInstance()->StopTracing( | 1471 TracingController::GetInstance()->StopTracing( |
| 1474 TracingController::CreateFileSink( | 1472 TracingController::CreateFileSink( |
| 1475 startup_trace_file_, | 1473 startup_trace_file_, |
| 1476 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1474 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
| 1477 } | 1475 } |
| 1478 | 1476 |
| 1479 } // namespace content | 1477 } // namespace content |
| OLD | NEW |