Chromium Code Reviews| Index: chrome/browser/io_thread.cc |
| diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc |
| index d42723ed6d9935199ba21a782ac4f1a7f6bb9f84..177352e4ec4b68229e67af72f9493f46203288d3 100644 |
| --- a/chrome/browser/io_thread.cc |
| +++ b/chrome/browser/io_thread.cc |
| @@ -136,6 +136,9 @@ const char kSpdyFieldTrialHoldbackControlGroupName[] = "Control"; |
| const char kSpdyFieldTrialSpdy4GroupName[] = "Spdy4Enabled"; |
| const char kSpdyFieldTrialSpdy4ControlGroupName[] = "Spdy4Control"; |
| +// Field trial for Cache-Control: stale-while-revalidate directive. |
| +const char kStaleWhileRevalidateFieldTrialName[] = "StaleWhileRevalidate"; |
| + |
| #if defined(OS_MACOSX) && !defined(OS_IOS) |
| void ObserveKeychainEvents() { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| @@ -425,6 +428,7 @@ IOThread::Globals::Globals() |
| : system_request_context_leak_checker(this), |
| enable_ssl_connect_job_waiting(false), |
| ignore_certificate_errors(false), |
| + use_stale_while_revalidate(false), |
| testing_fixed_http_port(0), |
| testing_fixed_https_port(0), |
| enable_user_alternate_protocol_ports(false) { |
| @@ -656,6 +660,11 @@ void IOThread::InitAsync() { |
| globals_->enable_ssl_connect_job_waiting = true; |
| if (command_line.HasSwitch(switches::kIgnoreCertificateErrors)) |
| globals_->ignore_certificate_errors = true; |
| + if (command_line.HasSwitch(switches::kEnableStaleWhileRevalidate)) |
|
Alexei Svitkine (slow)
2014/10/09 21:33:39
I didn't review this part earlier, but now that I
Adam Rice
2014/10/20 09:31:24
Done in https://crrev.com/665023002/
|
| + globals_->use_stale_while_revalidate = true; |
| + if (base::FieldTrialList::FindFullName(kStaleWhileRevalidateFieldTrialName) == |
| + "Enabled") |
| + globals_->use_stale_while_revalidate = true; |
|
mmenke
2014/10/09 14:29:58
nit: Use braces when the conditional of an if sta
Adam Rice
2014/10/20 09:31:24
Indirectly fixed by change requested by asvitkine.
|
| if (command_line.HasSwitch(switches::kTestingFixedHttpPort)) { |
| globals_->testing_fixed_http_port = |
| GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpPort); |
| @@ -985,6 +994,7 @@ void IOThread::InitializeNetworkSessionParamsFromGlobals( |
| params->enable_ssl_connect_job_waiting = |
| globals.enable_ssl_connect_job_waiting; |
| params->ignore_certificate_errors = globals.ignore_certificate_errors; |
| + params->use_stale_while_revalidate = globals.use_stale_while_revalidate; |
| params->testing_fixed_http_port = globals.testing_fixed_http_port; |
| params->testing_fixed_https_port = globals.testing_fixed_https_port; |
| globals.enable_tcp_fast_open_for_ssl.CopyToIfSet( |