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 <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1391 NOTREACHED() << "read_state_: " << read_state_; | 1391 NOTREACHED() << "read_state_: " << read_state_; |
1392 break; | 1392 break; |
1393 } | 1393 } |
1394 | 1394 |
1395 if (availability_state_ == STATE_DRAINING) | 1395 if (availability_state_ == STATE_DRAINING) |
1396 break; | 1396 break; |
1397 | 1397 |
1398 if (result == ERR_IO_PENDING) | 1398 if (result == ERR_IO_PENDING) |
1399 break; | 1399 break; |
1400 | 1400 |
1401 if (bytes_read_without_yielding > kYieldAfterBytesRead || | 1401 if (read_state_ == READ_STATE_DO_READ && |
1402 time_func_() > yield_after_time) { | 1402 (bytes_read_without_yielding > kYieldAfterBytesRead || |
1403 read_state_ = READ_STATE_DO_READ; | 1403 time_func_() > yield_after_time)) { |
1404 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1404 base::ThreadTaskRunnerHandle::Get()->PostTask( |
1405 FROM_HERE, | 1405 FROM_HERE, |
1406 base::Bind(&SpdySession::PumpReadLoop, weak_factory_.GetWeakPtr(), | 1406 base::Bind(&SpdySession::PumpReadLoop, weak_factory_.GetWeakPtr(), |
1407 READ_STATE_DO_READ, OK)); | 1407 READ_STATE_DO_READ, OK)); |
1408 result = ERR_IO_PENDING; | 1408 result = ERR_IO_PENDING; |
1409 break; | 1409 break; |
1410 } | 1410 } |
1411 } | 1411 } |
1412 | 1412 |
1413 CHECK(in_io_loop_); | 1413 CHECK(in_io_loop_); |
(...skipping 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3268 if (!queue->empty()) { | 3268 if (!queue->empty()) { |
3269 SpdyStreamId stream_id = queue->front(); | 3269 SpdyStreamId stream_id = queue->front(); |
3270 queue->pop_front(); | 3270 queue->pop_front(); |
3271 return stream_id; | 3271 return stream_id; |
3272 } | 3272 } |
3273 } | 3273 } |
3274 return 0; | 3274 return 0; |
3275 } | 3275 } |
3276 | 3276 |
3277 } // namespace net | 3277 } // namespace net |
OLD | NEW |