network_switches.cc 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "components/network_session_configurator/common/network_switches.h"
  5. #include "base/command_line.h"
  6. namespace switches {
  7. // `kEnableHttp2GreaseSettings` does not include the word "enable" for
  8. // historical reasons.
  9. const char kEnableHttp2GreaseSettings[] = "http2-grease-settings";
  10. const char kDisableHttp2GreaseSettings[] = "disable-http2-grease-settings";
  11. #define NETWORK_SWITCH(name, value) const char name[] = value;
  12. #include "components/network_session_configurator/common/network_switch_list.h"
  13. #undef NETWORK_SWITCH
  14. } // namespace switches
  15. namespace network_session_configurator {
  16. void CopyNetworkSwitches(const base::CommandLine& src_command_line,
  17. base::CommandLine* dest_command_line) {
  18. static const char* const kSwitchNames[] = {
  19. switches::kEnableHttp2GreaseSettings,
  20. switches::kDisableHttp2GreaseSettings,
  21. #define NETWORK_SWITCH(name, value) switches::name,
  22. #include "components/network_session_configurator/common/network_switch_list.h"
  23. #undef NETWORK_SWITCH
  24. };
  25. dest_command_line->CopySwitchesFrom(src_command_line, kSwitchNames,
  26. std::size(kSwitchNames));
  27. }
  28. } // namespace network_session_configurator