Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(493)

Side by Side Diff: content/app/content_main_runner.cc

Issue 2647273002: Remove ScopedVector from content::ZygoteMain() (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « components/nacl/zygote/nacl_fork_delegate_linux.cc ('k') | content/public/app/content_main_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698