Chromium Code Reviews| Index: content/shell/browser/shell_browser_main_parts.cc |
| diff --git a/content/shell/browser/shell_browser_main_parts.cc b/content/shell/browser/shell_browser_main_parts.cc |
| index 9b17cd58040a09ad74ba1528ea318e995e140ca1..5b5d7408cb9a99ff0e8b19286e6545b314c7d2f2 100644 |
| --- a/content/shell/browser/shell_browser_main_parts.cc |
| +++ b/content/shell/browser/shell_browser_main_parts.cc |
| @@ -7,6 +7,7 @@ |
| #include "base/base_switches.h" |
| #include "base/bind.h" |
| #include "base/command_line.h" |
| +#include "base/feature_list.h" |
| #include "base/files/file_path.h" |
| #include "base/files/file_util.h" |
| #include "base/message_loop/message_loop.h" |
| @@ -133,6 +134,23 @@ void ShellBrowserMainParts::PreEarlyInitialization() { |
| #endif |
| } |
| +int ShellBrowserMainParts::PreCreateThreads() { |
| + // The only case GetInstance() returns null should be when you are running a |
| + // C++ test, in which case currently we do not support command line features. |
| + // This allows Test::SetUp() to enable/disable features as necessary. See |
| + // crbug.com/596021 for more details. |
| + if (!base::FeatureList::GetInstance()) { |
| + const base::CommandLine* command_line = |
| + base::CommandLine::ForCurrentProcess(); |
| + scoped_ptr<base::FeatureList> feature_list(new base::FeatureList); |
| + feature_list->InitializeFromCommandLine( |
| + command_line->GetSwitchValueASCII(switches::kEnableFeatures), |
| + command_line->GetSwitchValueASCII(switches::kDisableFeatures)); |
| + base::FeatureList::SetInstance(std::move(feature_list)); |
|
Alexei Svitkine (slow)
2016/03/24 17:16:37
Instead of requiring every BrowserMainParts implem
Changwan Ryu
2016/03/28 07:09:27
Makes perfect sense that this should be done insid
Alexei Svitkine (slow)
2016/03/29 15:08:03
I did not mean that the two params should override
|
| + } |
| + return 0; |
| +} |
| + |
| void ShellBrowserMainParts::InitializeBrowserContexts() { |
| set_browser_context(new ShellBrowserContext(false, net_log_.get())); |
| set_off_the_record_browser_context( |