| 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 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 } | 657 } |
| 658 | 658 |
| 659 int Run() override { | 659 int Run() override { |
| 660 DCHECK(is_initialized_); | 660 DCHECK(is_initialized_); |
| 661 DCHECK(!is_shutdown_); | 661 DCHECK(!is_shutdown_); |
| 662 const base::CommandLine& command_line = | 662 const base::CommandLine& command_line = |
| 663 *base::CommandLine::ForCurrentProcess(); | 663 *base::CommandLine::ForCurrentProcess(); |
| 664 std::string process_type = | 664 std::string process_type = |
| 665 command_line.GetSwitchValueASCII(switches::kProcessType); | 665 command_line.GetSwitchValueASCII(switches::kProcessType); |
| 666 | 666 |
| 667 // --enable-network-service requires both --enable-browser-side-navigation | |
| 668 // (PlzNavigate) and the LoadingWithMojo feature. | |
| 669 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 670 switches::kEnableNetworkService)) { | |
| 671 base::CommandLine::ForCurrentProcess()->AppendSwitch( | |
| 672 switches::kEnableBrowserSideNavigation); | |
| 673 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | |
| 674 switches::kEnableFeatures, features::kLoadingWithMojo.name); | |
| 675 } | |
| 676 | |
| 677 // Run this logic on all child processes. Zygotes will run this at a later | 667 // Run this logic on all child processes. Zygotes will run this at a later |
| 678 // point in time when the command line has been updated. | 668 // point in time when the command line has been updated. |
| 679 std::unique_ptr<base::FieldTrialList> field_trial_list; | 669 std::unique_ptr<base::FieldTrialList> field_trial_list; |
| 680 if (!process_type.empty() && process_type != switches::kZygoteProcess) | 670 if (!process_type.empty() && process_type != switches::kZygoteProcess) |
| 681 InitializeFieldTrialAndFeatureList(&field_trial_list); | 671 InitializeFieldTrialAndFeatureList(&field_trial_list); |
| 682 | 672 |
| 683 base::HistogramBase::EnableActivityReportHistogram(process_type); | 673 base::HistogramBase::EnableActivityReportHistogram(process_type); |
| 684 | 674 |
| 685 MainFunctionParams main_params(command_line); | 675 MainFunctionParams main_params(command_line); |
| 686 main_params.ui_task = ui_task_; | 676 main_params.ui_task = ui_task_; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 | 742 |
| 753 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 743 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
| 754 }; | 744 }; |
| 755 | 745 |
| 756 // static | 746 // static |
| 757 ContentMainRunner* ContentMainRunner::Create() { | 747 ContentMainRunner* ContentMainRunner::Create() { |
| 758 return new ContentMainRunnerImpl(); | 748 return new ContentMainRunnerImpl(); |
| 759 } | 749 } |
| 760 | 750 |
| 761 } // namespace content | 751 } // namespace content |
| OLD | NEW |