OLD | NEW |
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 #include "chrome/browser/net/double_get_experiment_interceptor.h" | 5 #include "chrome/browser/net/double_get_experiment_interceptor.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 133 |
134 // Cacheable GET requests are recorded in the metrics, but not repeated. | 134 // Cacheable GET requests are recorded in the metrics, but not repeated. |
135 bool is_cacheable = RequestIsCacheable(request); | 135 bool is_cacheable = RequestIsCacheable(request); |
136 metrics_recorder_->RecordGet(is_cacheable); | 136 metrics_recorder_->RecordGet(is_cacheable); |
137 if (is_cacheable) | 137 if (is_cacheable) |
138 return NULL; | 138 return NULL; |
139 | 139 |
140 // Repeat the GET requests as it has non cacheable response with the right | 140 // Repeat the GET requests as it has non cacheable response with the right |
141 // MIME type. | 141 // MIME type. |
142 intercepted_requests_.insert(request->identifier()); | 142 intercepted_requests_.insert(request->identifier()); |
143 return new net::URLRequestRedirectJob(request, network_delegate, | 143 return new net::URLRequestRedirectJob( |
144 request->url()); | 144 request, network_delegate, request->url(), |
| 145 net::URLRequestRedirectJob::REDIRECT_302_FOUND); |
145 } | 146 } |
146 | 147 |
OLD | NEW |