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

Unified Diff: components/network_session_configurator/common/network_switches.cc

Issue 2914893002: Move some of IOThread's command line logic to network_session_configurator. (Closed)
Patch Set: Fix merge Created 3 years, 6 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
Index: components/network_session_configurator/common/network_switches.cc
diff --git a/components/network_session_configurator/common/network_switches.cc b/components/network_session_configurator/common/network_switches.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7178b17d819531151e70559013085f14d61794a9
--- /dev/null
+++ b/components/network_session_configurator/common/network_switches.cc
@@ -0,0 +1,31 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/network_session_configurator/common/network_switches.h"
+
+#include "base/command_line.h"
+
+namespace switches {
+
+#define NETWORK_SWITCH(name, value) const char name[] = value;
+#include "components/network_session_configurator/common/network_switch_list.h"
+#undef NETWORK_SWITCH
+
+} // namespace switches
+
+namespace network_session_configurator {
+
+void CopyNetworkSwitches(const base::CommandLine& src_command_line,
+ base::CommandLine* dest_command_line) {
+ static const char* const kSwitchNames[] = {
+#define NETWORK_SWITCH(name, value) switches::name,
+#include "components/network_session_configurator/common/network_switch_list.h"
+#undef NETWORK_SWITCH
+ };
+
+ dest_command_line->CopySwitchesFrom(src_command_line, kSwitchNames,
+ arraysize(kSwitchNames));
+}
+
+} // namespace network_session_configurator

Powered by Google App Engine
This is Rietveld 408576698