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 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1380 | 1381 |
1381 DCHECK(buffered_spdy_framer_.get()); | 1382 DCHECK(buffered_spdy_framer_.get()); |
1382 scoped_ptr<SpdyFrame> rst_frame( | 1383 scoped_ptr<SpdyFrame> rst_frame( |
1383 buffered_spdy_framer_->CreateRstStream(stream_id, status)); | 1384 buffered_spdy_framer_->CreateRstStream(stream_id, status)); |
1384 | 1385 |
1385 EnqueueSessionWrite(priority, RST_STREAM, std::move(rst_frame)); | 1386 EnqueueSessionWrite(priority, RST_STREAM, std::move(rst_frame)); |
1386 RecordProtocolErrorHistogram(MapRstStreamStatusToProtocolError(status)); | 1387 RecordProtocolErrorHistogram(MapRstStreamStatusToProtocolError(status)); |
1387 } | 1388 } |
1388 | 1389 |
1389 void SpdySession::PumpReadLoop(ReadState expected_read_state, int result) { | 1390 void SpdySession::PumpReadLoop(ReadState expected_read_state, int result) { |
| 1391 TRACE_EVENT0("net", "SpdySession::PumpReadLoop"); |
1390 // TODO(bnc): Remove ScopedTracker below once crbug.com/462774 is fixed. | 1392 // TODO(bnc): Remove ScopedTracker below once crbug.com/462774 is fixed. |
1391 tracked_objects::ScopedTracker tracking_profile( | 1393 tracked_objects::ScopedTracker tracking_profile( |
1392 FROM_HERE_WITH_EXPLICIT_FUNCTION("462774 SpdySession::PumpReadLoop")); | 1394 FROM_HERE_WITH_EXPLICIT_FUNCTION("462774 SpdySession::PumpReadLoop")); |
1393 | 1395 |
1394 CHECK(!in_io_loop_); | 1396 CHECK(!in_io_loop_); |
1395 if (availability_state_ == STATE_DRAINING) { | 1397 if (availability_state_ == STATE_DRAINING) { |
1396 return; | 1398 return; |
1397 } | 1399 } |
1398 ignore_result(DoReadLoop(expected_read_state, result)); | 1400 ignore_result(DoReadLoop(expected_read_state, result)); |
1399 } | 1401 } |
(...skipping 1910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3310 if (!queue->empty()) { | 3312 if (!queue->empty()) { |
3311 SpdyStreamId stream_id = queue->front(); | 3313 SpdyStreamId stream_id = queue->front(); |
3312 queue->pop_front(); | 3314 queue->pop_front(); |
3313 return stream_id; | 3315 return stream_id; |
3314 } | 3316 } |
3315 } | 3317 } |
3316 return 0; | 3318 return 0; |
3317 } | 3319 } |
3318 | 3320 |
3319 } // namespace net | 3321 } // namespace net |
OLD | NEW |