Chromium Code Reviews| Index: chrome/service/service_process.cc |
| diff --git a/chrome/service/service_process.cc b/chrome/service/service_process.cc |
| index f490fb50c82f5f63a0a6bae23f81eb428f736b82..274fc4f06fa20a716e76ad2b19a1282fcfa2c967 100644 |
| --- a/chrome/service/service_process.cc |
| +++ b/chrome/service/service_process.cc |
| @@ -27,6 +27,7 @@ |
| #include "chrome/service/service_process_prefs.h" |
| #include "grit/chromium_strings.h" |
| #include "grit/generated_resources.h" |
| +#include "media/base/media.h" |
| #include "net/base/network_change_notifier.h" |
| #include "ui/base/l10n/l10n_util.h" |
| #include "ui/base/resource/resource_bundle.h" |
| @@ -160,11 +161,25 @@ bool ServiceProcess::Initialize(MessageLoop* message_loop, |
| PrepareRestartOnCrashEnviroment(command_line); |
| #if defined(ENABLE_REMOTING) |
| + // Load media codecs, required by the Chromoting host |
| + bool initialized_media_library = false; |
| +#if defined(OS_MACOSX) |
| + FilePath bundle_path = base::mac::MainAppBundlePath(); |
| + |
| + initialized_media_library = |
| + media::InitializeMediaLibrary(bundle_path.Append("Libraries")); |
| +#else |
| + FilePath module_path; |
| + initialized_media_library = |
| + PathService::Get(base::DIR_MODULE, &module_path) && |
| + media::InitializeMediaLibrary(module_path); |
| +#endif |
| + |
| // Initialize chromoting host manager. |
| remoting_host_manager_ = new remoting::ChromotingHostManager(this); |
| remoting_host_manager_->Initialize(message_loop, |
| file_thread_->message_loop_proxy()); |
| -#endif |
| +#endif // ENABLE_REMOTING |
| // Enable Cloud Print if needed. First check the command-line. |
| bool cloud_print_proxy_enabled = |
| @@ -224,7 +239,8 @@ void ServiceProcess::Shutdown() { |
| #if defined(ENABLE_REMOTING) |
| // During shutdown of remoting host it has some left over operations on |
| // the UI thread. So we let the teardown to proceed asynchronously |
| - remoting_host_manager_->Teardown( |
| + if (remoting_host_manager_.get()) |
|
Alpha Left Google
2011/02/17 17:23:10
nit: since the following statement span across two
|
| + remoting_host_manager_->Teardown( |
| NewRunnableFunction(&QuitMessageLoop, main_message_loop_)); |
|
Alpha Left Google
2011/02/17 17:23:10
nit: indent this by 4 spaces.
|
| #else |
| // Quit the main message loop. |