| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/utility/utility_process_control_impl.h" | 5 #include "content/utility/utility_process_control_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "content/public/common/content_client.h" | 8 #include "content/public/common/content_client.h" |
| 9 #include "content/public/utility/content_utility_client.h" | 9 #include "content/public/utility/content_utility_client.h" |
| 10 #include "content/public/utility/utility_thread.h" | 10 #include "content/public/utility/utility_thread.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 ContentUtilityClient::StaticMojoApplicationMap apps; | 37 ContentUtilityClient::StaticMojoApplicationMap apps; |
| 38 GetContentClient()->utility()->RegisterMojoApplications(&apps); | 38 GetContentClient()->utility()->RegisterMojoApplications(&apps); |
| 39 | 39 |
| 40 for (const auto& entry : apps) { | 40 for (const auto& entry : apps) { |
| 41 map_ref[entry.first] = new mojo::shell::StaticApplicationLoader( | 41 map_ref[entry.first] = new mojo::shell::StaticApplicationLoader( |
| 42 entry.second, base::Bind(&QuitProcess)); | 42 entry.second, base::Bind(&QuitProcess)); |
| 43 } | 43 } |
| 44 | 44 |
| 45 #if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS) | 45 #if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS) |
| 46 map_ref[media::MojoMediaApplication::AppUrl()] = | 46 map_ref[GURL("mojo:media")] = new mojo::shell::StaticApplicationLoader( |
| 47 new mojo::shell::StaticApplicationLoader( | 47 base::Bind(&media::MojoMediaApplication::CreateApp), |
| 48 base::Bind(&media::MojoMediaApplication::CreateApp), | 48 base::Bind(&QuitProcess)); |
| 49 base::Bind(&QuitProcess)); | |
| 50 #endif | 49 #endif |
| 51 } | 50 } |
| 52 | 51 |
| 53 void UtilityProcessControlImpl::OnLoadFailed() { | 52 void UtilityProcessControlImpl::OnLoadFailed() { |
| 54 UtilityThreadImpl* utility_thread = | 53 UtilityThreadImpl* utility_thread = |
| 55 static_cast<UtilityThreadImpl*>(UtilityThread::Get()); | 54 static_cast<UtilityThreadImpl*>(UtilityThread::Get()); |
| 56 utility_thread->Shutdown(); | 55 utility_thread->Shutdown(); |
| 57 utility_thread->ReleaseProcessIfNeeded(); | 56 utility_thread->ReleaseProcessIfNeeded(); |
| 58 } | 57 } |
| 59 | 58 |
| 60 } // namespace content | 59 } // namespace content |
| OLD | NEW |