| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 #if !defined(OS_ANDROID) | 164 #if !defined(OS_ANDROID) |
| 165 #include "content/public/browser/zygote_handle_linux.h" | 165 #include "content/public/browser/zygote_handle_linux.h" |
| 166 #endif // !defined(OS_ANDROID) | 166 #endif // !defined(OS_ANDROID) |
| 167 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) | 167 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) |
| 168 | 168 |
| 169 | 169 |
| 170 #if defined(ENABLE_PLUGINS) | 170 #if defined(ENABLE_PLUGINS) |
| 171 #include "content/browser/plugin_service_impl.h" | 171 #include "content/browser/plugin_service_impl.h" |
| 172 #endif | 172 #endif |
| 173 | 173 |
| 174 #if defined(ENABLE_MOJO_CDM) && defined(ENABLE_PEPPER_CDMS) |
| 175 #include "content/browser/media/cdm_service_impl.h" |
| 176 #endif |
| 177 |
| 174 #if defined(USE_X11) | 178 #if defined(USE_X11) |
| 175 #include "ui/base/x/x11_util_internal.h" | 179 #include "ui/base/x/x11_util_internal.h" |
| 176 #include "ui/gfx/x/x11_connection.h" | 180 #include "ui/gfx/x/x11_connection.h" |
| 177 #include "ui/gfx/x/x11_switches.h" | 181 #include "ui/gfx/x/x11_switches.h" |
| 178 #include "ui/gfx/x/x11_types.h" | 182 #include "ui/gfx/x/x11_types.h" |
| 179 #endif | 183 #endif |
| 180 | 184 |
| 181 #if defined(USE_NSS_CERTS) || !defined(USE_OPENSSL) | 185 #if defined(USE_NSS_CERTS) || !defined(USE_OPENSSL) |
| 182 #include "crypto/nss_util.h" | 186 #include "crypto/nss_util.h" |
| 183 #endif | 187 #endif |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 // Prior to any processing happening on the IO thread, we create the | 740 // Prior to any processing happening on the IO thread, we create the |
| 737 // plugin service as it is predominantly used from the IO thread, | 741 // plugin service as it is predominantly used from the IO thread, |
| 738 // but must be created on the main thread. The service ctor is | 742 // but must be created on the main thread. The service ctor is |
| 739 // inexpensive and does not invoke the io_thread() accessor. | 743 // inexpensive and does not invoke the io_thread() accessor. |
| 740 { | 744 { |
| 741 TRACE_EVENT0("startup", "BrowserMainLoop::CreateThreads:PluginService"); | 745 TRACE_EVENT0("startup", "BrowserMainLoop::CreateThreads:PluginService"); |
| 742 PluginService::GetInstance()->Init(); | 746 PluginService::GetInstance()->Init(); |
| 743 } | 747 } |
| 744 #endif | 748 #endif |
| 745 | 749 |
| 750 #if defined(ENABLE_MOJO_CDM) && defined(ENABLE_PEPPER_CDMS) |
| 751 // Prior to any processing happening on the IO thread, we create the |
| 752 // CDM service as it is predominantly used from the IO thread. This must |
| 753 // be called on the main thread since it involves file path checks. |
| 754 CdmService::GetInstance()->Init(); |
| 755 #endif |
| 756 |
| 746 #if defined(OS_MACOSX) && !defined(OS_IOS) | 757 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 747 // The WindowResizeHelper allows the UI thread to wait on specific renderer | 758 // The WindowResizeHelper allows the UI thread to wait on specific renderer |
| 748 // and GPU messages from the IO thread. Initializing it before the IO thread | 759 // and GPU messages from the IO thread. Initializing it before the IO thread |
| 749 // starts ensures the affected IO thread messages always have somewhere to go. | 760 // starts ensures the affected IO thread messages always have somewhere to go. |
| 750 ui::WindowResizeHelperMac::Get()->Init(base::ThreadTaskRunnerHandle::Get()); | 761 ui::WindowResizeHelperMac::Get()->Init(base::ThreadTaskRunnerHandle::Get()); |
| 751 #endif | 762 #endif |
| 752 | 763 |
| 753 // 1) Need to initialize in-process GpuDataManager before creating threads. | 764 // 1) Need to initialize in-process GpuDataManager before creating threads. |
| 754 // It's unsafe to append the gpu command line switches to the global | 765 // It's unsafe to append the gpu command line switches to the global |
| 755 // CommandLine::ForCurrentProcess object after threads are created. | 766 // CommandLine::ForCurrentProcess object after threads are created. |
| (...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1477 DCHECK(is_tracing_startup_for_duration_); | 1488 DCHECK(is_tracing_startup_for_duration_); |
| 1478 | 1489 |
| 1479 is_tracing_startup_for_duration_ = false; | 1490 is_tracing_startup_for_duration_ = false; |
| 1480 TracingController::GetInstance()->StopTracing( | 1491 TracingController::GetInstance()->StopTracing( |
| 1481 TracingController::CreateFileSink( | 1492 TracingController::CreateFileSink( |
| 1482 startup_trace_file_, | 1493 startup_trace_file_, |
| 1483 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1494 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
| 1484 } | 1495 } |
| 1485 | 1496 |
| 1486 } // namespace content | 1497 } // namespace content |
| OLD | NEW |