| 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 "net/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/format_macros.h" | 13 #include "base/format_macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/metrics/field_trial.h" | 15 #include "base/metrics/field_trial.h" |
| 16 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
| 17 #include "base/metrics/stats_counters.h" | |
| 18 #include "base/profiler/scoped_tracker.h" | 17 #include "base/profiler/scoped_tracker.h" |
| 19 #include "base/stl_util.h" | 18 #include "base/stl_util.h" |
| 20 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
| 21 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
| 22 #include "base/strings/stringprintf.h" | 21 #include "base/strings/stringprintf.h" |
| 23 #include "base/time/time.h" | 22 #include "base/time/time.h" |
| 24 #include "base/values.h" | 23 #include "base/values.h" |
| 25 #include "build/build_config.h" | 24 #include "build/build_config.h" |
| 26 #include "net/base/auth.h" | 25 #include "net/base/auth.h" |
| 27 #include "net/base/host_port_pair.h" | 26 #include "net/base/host_port_pair.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 } | 155 } |
| 157 } | 156 } |
| 158 | 157 |
| 159 if (request_ && request_->upload_data_stream) | 158 if (request_ && request_->upload_data_stream) |
| 160 request_->upload_data_stream->Reset(); // Invalidate pending callbacks. | 159 request_->upload_data_stream->Reset(); // Invalidate pending callbacks. |
| 161 } | 160 } |
| 162 | 161 |
| 163 int HttpNetworkTransaction::Start(const HttpRequestInfo* request_info, | 162 int HttpNetworkTransaction::Start(const HttpRequestInfo* request_info, |
| 164 const CompletionCallback& callback, | 163 const CompletionCallback& callback, |
| 165 const BoundNetLog& net_log) { | 164 const BoundNetLog& net_log) { |
| 166 SIMPLE_STATS_COUNTER("HttpNetworkTransaction.Count"); | |
| 167 | |
| 168 net_log_ = net_log; | 165 net_log_ = net_log; |
| 169 request_ = request_info; | 166 request_ = request_info; |
| 170 | 167 |
| 171 if (request_->load_flags & LOAD_DISABLE_CERT_REVOCATION_CHECKING) { | 168 if (request_->load_flags & LOAD_DISABLE_CERT_REVOCATION_CHECKING) { |
| 172 server_ssl_config_.rev_checking_enabled = false; | 169 server_ssl_config_.rev_checking_enabled = false; |
| 173 proxy_ssl_config_.rev_checking_enabled = false; | 170 proxy_ssl_config_.rev_checking_enabled = false; |
| 174 } | 171 } |
| 175 | 172 |
| 176 if (request_->load_flags & LOAD_PREFETCH) | 173 if (request_->load_flags & LOAD_PREFETCH) |
| 177 response_.unused_since_prefetch = true; | 174 response_.unused_since_prefetch = true; |
| 178 | 175 |
| 179 // Channel ID is disabled if privacy mode is enabled for this request. | 176 // Channel ID is disabled if privacy mode is enabled for this request. |
| 180 if (request_->privacy_mode == PRIVACY_MODE_ENABLED) | 177 if (request_->privacy_mode == PRIVACY_MODE_ENABLED) |
| 181 server_ssl_config_.channel_id_enabled = false; | 178 server_ssl_config_.channel_id_enabled = false; |
| 182 | 179 |
| 180 if (server_ssl_config_.fastradio_padding_enabled) { |
| 181 server_ssl_config_.fastradio_padding_eligible = |
| 182 session_->ssl_config_service()->SupportsFastradioPadding( |
| 183 request_info->url); |
| 184 } |
| 185 |
| 183 next_state_ = STATE_NOTIFY_BEFORE_CREATE_STREAM; | 186 next_state_ = STATE_NOTIFY_BEFORE_CREATE_STREAM; |
| 184 int rv = DoLoop(OK); | 187 int rv = DoLoop(OK); |
| 185 if (rv == ERR_IO_PENDING) | 188 if (rv == ERR_IO_PENDING) |
| 186 callback_ = callback; | 189 callback_ = callback; |
| 187 return rv; | 190 return rv; |
| 188 } | 191 } |
| 189 | 192 |
| 190 int HttpNetworkTransaction::RestartIgnoringLastError( | 193 int HttpNetworkTransaction::RestartIgnoringLastError( |
| 191 const CompletionCallback& callback) { | 194 const CompletionCallback& callback) { |
| 192 DCHECK(!stream_.get()); | 195 DCHECK(!stream_.get()); |
| (...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1531 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 1534 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
| 1532 state); | 1535 state); |
| 1533 break; | 1536 break; |
| 1534 } | 1537 } |
| 1535 return description; | 1538 return description; |
| 1536 } | 1539 } |
| 1537 | 1540 |
| 1538 #undef STATE_CASE | 1541 #undef STATE_CASE |
| 1539 | 1542 |
| 1540 } // namespace net | 1543 } // namespace net |
| OLD | NEW |