| 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 std::string process_type = | 326 std::string process_type = |
| 327 command_line.GetSwitchValueASCII(switches::kProcessType); | 327 command_line.GetSwitchValueASCII(switches::kProcessType); |
| 328 ContentClientInitializer::Set(process_type, delegate); | 328 ContentClientInitializer::Set(process_type, delegate); |
| 329 | 329 |
| 330 // The StatsTable must be initialized in each process; we already | 330 // The StatsTable must be initialized in each process; we already |
| 331 // initialized for the browser process, now we need to initialize | 331 // initialized for the browser process, now we need to initialize |
| 332 // within the new processes as well. | 332 // within the new processes as well. |
| 333 InitializeStatsTable(command_line); | 333 InitializeStatsTable(command_line); |
| 334 | 334 |
| 335 MainFunctionParams main_params(command_line); | 335 MainFunctionParams main_params(command_line); |
| 336 main_params.zygote_child = true; |
| 336 | 337 |
| 337 for (size_t i = 0; i < arraysize(kMainFunctions); ++i) { | 338 for (size_t i = 0; i < arraysize(kMainFunctions); ++i) { |
| 338 if (process_type == kMainFunctions[i].name) | 339 if (process_type == kMainFunctions[i].name) |
| 339 return kMainFunctions[i].function(main_params); | 340 return kMainFunctions[i].function(main_params); |
| 340 } | 341 } |
| 341 | 342 |
| 342 if (delegate) | 343 if (delegate) |
| 343 return delegate->RunProcess(process_type, main_params); | 344 return delegate->RunProcess(process_type, main_params); |
| 344 | 345 |
| 345 NOTREACHED() << "Unknown zygote process type: " << process_type; | 346 NOTREACHED() << "Unknown zygote process type: " << process_type; |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 | 821 |
| 821 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 822 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
| 822 }; | 823 }; |
| 823 | 824 |
| 824 // static | 825 // static |
| 825 ContentMainRunner* ContentMainRunner::Create() { | 826 ContentMainRunner* ContentMainRunner::Create() { |
| 826 return new ContentMainRunnerImpl(); | 827 return new ContentMainRunnerImpl(); |
| 827 } | 828 } |
| 828 | 829 |
| 829 } // namespace content | 830 } // namespace content |
| OLD | NEW |