OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/service/service_process.h" | 5 #include "chrome/service/service_process.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
165 // If no locale was specified anywhere, use the default one. | 165 // If no locale was specified anywhere, use the default one. |
166 if (locale.empty()) | 166 if (locale.empty()) |
167 locale = kDefaultServiceProcessLocale; | 167 locale = kDefaultServiceProcessLocale; |
168 } | 168 } |
169 ResourceBundle::InitSharedInstance(locale); | 169 ResourceBundle::InitSharedInstance(locale); |
170 | 170 |
171 PrepareRestartOnCrashEnviroment(command_line); | 171 PrepareRestartOnCrashEnviroment(command_line); |
172 | 172 |
173 #if defined(ENABLE_REMOTING) | 173 #if defined(ENABLE_REMOTING) |
174 // Load media codecs, required by the Chromoting host | 174 // Load media codecs, required by the Chromoting host |
175 bool initialized_media_library = false; | |
176 #if defined(OS_MACOSX) | |
177 FilePath bundle_path = base::mac::MainAppBundlePath(); | |
178 | |
179 initialized_media_library = | |
180 media::InitializeMediaLibrary(bundle_path.Append("Libraries")); | |
181 #else | |
182 FilePath module_path; | 175 FilePath module_path; |
183 initialized_media_library = | 176 if (PathService::Get(chrome::DIR_MEDIA_LIBS, &module_path)) |
awong
2011/02/25 02:41:59
Single-line ifs seem to be wrapped in braces in th
| |
184 PathService::Get(base::DIR_MODULE, &module_path) && | 177 media::InitializeMediaLibrary(module_path); |
185 media::InitializeMediaLibrary(module_path); | 178 if (media::IsMediaLibraryInitialized()) { |
186 #endif | 179 // Initialize chromoting host manager. |
187 | 180 remoting_host_manager_ = new remoting::ChromotingHostManager(this); |
188 // Initialize chromoting host manager. | 181 remoting_host_manager_->Initialize(message_loop, |
189 remoting_host_manager_ = new remoting::ChromotingHostManager(this); | 182 file_thread_->message_loop_proxy()); |
190 remoting_host_manager_->Initialize(message_loop, | 183 } |
191 file_thread_->message_loop_proxy()); | |
192 #endif // ENABLE_REMOTING | 184 #endif // ENABLE_REMOTING |
193 | 185 |
194 // Enable Cloud Print if needed. First check the command-line. | 186 // Enable Cloud Print if needed. First check the command-line. |
195 bool cloud_print_proxy_enabled = | 187 bool cloud_print_proxy_enabled = |
196 command_line.HasSwitch(switches::kEnableCloudPrintProxy); | 188 command_line.HasSwitch(switches::kEnableCloudPrintProxy); |
197 if (!cloud_print_proxy_enabled) { | 189 if (!cloud_print_proxy_enabled) { |
198 // Then check if the cloud print proxy was previously enabled. | 190 // Then check if the cloud print proxy was previously enabled. |
199 service_prefs_->GetBoolean(prefs::kCloudPrintProxyEnabled, | 191 service_prefs_->GetBoolean(prefs::kCloudPrintProxyEnabled, |
200 &cloud_print_proxy_enabled); | 192 &cloud_print_proxy_enabled); |
201 } | 193 } |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
342 } | 334 } |
343 } | 335 } |
344 | 336 |
345 ServiceProcess::~ServiceProcess() { | 337 ServiceProcess::~ServiceProcess() { |
346 Teardown(); | 338 Teardown(); |
347 g_service_process = NULL; | 339 g_service_process = NULL; |
348 } | 340 } |
349 | 341 |
350 // Disable refcounting for runnable method because it is really not needed | 342 // Disable refcounting for runnable method because it is really not needed |
351 // when we post tasks on the main message loop. | 343 // when we post tasks on the main message loop. |
352 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcess); | 344 DISABLE_RUNNABLE_METHOD_REFCOUNT(ServiceProcess); |
awong
2011/02/25 02:41:59
Gha...this needs in the headerfile after the class
| |
OLD | NEW |