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

Side by Side Diff: chrome/browser/io_thread.h

Issue 1862193002: Enable QUIC for proxies only when QUIC is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed sclittle comments Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_IO_THREAD_H_ 5 #ifndef CHROME_BROWSER_IO_THREAD_H_
6 #define CHROME_BROWSER_IO_THREAD_H_ 6 #define CHROME_BROWSER_IO_THREAD_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 bool is_quic_allowed_by_policy, 197 bool is_quic_allowed_by_policy,
198 net::HttpNetworkSession::Params* params); 198 net::HttpNetworkSession::Params* params);
199 199
200 // Configure |params| based on field trials, policy arguments, 200 // Configure |params| based on field trials, policy arguments,
201 // and command line. 201 // and command line.
202 static void ParseFieldTrialsAndCommandLine( 202 static void ParseFieldTrialsAndCommandLine(
203 bool is_spdy_allowed_by_policy, 203 bool is_spdy_allowed_by_policy,
204 bool is_quic_allowed_by_policy, 204 bool is_quic_allowed_by_policy,
205 net::HttpNetworkSession::Params* params); 205 net::HttpNetworkSession::Params* params);
206 206
207 // Returns true if QUIC should be enabled for data reduction proxy, either
208 // as a result of a field trial or a command line flag.
209 static bool ShouldEnableQuicForDataReductionProxy(
210 const base::CommandLine& command_line);
211
212 private: 207 private:
213 // Map from name to value for all parameters associate with a field trial. 208 // Map from name to value for all parameters associate with a field trial.
214 using VariationParameters = std::map<std::string, std::string>; 209 using VariationParameters = std::map<std::string, std::string>;
215 210
216 static void ParseFieldTrialsAndCommandLineInternal( 211 static void ParseFieldTrialsAndCommandLineInternal(
217 const base::CommandLine& command_line, 212 const base::CommandLine& command_line,
218 bool is_spdy_allowed_by_policy, 213 bool is_spdy_allowed_by_policy,
219 bool is_quic_allowed_by_policy, 214 bool is_quic_allowed_by_policy,
220 net::HttpNetworkSession::Params* params); 215 net::HttpNetworkSession::Params* params);
221 216
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 // open streams. 260 // open streams.
266 static bool ShouldDisableQuicWhenConnectionTimesOutWithOpenStreams( 261 static bool ShouldDisableQuicWhenConnectionTimesOutWithOpenStreams(
267 const VariationParameters& quic_trial_params); 262 const VariationParameters& quic_trial_params);
268 263
269 // Returns true if QUIC should be enabled, either as a result of a field 264 // Returns true if QUIC should be enabled, either as a result of a field
270 // trial or a command line flag. 265 // trial or a command line flag.
271 static bool ShouldEnableQuic(const base::CommandLine& command_line, 266 static bool ShouldEnableQuic(const base::CommandLine& command_line,
272 base::StringPiece quic_trial_group, 267 base::StringPiece quic_trial_group,
273 bool quic_allowed_by_policy); 268 bool quic_allowed_by_policy);
274 269
275 // Returns true if QUIC should be enabled for proxies, either as a result of
276 // a field trial or a command line flag.
277 static bool ShouldEnableQuicForProxies(
278 const base::CommandLine& command_line,
279 base::StringPiece quic_trial_group,
280 bool quic_allowed_by_policy);
281
282 // Returns true if the selection of the ephemeral port in bind() should be 270 // Returns true if the selection of the ephemeral port in bind() should be
283 // performed by Chromium, and false if the OS should select the port. The 271 // performed by Chromium, and false if the OS should select the port. The
284 // OS option is used to prevent Windows from posting a security warning 272 // OS option is used to prevent Windows from posting a security warning
285 // dialog. 273 // dialog.
286 static bool ShouldEnableQuicPortSelection( 274 static bool ShouldEnableQuicPortSelection(
287 const base::CommandLine& command_line); 275 const base::CommandLine& command_line);
288 276
289 // Returns true if QUIC should always require handshake confirmation during 277 // Returns true if QUIC should always require handshake confirmation during
290 // the QUIC handshake. 278 // the QUIC handshake.
291 static bool ShouldQuicAlwaysRequireHandshakeConfirmation( 279 static bool ShouldQuicAlwaysRequireHandshakeConfirmation(
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 410
423 // Clears the host cache. Intended to be used to prevent exposing recently 411 // Clears the host cache. Intended to be used to prevent exposing recently
424 // visited sites on about:net-internals/#dns and about:dns pages. Must be 412 // visited sites on about:net-internals/#dns and about:dns pages. Must be
425 // called on the IO thread. 413 // called on the IO thread.
426 void ClearHostCache(); 414 void ClearHostCache();
427 415
428 const net::HttpNetworkSession::Params& NetworkSessionParams() const; 416 const net::HttpNetworkSession::Params& NetworkSessionParams() const;
429 417
430 base::TimeTicks creation_time() const; 418 base::TimeTicks creation_time() const;
431 419
432 // Returns true if QUIC should be enabled for data reduction proxy, either as
433 // a result of a field trial or a command line flag.
434 static bool ShouldEnableQuicForDataReductionProxy();
435
436 // Returns the callback for updating data use prefs. 420 // Returns the callback for updating data use prefs.
437 const metrics::UpdateUsagePrefCallbackType& GetMetricsDataUseForwarder(); 421 const metrics::UpdateUsagePrefCallbackType& GetMetricsDataUseForwarder();
438 422
439 private: 423 private:
440 // Provide SystemURLRequestContextGetter with access to 424 // Provide SystemURLRequestContextGetter with access to
441 // InitSystemRequestContext(). 425 // InitSystemRequestContext().
442 friend class SystemURLRequestContextGetter; 426 friend class SystemURLRequestContextGetter;
443 427
444 friend class test::IOThreadPeer; 428 friend class test::IOThreadPeer;
445 429
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 // Callback for updating data use prefs which needs to be initialized on UI 556 // Callback for updating data use prefs which needs to be initialized on UI
573 // thread and passed to |ChromeNetworkDelegate|. 557 // thread and passed to |ChromeNetworkDelegate|.
574 metrics::UpdateUsagePrefCallbackType metrics_data_use_forwarder_; 558 metrics::UpdateUsagePrefCallbackType metrics_data_use_forwarder_;
575 559
576 base::WeakPtrFactory<IOThread> weak_factory_; 560 base::WeakPtrFactory<IOThread> weak_factory_;
577 561
578 DISALLOW_COPY_AND_ASSIGN(IOThread); 562 DISALLOW_COPY_AND_ASSIGN(IOThread);
579 }; 563 };
580 564
581 #endif // CHROME_BROWSER_IO_THREAD_H_ 565 #endif // CHROME_BROWSER_IO_THREAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698