Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(574)

Unified Diff: content/shell/browser/shell_browser_main_parts.cc

Issue 1812883003: Enable features API for content shell and webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: do not override dummy instance Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/shell/browser/shell_browser_main_parts.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « content/shell/browser/shell_browser_main_parts.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698