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 "base/allocator/allocator_extension.h" | 7 #include "base/allocator/allocator_extension.h" |
8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/debugger.h" | 10 #include "base/debug/debugger.h" |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 if (process_type == kMainFunctions[i].name) | 326 if (process_type == kMainFunctions[i].name) |
327 return kMainFunctions[i].function(main_params); | 327 return kMainFunctions[i].function(main_params); |
328 } | 328 } |
329 | 329 |
330 if (delegate) | 330 if (delegate) |
331 return delegate->RunProcess(process_type, main_params); | 331 return delegate->RunProcess(process_type, main_params); |
332 | 332 |
333 NOTREACHED() << "Unknown zygote process type: " << process_type; | 333 NOTREACHED() << "Unknown zygote process type: " << process_type; |
334 return 1; | 334 return 1; |
335 } | 335 } |
336 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) | 336 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
337 | 337 |
338 // Run the FooMain() for a given process type. | 338 // Run the FooMain() for a given process type. |
339 // If |process_type| is empty, runs BrowserMain(). | 339 // If |process_type| is empty, runs BrowserMain(). |
340 // Returns the exit code for this process. | 340 // Returns the exit code for this process. |
341 int RunNamedProcessTypeMain( | 341 int RunNamedProcessTypeMain( |
342 const std::string& process_type, | 342 const std::string& process_type, |
343 const MainFunctionParams& main_function_params, | 343 const MainFunctionParams& main_function_params, |
344 ContentMainDelegate* delegate) { | 344 ContentMainDelegate* delegate) { |
345 static const MainFunction kMainFunctions[] = { | 345 static const MainFunction kMainFunctions[] = { |
346 { "", BrowserMain }, | 346 { "", BrowserMain }, |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 | 682 |
683 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 683 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
684 }; | 684 }; |
685 | 685 |
686 // static | 686 // static |
687 ContentMainRunner* ContentMainRunner::Create() { | 687 ContentMainRunner* ContentMainRunner::Create() { |
688 return new ContentMainRunnerImpl(); | 688 return new ContentMainRunnerImpl(); |
689 } | 689 } |
690 | 690 |
691 } // namespace content | 691 } // namespace content |
OLD | NEW |