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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 extern int GpuMain(const content::MainFunctionParams&); | 114 extern int GpuMain(const content::MainFunctionParams&); |
115 #if defined(ENABLE_PLUGINS) | 115 #if defined(ENABLE_PLUGINS) |
116 #if !defined(OS_LINUX) | 116 #if !defined(OS_LINUX) |
117 extern int PluginMain(const content::MainFunctionParams&); | 117 extern int PluginMain(const content::MainFunctionParams&); |
118 #endif | 118 #endif |
119 extern int PpapiPluginMain(const MainFunctionParams&); | 119 extern int PpapiPluginMain(const MainFunctionParams&); |
120 extern int PpapiBrokerMain(const MainFunctionParams&); | 120 extern int PpapiBrokerMain(const MainFunctionParams&); |
121 #endif | 121 #endif |
122 extern int RendererMain(const content::MainFunctionParams&); | 122 extern int RendererMain(const content::MainFunctionParams&); |
123 extern int UtilityMain(const MainFunctionParams&); | 123 extern int UtilityMain(const MainFunctionParams&); |
124 extern int WorkerMain(const MainFunctionParams&); | |
125 } // namespace content | 124 } // namespace content |
126 | 125 |
127 namespace content { | 126 namespace content { |
128 | 127 |
129 base::LazyInstance<ContentBrowserClient> | 128 base::LazyInstance<ContentBrowserClient> |
130 g_empty_content_browser_client = LAZY_INSTANCE_INITIALIZER; | 129 g_empty_content_browser_client = LAZY_INSTANCE_INITIALIZER; |
131 #if !defined(OS_IOS) && !defined(CHROME_MULTIPLE_DLL_BROWSER) | 130 #if !defined(OS_IOS) && !defined(CHROME_MULTIPLE_DLL_BROWSER) |
132 base::LazyInstance<ContentPluginClient> | 131 base::LazyInstance<ContentPluginClient> |
133 g_empty_content_plugin_client = LAZY_INSTANCE_INITIALIZER; | 132 g_empty_content_plugin_client = LAZY_INSTANCE_INITIALIZER; |
134 base::LazyInstance<ContentRendererClient> | 133 base::LazyInstance<ContentRendererClient> |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 288 |
290 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) | 289 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
291 // On platforms that use the zygote, we have a special subset of | 290 // On platforms that use the zygote, we have a special subset of |
292 // subprocesses that are launched via the zygote. This function | 291 // subprocesses that are launched via the zygote. This function |
293 // fills in some process-launching bits around ZygoteMain(). | 292 // fills in some process-launching bits around ZygoteMain(). |
294 // Returns the exit code of the subprocess. | 293 // Returns the exit code of the subprocess. |
295 int RunZygote(const MainFunctionParams& main_function_params, | 294 int RunZygote(const MainFunctionParams& main_function_params, |
296 ContentMainDelegate* delegate) { | 295 ContentMainDelegate* delegate) { |
297 static const MainFunction kMainFunctions[] = { | 296 static const MainFunction kMainFunctions[] = { |
298 { switches::kRendererProcess, RendererMain }, | 297 { switches::kRendererProcess, RendererMain }, |
299 { switches::kWorkerProcess, WorkerMain }, | |
300 #if defined(ENABLE_PLUGINS) | 298 #if defined(ENABLE_PLUGINS) |
301 { switches::kPpapiPluginProcess, PpapiPluginMain }, | 299 { switches::kPpapiPluginProcess, PpapiPluginMain }, |
302 #endif | 300 #endif |
303 { switches::kUtilityProcess, UtilityMain }, | 301 { switches::kUtilityProcess, UtilityMain }, |
304 }; | 302 }; |
305 | 303 |
306 ScopedVector<ZygoteForkDelegate> zygote_fork_delegates; | 304 ScopedVector<ZygoteForkDelegate> zygote_fork_delegates; |
307 if (delegate) { | 305 if (delegate) { |
308 delegate->ZygoteStarting(&zygote_fork_delegates); | 306 delegate->ZygoteStarting(&zygote_fork_delegates); |
309 // Each Renderer we spawn will re-attempt initialization of the media | 307 // Each Renderer we spawn will re-attempt initialization of the media |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 ContentMainDelegate* delegate) { | 377 ContentMainDelegate* delegate) { |
380 static const MainFunction kMainFunctions[] = { | 378 static const MainFunction kMainFunctions[] = { |
381 #if !defined(CHROME_MULTIPLE_DLL_CHILD) | 379 #if !defined(CHROME_MULTIPLE_DLL_CHILD) |
382 { "", BrowserMain }, | 380 { "", BrowserMain }, |
383 #endif | 381 #endif |
384 #if !defined(CHROME_MULTIPLE_DLL_BROWSER) | 382 #if !defined(CHROME_MULTIPLE_DLL_BROWSER) |
385 #if defined(ENABLE_PLUGINS) | 383 #if defined(ENABLE_PLUGINS) |
386 #if !defined(OS_LINUX) | 384 #if !defined(OS_LINUX) |
387 { switches::kPluginProcess, PluginMain }, | 385 { switches::kPluginProcess, PluginMain }, |
388 #endif | 386 #endif |
389 { switches::kWorkerProcess, WorkerMain }, | |
390 { switches::kPpapiPluginProcess, PpapiPluginMain }, | 387 { switches::kPpapiPluginProcess, PpapiPluginMain }, |
391 { switches::kPpapiBrokerProcess, PpapiBrokerMain }, | 388 { switches::kPpapiBrokerProcess, PpapiBrokerMain }, |
392 #endif // ENABLE_PLUGINS | 389 #endif // ENABLE_PLUGINS |
393 { switches::kUtilityProcess, UtilityMain }, | 390 { switches::kUtilityProcess, UtilityMain }, |
394 { switches::kRendererProcess, RendererMain }, | 391 { switches::kRendererProcess, RendererMain }, |
395 { switches::kGpuProcess, GpuMain }, | 392 { switches::kGpuProcess, GpuMain }, |
396 #endif // !CHROME_MULTIPLE_DLL_BROWSER | 393 #endif // !CHROME_MULTIPLE_DLL_BROWSER |
397 }; | 394 }; |
398 | 395 |
399 RegisterMainThreadFactories(); | 396 RegisterMainThreadFactories(); |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 | 818 |
822 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 819 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
823 }; | 820 }; |
824 | 821 |
825 // static | 822 // static |
826 ContentMainRunner* ContentMainRunner::Create() { | 823 ContentMainRunner* ContentMainRunner::Create() { |
827 return new ContentMainRunnerImpl(); | 824 return new ContentMainRunnerImpl(); |
828 } | 825 } |
829 | 826 |
830 } // namespace content | 827 } // namespace content |
OLD | NEW |