| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 // Initialize statistical testing infrastructure. We set the entropy | 139 // Initialize statistical testing infrastructure. We set the entropy |
| 140 // provider to nullptr to disallow non-browser processes from creating | 140 // provider to nullptr to disallow non-browser processes from creating |
| 141 // their own one-time randomized trials; they should be created in the | 141 // their own one-time randomized trials; they should be created in the |
| 142 // browser process. | 142 // browser process. |
| 143 field_trial_list->reset(new base::FieldTrialList(nullptr)); | 143 field_trial_list->reset(new base::FieldTrialList(nullptr)); |
| 144 | 144 |
| 145 // Ensure any field trials in browser are reflected into the child | 145 // Ensure any field trials in browser are reflected into the child |
| 146 // process. | 146 // process. |
| 147 base::FieldTrialList::CreateTrialsFromCommandLine( | 147 base::FieldTrialList::CreateTrialsFromCommandLine( |
| 148 command_line, switches::kFieldTrialHandle); | 148 command_line, switches::kFieldTrialHandle, kFieldTrialHandle); |
| 149 | 149 |
| 150 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); | 150 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); |
| 151 feature_list->InitializeFromCommandLine( | 151 feature_list->InitializeFromCommandLine( |
| 152 command_line.GetSwitchValueASCII(switches::kEnableFeatures), | 152 command_line.GetSwitchValueASCII(switches::kEnableFeatures), |
| 153 command_line.GetSwitchValueASCII(switches::kDisableFeatures)); | 153 command_line.GetSwitchValueASCII(switches::kDisableFeatures)); |
| 154 base::FeatureList::SetInstance(std::move(feature_list)); | 154 base::FeatureList::SetInstance(std::move(feature_list)); |
| 155 } | 155 } |
| 156 | 156 |
| 157 } // namespace | 157 } // namespace |
| 158 | 158 |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 // - The ipc_fd is passed through the Java service. | 471 // - The ipc_fd is passed through the Java service. |
| 472 // Thus, these are all disabled. | 472 // Thus, these are all disabled. |
| 473 #if !defined(OS_ANDROID) | 473 #if !defined(OS_ANDROID) |
| 474 // Set C library locale to make sure CommandLine can parse argument values | 474 // Set C library locale to make sure CommandLine can parse argument values |
| 475 // in correct encoding. | 475 // in correct encoding. |
| 476 setlocale(LC_ALL, ""); | 476 setlocale(LC_ALL, ""); |
| 477 | 477 |
| 478 SetupSignalHandlers(); | 478 SetupSignalHandlers(); |
| 479 g_fds->Set(kMojoIPCChannel, | 479 g_fds->Set(kMojoIPCChannel, |
| 480 kMojoIPCChannel + base::GlobalDescriptors::kBaseDescriptor); | 480 kMojoIPCChannel + base::GlobalDescriptors::kBaseDescriptor); |
| 481 |
| 482 g_fds->Set(kFieldTrialHandle, |
| 483 kFieldTrialHandle + base::GlobalDescriptors::kBaseDescriptor); |
| 481 #endif // !OS_ANDROID | 484 #endif // !OS_ANDROID |
| 482 | 485 |
| 483 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 486 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
| 484 g_fds->Set(kCrashDumpSignal, | 487 g_fds->Set(kCrashDumpSignal, |
| 485 kCrashDumpSignal + base::GlobalDescriptors::kBaseDescriptor); | 488 kCrashDumpSignal + base::GlobalDescriptors::kBaseDescriptor); |
| 486 #endif // OS_LINUX || OS_OPENBSD | 489 #endif // OS_LINUX || OS_OPENBSD |
| 487 | 490 |
| 488 | 491 |
| 489 #endif // !OS_WIN | 492 #endif // !OS_WIN |
| 490 | 493 |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 | 834 |
| 832 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 835 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
| 833 }; | 836 }; |
| 834 | 837 |
| 835 // static | 838 // static |
| 836 ContentMainRunner* ContentMainRunner::Create() { | 839 ContentMainRunner* ContentMainRunner::Create() { |
| 837 return new ContentMainRunnerImpl(); | 840 return new ContentMainRunnerImpl(); |
| 838 } | 841 } |
| 839 | 842 |
| 840 } // namespace content | 843 } // namespace content |
| OLD | NEW |