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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 #include <utility> | 13 #include <utility> |
| 14 #include <vector> |
14 | 15 |
15 #include "base/allocator/allocator_check.h" | 16 #include "base/allocator/allocator_check.h" |
16 #include "base/allocator/allocator_extension.h" | 17 #include "base/allocator/allocator_extension.h" |
17 #include "base/at_exit.h" | 18 #include "base/at_exit.h" |
18 #include "base/base_switches.h" | 19 #include "base/base_switches.h" |
19 #include "base/command_line.h" | 20 #include "base/command_line.h" |
20 #include "base/debug/debugger.h" | 21 #include "base/debug/debugger.h" |
21 #include "base/debug/stack_trace.h" | 22 #include "base/debug/stack_trace.h" |
22 #include "base/feature_list.h" | 23 #include "base/feature_list.h" |
23 #include "base/files/file_path.h" | 24 #include "base/files/file_path.h" |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 int RunZygote(const MainFunctionParams& main_function_params, | 308 int RunZygote(const MainFunctionParams& main_function_params, |
308 ContentMainDelegate* delegate) { | 309 ContentMainDelegate* delegate) { |
309 static const MainFunction kMainFunctions[] = { | 310 static const MainFunction kMainFunctions[] = { |
310 { switches::kRendererProcess, RendererMain }, | 311 { switches::kRendererProcess, RendererMain }, |
311 #if BUILDFLAG(ENABLE_PLUGINS) | 312 #if BUILDFLAG(ENABLE_PLUGINS) |
312 { switches::kPpapiPluginProcess, PpapiPluginMain }, | 313 { switches::kPpapiPluginProcess, PpapiPluginMain }, |
313 #endif | 314 #endif |
314 { switches::kUtilityProcess, UtilityMain }, | 315 { switches::kUtilityProcess, UtilityMain }, |
315 }; | 316 }; |
316 | 317 |
317 ScopedVector<ZygoteForkDelegate> zygote_fork_delegates; | 318 std::vector<std::unique_ptr<ZygoteForkDelegate>> zygote_fork_delegates; |
318 if (delegate) { | 319 if (delegate) { |
319 delegate->ZygoteStarting(&zygote_fork_delegates); | 320 delegate->ZygoteStarting(&zygote_fork_delegates); |
320 media::InitializeMediaLibrary(); | 321 media::InitializeMediaLibrary(); |
321 } | 322 } |
322 | 323 |
323 // This function call can return multiple times, once per fork(). | 324 // This function call can return multiple times, once per fork(). |
324 if (!ZygoteMain(main_function_params, std::move(zygote_fork_delegates))) | 325 if (!ZygoteMain(main_function_params, std::move(zygote_fork_delegates))) |
325 return 1; | 326 return 1; |
326 | 327 |
327 if (delegate) delegate->ZygoteForked(); | 328 if (delegate) delegate->ZygoteForked(); |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 | 857 |
857 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 858 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
858 }; | 859 }; |
859 | 860 |
860 // static | 861 // static |
861 ContentMainRunner* ContentMainRunner::Create() { | 862 ContentMainRunner* ContentMainRunner::Create() { |
862 return new ContentMainRunnerImpl(); | 863 return new ContentMainRunnerImpl(); |
863 } | 864 } |
864 | 865 |
865 } // namespace content | 866 } // namespace content |
OLD | NEW |