Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 291473002: ozone: Initialize a subsystem only if necessary. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-r270817 Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/compositor/software_output_device_ozone_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) 116 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED)
117 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" 117 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h"
118 #endif 118 #endif
119 119
120 #if defined(USE_X11) 120 #if defined(USE_X11)
121 #include "ui/gfx/x/x11_connection.h" 121 #include "ui/gfx/x/x11_connection.h"
122 #include "ui/gfx/x/x11_types.h" 122 #include "ui/gfx/x/x11_types.h"
123 #endif 123 #endif
124 124
125 #if defined(USE_OZONE)
126 #include "ui/ozone/ozone_platform.h"
127 #endif
128
129 // One of the linux specific headers defines this as a macro. 125 // One of the linux specific headers defines this as a macro.
130 #ifdef DestroyAll 126 #ifdef DestroyAll
131 #undef DestroyAll 127 #undef DestroyAll
132 #endif 128 #endif
133 129
134 namespace content { 130 namespace content {
135 namespace { 131 namespace {
136 132
137 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) 133 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
138 void SetupSandbox(const CommandLine& parsed_command_line) { 134 void SetupSandbox(const CommandLine& parsed_command_line) {
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 established_gpu_channel = true; 947 established_gpu_channel = true;
952 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel); 948 BrowserGpuChannelHostFactory::Initialize(established_gpu_channel);
953 #endif 949 #endif
954 950
955 #if defined(OS_LINUX) && defined(USE_UDEV) 951 #if defined(OS_LINUX) && defined(USE_UDEV)
956 device_monitor_linux_.reset(new DeviceMonitorLinux()); 952 device_monitor_linux_.reset(new DeviceMonitorLinux());
957 #elif defined(OS_MACOSX) 953 #elif defined(OS_MACOSX)
958 device_monitor_mac_.reset(new DeviceMonitorMac()); 954 device_monitor_mac_.reset(new DeviceMonitorMac());
959 #endif 955 #endif
960 956
961 #if defined(USE_OZONE)
962 ui::OzonePlatform::Initialize();
963 #endif
964
965 // RDH needs the IO thread to be created 957 // RDH needs the IO thread to be created
966 { 958 {
967 TRACE_EVENT0("startup", 959 TRACE_EVENT0("startup",
968 "BrowserMainLoop::BrowserThreadsStarted:InitResourceDispatcherHost"); 960 "BrowserMainLoop::BrowserThreadsStarted:InitResourceDispatcherHost");
969 resource_dispatcher_host_.reset(new ResourceDispatcherHostImpl()); 961 resource_dispatcher_host_.reset(new ResourceDispatcherHostImpl());
970 } 962 }
971 963
972 // MediaStreamManager needs the IO thread to be created. 964 // MediaStreamManager needs the IO thread to be created.
973 { 965 {
974 TRACE_EVENT0("startup", 966 TRACE_EVENT0("startup",
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1127 base::TimeDelta::FromSeconds(delay_secs)); 1119 base::TimeDelta::FromSeconds(delay_secs));
1128 } 1120 }
1129 1121
1130 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) { 1122 void BrowserMainLoop::EndStartupTracing(const base::FilePath& trace_file) {
1131 is_tracing_startup_ = false; 1123 is_tracing_startup_ = false;
1132 TracingController::GetInstance()->DisableRecording( 1124 TracingController::GetInstance()->DisableRecording(
1133 trace_file, base::Bind(&OnStoppedStartupTracing)); 1125 trace_file, base::Bind(&OnStoppedStartupTracing));
1134 } 1126 }
1135 1127
1136 } // namespace content 1128 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/compositor/software_output_device_ozone_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698