Chromium Code Reviews| Index: chrome/browser/io_thread.h |
| diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h |
| index 2daf2befde615742932a93a2ca2d2f0a521cf217..d173d1f8320759c364634a038b26964efb6adf8f 100644 |
| --- a/chrome/browser/io_thread.h |
| +++ b/chrome/browser/io_thread.h |
| @@ -69,6 +69,10 @@ namespace policy { |
| class PolicyService; |
| } // namespace policy |
| +namespace test { |
| +class IOThreadPeer; |
| +} // namespace test |
| + |
| // Contains state associated with, initialized and cleaned up on, and |
| // primarily used on, the IO thread. |
| // |
| @@ -87,7 +91,7 @@ class IOThread : public content::BrowserThreadDelegate { |
| set_ = true; |
| value_ = value; |
| } |
| - void CopyToIfSet(T* value) { |
| + void CopyToIfSet(T* value) const { |
| if (set_) { |
| *value = value_; |
| } |
| @@ -172,9 +176,9 @@ class IOThread : public content::BrowserThreadDelegate { |
| Optional<bool> enable_quic; |
| Optional<bool> enable_quic_pacing; |
| Optional<bool> enable_quic_time_based_loss_detection; |
| - Optional<bool> enable_quic_persist_server_info; |
| Optional<bool> enable_quic_port_selection; |
| Optional<size_t> quic_max_packet_length; |
| + net::QuicTagVector quic_connection_options; |
| Optional<std::string> quic_user_agent_id; |
| Optional<net::QuicVersionVector> quic_supported_versions; |
| Optional<net::HostPortPair> origin_to_force_quic_on; |
| @@ -227,6 +231,8 @@ class IOThread : public content::BrowserThreadDelegate { |
| // InitSystemRequestContext(). |
| friend class SystemURLRequestContextGetter; |
| + friend class test::IOThreadPeer; |
| + |
| // BrowserThreadDelegate implementation, runs on the IO thread. |
| // This handles initialization and destruction of state that must |
| // live on the IO thread. |
| @@ -234,6 +240,11 @@ class IOThread : public content::BrowserThreadDelegate { |
| virtual void InitAsync() OVERRIDE; |
| virtual void CleanUp() OVERRIDE; |
| + // Initializes |params| based on the settings in |globals|. |
| + static void InitializeNetworkSessionParamsFromGlobals( |
| + const Globals& globals, |
| + net::HttpNetworkSession::Params* params); |
| + |
| void InitializeNetworkOptions(const base::CommandLine& parsed_command_line); |
| // Enable SPDY with the given mode, which may contain the following: |
| @@ -277,40 +288,60 @@ class IOThread : public content::BrowserThreadDelegate { |
| // well as the QUIC field trial group. |
| void ConfigureQuic(const base::CommandLine& command_line); |
| + // Configures QUIC options in |globals| based on the flags in |command_line| |
| + // as well as the QUIC field trial group and parameters. |
| + static void ConfigureQuicGlobals( |
| + const base::CommandLine& command_line, |
| + base::StringPiece quic_trial_group, |
|
jar (doing other things)
2014/06/20 23:25:12
nit: should this be a const ref?
I think it is un
Ryan Hamilton
2014/06/21 02:45:23
As I understand it, it's actually faster to pass i
|
| + const std::map<std::string, std::string>& quic_trial_params, |
| + Globals* globals); |
| + |
| // Returns true if QUIC should be enabled, either as a result |
| // of a field trial or a command line flag. |
| - bool ShouldEnableQuic(const base::CommandLine& command_line, |
| - base::StringPiece quic_trial_group); |
| + static bool ShouldEnableQuic( |
| + const base::CommandLine& command_line, |
| + base::StringPiece quic_trial_group); |
| // Returns true if the selection of the ephemeral port in bind() should be |
| // performed by Chromium, and false if the OS should select the port. The OS |
| // option is used to prevent Windows from posting a security security warning |
| // dialog. |
| - bool ShouldEnableQuicPortSelection(const base::CommandLine& command_line); |
| + static bool ShouldEnableQuicPortSelection( |
| + const base::CommandLine& command_line); |
| // Returns true if QUIC packet pacing should be negotiated during the |
| // QUIC handshake. |
| - bool ShouldEnableQuicPacing(const base::CommandLine& command_line, |
| - base::StringPiece quic_trial_group); |
| + static bool ShouldEnableQuicPacing( |
| + const base::CommandLine& command_line, |
| + base::StringPiece quic_trial_group, |
| + const std::map<std::string, std::string>& quic_trial_params); |
| // Returns true if QUIC time-base loss detection should be negotiated during |
| // the QUIC handshake. |
| - bool ShouldEnableQuicTimeBasedLossDetection( |
| + static bool ShouldEnableQuicTimeBasedLossDetection( |
| const base::CommandLine& command_line, |
| - base::StringPiece quic_trial_group); |
| - |
| - // Returns true if Chromium should persist QUIC server config information to |
| - // disk cache. |
| - bool ShouldEnableQuicPersistServerInfo(const base::CommandLine& command_line); |
| + base::StringPiece quic_trial_group, |
| + const std::map<std::string, std::string>& quic_trial_params); |
| // Returns the maximum length for QUIC packets, based on any flags in |
| // |command_line| or the field trial. Returns 0 if there is an error |
| // parsing any of the options, or if the default value should be used. |
| - size_t GetQuicMaxPacketLength(const base::CommandLine& command_line, |
| - base::StringPiece quic_trial_group); |
| + static size_t GetQuicMaxPacketLength( |
| + const base::CommandLine& command_line, |
| + base::StringPiece quic_trial_group, |
| + const std::map<std::string, std::string>& quic_trial_params); |
| - // Returns the quic versions specified by any flags in |command_line|. |
| - net::QuicVersion GetQuicVersion(const base::CommandLine& command_line); |
| + // Returns the QUIC versions specified by any flags in |command_line| |
| + // or |quic_trial_params|. |
| + static net::QuicVersion GetQuicVersion( |
| + const base::CommandLine& command_line, |
| + const std::map<std::string, std::string>& quic_trial_params); |
|
jar (doing other things)
2014/06/20 23:25:12
nit: I think it would be helpful to decide a typed
Ryan Hamilton
2014/06/21 02:45:23
Done. (Yeah, I wish there were such a typedef in t
|
| + |
| + // Returns the QUIC connection options specified by any flags in |
| + // |command_line| or |quic_trial_params|. |
| + static net::QuicTagVector GetQuicConnectionOptions( |
| + const base::CommandLine& command_line, |
| + const std::map<std::string, std::string>& quic_trial_params); |
| // The NetLog is owned by the browser process, to allow logging from other |
| // threads during shutdown, but is used most frequently on the IOThread. |