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/public/app/content_main_runner.h" | 5 #include "content/public/app/content_main_runner.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include "base/allocator/allocator_extension.h" | 9 #include "base/allocator/allocator_extension.h" |
10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 { switches::kRendererProcess, RendererMain }, | 275 { switches::kRendererProcess, RendererMain }, |
276 #if defined(ENABLE_PLUGINS) | 276 #if defined(ENABLE_PLUGINS) |
277 { switches::kPpapiPluginProcess, PpapiPluginMain }, | 277 { switches::kPpapiPluginProcess, PpapiPluginMain }, |
278 #endif | 278 #endif |
279 { switches::kUtilityProcess, UtilityMain }, | 279 { switches::kUtilityProcess, UtilityMain }, |
280 }; | 280 }; |
281 | 281 |
282 ScopedVector<ZygoteForkDelegate> zygote_fork_delegates; | 282 ScopedVector<ZygoteForkDelegate> zygote_fork_delegates; |
283 if (delegate) { | 283 if (delegate) { |
284 delegate->ZygoteStarting(&zygote_fork_delegates); | 284 delegate->ZygoteStarting(&zygote_fork_delegates); |
285 media::InitializeMediaLibrary(); | 285 // Each Renderer we spawn will re-attempt initialization of the media |
| 286 // libraries, at which point failure will be detected and handled, so |
| 287 // we do not need to cope with initialization failures here. |
| 288 base::FilePath media_path; |
| 289 if (PathService::Get(DIR_MEDIA_LIBS, &media_path)) |
| 290 media::InitializeMediaLibrary(media_path); |
286 } | 291 } |
287 | 292 |
288 // This function call can return multiple times, once per fork(). | 293 // This function call can return multiple times, once per fork(). |
289 if (!ZygoteMain(main_function_params, zygote_fork_delegates.Pass())) | 294 if (!ZygoteMain(main_function_params, zygote_fork_delegates.Pass())) |
290 return 1; | 295 return 1; |
291 | 296 |
292 if (delegate) delegate->ZygoteForked(); | 297 if (delegate) delegate->ZygoteForked(); |
293 | 298 |
294 // Zygote::HandleForkRequest may have reallocated the command | 299 // Zygote::HandleForkRequest may have reallocated the command |
295 // line so update it here with the new version. | 300 // line so update it here with the new version. |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 | 860 |
856 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 861 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
857 }; | 862 }; |
858 | 863 |
859 // static | 864 // static |
860 ContentMainRunner* ContentMainRunner::Create() { | 865 ContentMainRunner* ContentMainRunner::Create() { |
861 return new ContentMainRunnerImpl(); | 866 return new ContentMainRunnerImpl(); |
862 } | 867 } |
863 | 868 |
864 } // namespace content | 869 } // namespace content |
OLD | NEW |