| 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 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 extern int GpuMain(const content::MainFunctionParams&); | 113 extern int GpuMain(const content::MainFunctionParams&); |
| 114 #if defined(ENABLE_PLUGINS) | 114 #if defined(ENABLE_PLUGINS) |
| 115 #if !defined(OS_LINUX) | 115 #if !defined(OS_LINUX) |
| 116 extern int PluginMain(const content::MainFunctionParams&); | 116 extern int PluginMain(const content::MainFunctionParams&); |
| 117 #endif | 117 #endif |
| 118 extern int PpapiPluginMain(const MainFunctionParams&); | 118 extern int PpapiPluginMain(const MainFunctionParams&); |
| 119 extern int PpapiBrokerMain(const MainFunctionParams&); | 119 extern int PpapiBrokerMain(const MainFunctionParams&); |
| 120 #endif | 120 #endif |
| 121 extern int RendererMain(const content::MainFunctionParams&); | 121 extern int RendererMain(const content::MainFunctionParams&); |
| 122 extern int UtilityMain(const MainFunctionParams&); | 122 extern int UtilityMain(const MainFunctionParams&); |
| 123 #if defined(OS_ANDROID) | |
| 124 extern int DownloadMain(const MainFunctionParams&); | |
| 125 #endif | |
| 126 } // namespace content | 123 } // namespace content |
| 127 | 124 |
| 128 namespace content { | 125 namespace content { |
| 129 | 126 |
| 130 namespace { | 127 namespace { |
| 131 | 128 |
| 132 // This sets up two singletons responsible for managing field trials. The | 129 // This sets up two singletons responsible for managing field trials. The |
| 133 // |field_trial_list| singleton lives on the stack and must outlive the Run() | 130 // |field_trial_list| singleton lives on the stack and must outlive the Run() |
| 134 // method of the process. | 131 // method of the process. |
| 135 void InitializeFieldTrialAndFeatureList( | 132 void InitializeFieldTrialAndFeatureList( |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 { "", BrowserMain }, | 380 { "", BrowserMain }, |
| 384 #endif | 381 #endif |
| 385 #if !defined(CHROME_MULTIPLE_DLL_BROWSER) | 382 #if !defined(CHROME_MULTIPLE_DLL_BROWSER) |
| 386 #if defined(ENABLE_PLUGINS) | 383 #if defined(ENABLE_PLUGINS) |
| 387 { switches::kPpapiPluginProcess, PpapiPluginMain }, | 384 { switches::kPpapiPluginProcess, PpapiPluginMain }, |
| 388 { switches::kPpapiBrokerProcess, PpapiBrokerMain }, | 385 { switches::kPpapiBrokerProcess, PpapiBrokerMain }, |
| 389 #endif // ENABLE_PLUGINS | 386 #endif // ENABLE_PLUGINS |
| 390 { switches::kUtilityProcess, UtilityMain }, | 387 { switches::kUtilityProcess, UtilityMain }, |
| 391 { switches::kRendererProcess, RendererMain }, | 388 { switches::kRendererProcess, RendererMain }, |
| 392 { switches::kGpuProcess, GpuMain }, | 389 { switches::kGpuProcess, GpuMain }, |
| 393 #if defined(OS_ANDROID) | |
| 394 { switches::kDownloadProcess, DownloadMain}, | |
| 395 #endif | |
| 396 #endif // !CHROME_MULTIPLE_DLL_BROWSER | 390 #endif // !CHROME_MULTIPLE_DLL_BROWSER |
| 397 }; | 391 }; |
| 398 | 392 |
| 399 RegisterMainThreadFactories(); | 393 RegisterMainThreadFactories(); |
| 400 | 394 |
| 401 for (size_t i = 0; i < arraysize(kMainFunctions); ++i) { | 395 for (size_t i = 0; i < arraysize(kMainFunctions); ++i) { |
| 402 if (process_type == kMainFunctions[i].name) { | 396 if (process_type == kMainFunctions[i].name) { |
| 403 if (delegate) { | 397 if (delegate) { |
| 404 int exit_code = delegate->RunProcess(process_type, | 398 int exit_code = delegate->RunProcess(process_type, |
| 405 main_function_params); | 399 main_function_params); |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 | 835 |
| 842 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 836 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
| 843 }; | 837 }; |
| 844 | 838 |
| 845 // static | 839 // static |
| 846 ContentMainRunner* ContentMainRunner::Create() { | 840 ContentMainRunner* ContentMainRunner::Create() { |
| 847 return new ContentMainRunnerImpl(); | 841 return new ContentMainRunnerImpl(); |
| 848 } | 842 } |
| 849 | 843 |
| 850 } // namespace content | 844 } // namespace content |
| OLD | NEW |