| 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/spdy/spdy_session.h" | 5 #include "net/spdy/spdy_session.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/location.h" | 14 #include "base/location.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/metrics/histogram_macros.h" | 16 #include "base/metrics/histogram_macros.h" |
| 17 #include "base/metrics/sparse_histogram.h" | 17 #include "base/metrics/sparse_histogram.h" |
| 18 #include "base/profiler/scoped_tracker.h" | 18 #include "base/profiler/scoped_tracker.h" |
| 19 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
| 20 #include "base/stl_util.h" | 20 #include "base/stl_util.h" |
| 21 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
| 22 #include "base/strings/string_util.h" | 22 #include "base/strings/string_util.h" |
| 23 #include "base/strings/stringprintf.h" | 23 #include "base/strings/stringprintf.h" |
| 24 #include "base/strings/utf_string_conversions.h" | 24 #include "base/strings/utf_string_conversions.h" |
| 25 #include "base/thread_task_runner_handle.h" | 25 #include "base/thread_task_runner_handle.h" |
| 26 #include "base/time/time.h" | 26 #include "base/time/time.h" |
| 27 #include "base/trace_event/trace_event.h" |
| 27 #include "base/values.h" | 28 #include "base/values.h" |
| 28 #include "crypto/ec_private_key.h" | 29 #include "crypto/ec_private_key.h" |
| 29 #include "crypto/ec_signature_creator.h" | 30 #include "crypto/ec_signature_creator.h" |
| 30 #include "net/base/connection_type_histograms.h" | 31 #include "net/base/connection_type_histograms.h" |
| 31 #include "net/base/proxy_delegate.h" | 32 #include "net/base/proxy_delegate.h" |
| 32 #include "net/cert/asn1_util.h" | 33 #include "net/cert/asn1_util.h" |
| 33 #include "net/cert/cert_verify_result.h" | 34 #include "net/cert/cert_verify_result.h" |
| 34 #include "net/http/http_log_util.h" | 35 #include "net/http/http_log_util.h" |
| 35 #include "net/http/http_network_session.h" | 36 #include "net/http/http_network_session.h" |
| 36 #include "net/http/http_server_properties.h" | 37 #include "net/http/http_server_properties.h" |
| (...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1376 | 1377 |
| 1377 DCHECK(buffered_spdy_framer_.get()); | 1378 DCHECK(buffered_spdy_framer_.get()); |
| 1378 scoped_ptr<SpdyFrame> rst_frame( | 1379 scoped_ptr<SpdyFrame> rst_frame( |
| 1379 buffered_spdy_framer_->CreateRstStream(stream_id, status)); | 1380 buffered_spdy_framer_->CreateRstStream(stream_id, status)); |
| 1380 | 1381 |
| 1381 EnqueueSessionWrite(priority, RST_STREAM, std::move(rst_frame)); | 1382 EnqueueSessionWrite(priority, RST_STREAM, std::move(rst_frame)); |
| 1382 RecordProtocolErrorHistogram(MapRstStreamStatusToProtocolError(status)); | 1383 RecordProtocolErrorHistogram(MapRstStreamStatusToProtocolError(status)); |
| 1383 } | 1384 } |
| 1384 | 1385 |
| 1385 void SpdySession::PumpReadLoop(ReadState expected_read_state, int result) { | 1386 void SpdySession::PumpReadLoop(ReadState expected_read_state, int result) { |
| 1387 TRACE_EVENT0("net", "SpdySession::PumpReadLoop"); |
| 1386 // TODO(bnc): Remove ScopedTracker below once crbug.com/462774 is fixed. | 1388 // TODO(bnc): Remove ScopedTracker below once crbug.com/462774 is fixed. |
| 1387 tracked_objects::ScopedTracker tracking_profile( | 1389 tracked_objects::ScopedTracker tracking_profile( |
| 1388 FROM_HERE_WITH_EXPLICIT_FUNCTION("462774 SpdySession::PumpReadLoop")); | 1390 FROM_HERE_WITH_EXPLICIT_FUNCTION("462774 SpdySession::PumpReadLoop")); |
| 1389 | 1391 |
| 1390 CHECK(!in_io_loop_); | 1392 CHECK(!in_io_loop_); |
| 1391 if (availability_state_ == STATE_DRAINING) { | 1393 if (availability_state_ == STATE_DRAINING) { |
| 1392 return; | 1394 return; |
| 1393 } | 1395 } |
| 1394 ignore_result(DoReadLoop(expected_read_state, result)); | 1396 ignore_result(DoReadLoop(expected_read_state, result)); |
| 1395 } | 1397 } |
| (...skipping 1910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3306 if (!queue->empty()) { | 3308 if (!queue->empty()) { |
| 3307 SpdyStreamId stream_id = queue->front(); | 3309 SpdyStreamId stream_id = queue->front(); |
| 3308 queue->pop_front(); | 3310 queue->pop_front(); |
| 3309 return stream_id; | 3311 return stream_id; |
| 3310 } | 3312 } |
| 3311 } | 3313 } |
| 3312 return 0; | 3314 return 0; |
| 3313 } | 3315 } |
| 3314 | 3316 |
| 3315 } // namespace net | 3317 } // namespace net |
| OLD | NEW |