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> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "net/spdy/spdy_buffer_producer.h" | 43 #include "net/spdy/spdy_buffer_producer.h" |
44 #include "net/spdy/spdy_frame_builder.h" | 44 #include "net/spdy/spdy_frame_builder.h" |
45 #include "net/spdy/spdy_http_utils.h" | 45 #include "net/spdy/spdy_http_utils.h" |
46 #include "net/spdy/spdy_protocol.h" | 46 #include "net/spdy/spdy_protocol.h" |
47 #include "net/spdy/spdy_session_pool.h" | 47 #include "net/spdy/spdy_session_pool.h" |
48 #include "net/spdy/spdy_stream.h" | 48 #include "net/spdy/spdy_stream.h" |
49 #include "net/ssl/channel_id_service.h" | 49 #include "net/ssl/channel_id_service.h" |
50 #include "net/ssl/ssl_cipher_suite_names.h" | 50 #include "net/ssl/ssl_cipher_suite_names.h" |
51 #include "net/ssl/ssl_connection_status_flags.h" | 51 #include "net/ssl/ssl_connection_status_flags.h" |
52 | 52 |
| 53 #include "base/trace_event/trace_event.h" |
| 54 |
53 namespace net { | 55 namespace net { |
54 | 56 |
55 namespace { | 57 namespace { |
56 | 58 |
57 const int kReadBufferSize = 8 * 1024; | 59 const int kReadBufferSize = 8 * 1024; |
58 const int kDefaultConnectionAtRiskOfLossSeconds = 10; | 60 const int kDefaultConnectionAtRiskOfLossSeconds = 10; |
59 const int kHungIntervalSeconds = 10; | 61 const int kHungIntervalSeconds = 10; |
60 | 62 |
61 // Minimum seconds that unclaimed pushed streams will be kept in memory. | 63 // Minimum seconds that unclaimed pushed streams will be kept in memory. |
62 const int kMinPushedStreamLifetimeSeconds = 300; | 64 const int kMinPushedStreamLifetimeSeconds = 300; |
(...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1385 | 1387 |
1386 DCHECK(buffered_spdy_framer_.get()); | 1388 DCHECK(buffered_spdy_framer_.get()); |
1387 scoped_ptr<SpdyFrame> rst_frame( | 1389 scoped_ptr<SpdyFrame> rst_frame( |
1388 buffered_spdy_framer_->CreateRstStream(stream_id, status)); | 1390 buffered_spdy_framer_->CreateRstStream(stream_id, status)); |
1389 | 1391 |
1390 EnqueueSessionWrite(priority, RST_STREAM, std::move(rst_frame)); | 1392 EnqueueSessionWrite(priority, RST_STREAM, std::move(rst_frame)); |
1391 RecordProtocolErrorHistogram(MapRstStreamStatusToProtocolError(status)); | 1393 RecordProtocolErrorHistogram(MapRstStreamStatusToProtocolError(status)); |
1392 } | 1394 } |
1393 | 1395 |
1394 void SpdySession::PumpReadLoop(ReadState expected_read_state, int result) { | 1396 void SpdySession::PumpReadLoop(ReadState expected_read_state, int result) { |
| 1397 TRACE_EVENT0("net", "net::SpdySession::PumpReadLoop"); |
1395 // TODO(bnc): Remove ScopedTracker below once crbug.com/462774 is fixed. | 1398 // TODO(bnc): Remove ScopedTracker below once crbug.com/462774 is fixed. |
1396 tracked_objects::ScopedTracker tracking_profile( | 1399 tracked_objects::ScopedTracker tracking_profile( |
1397 FROM_HERE_WITH_EXPLICIT_FUNCTION("462774 SpdySession::PumpReadLoop")); | 1400 FROM_HERE_WITH_EXPLICIT_FUNCTION("462774 SpdySession::PumpReadLoop")); |
1398 | 1401 |
1399 CHECK(!in_io_loop_); | 1402 CHECK(!in_io_loop_); |
1400 if (availability_state_ == STATE_DRAINING) { | 1403 if (availability_state_ == STATE_DRAINING) { |
1401 return; | 1404 return; |
1402 } | 1405 } |
1403 ignore_result(DoReadLoop(expected_read_state, result)); | 1406 ignore_result(DoReadLoop(expected_read_state, result)); |
1404 } | 1407 } |
(...skipping 1885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3290 if (!queue->empty()) { | 3293 if (!queue->empty()) { |
3291 SpdyStreamId stream_id = queue->front(); | 3294 SpdyStreamId stream_id = queue->front(); |
3292 queue->pop_front(); | 3295 queue->pop_front(); |
3293 return stream_id; | 3296 return stream_id; |
3294 } | 3297 } |
3295 } | 3298 } |
3296 return 0; | 3299 return 0; |
3297 } | 3300 } |
3298 | 3301 |
3299 } // namespace net | 3302 } // namespace net |
OLD | NEW |