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 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1484 | 1484 |
1485 if (result == 0) { | 1485 if (result == 0) { |
1486 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdySession.BytesRead.EOF", | 1486 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdySession.BytesRead.EOF", |
1487 total_bytes_received_, 1, 100000000, 50); | 1487 total_bytes_received_, 1, 100000000, 50); |
1488 DoDrainSession(ERR_CONNECTION_CLOSED, "Connection closed"); | 1488 DoDrainSession(ERR_CONNECTION_CLOSED, "Connection closed"); |
1489 | 1489 |
1490 return ERR_CONNECTION_CLOSED; | 1490 return ERR_CONNECTION_CLOSED; |
1491 } | 1491 } |
1492 | 1492 |
1493 if (result < 0) { | 1493 if (result < 0) { |
1494 DoDrainSession(static_cast<Error>(result), "result is < 0."); | 1494 DoDrainSession( |
| 1495 static_cast<Error>(result), |
| 1496 base::StringPrintf("Error %d reading from socket.", -result)); |
1495 return result; | 1497 return result; |
1496 } | 1498 } |
1497 CHECK_LE(result, kReadBufferSize); | 1499 CHECK_LE(result, kReadBufferSize); |
1498 total_bytes_received_ += result; | 1500 total_bytes_received_ += result; |
1499 | 1501 |
1500 last_activity_time_ = time_func_(); | 1502 last_activity_time_ = time_func_(); |
1501 | 1503 |
1502 DCHECK(buffered_spdy_framer_.get()); | 1504 DCHECK(buffered_spdy_framer_.get()); |
1503 char* data = read_buffer_->data(); | 1505 char* data = read_buffer_->data(); |
1504 while (result > 0) { | 1506 while (result > 0) { |
(...skipping 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3273 if (!queue->empty()) { | 3275 if (!queue->empty()) { |
3274 SpdyStreamId stream_id = queue->front(); | 3276 SpdyStreamId stream_id = queue->front(); |
3275 queue->pop_front(); | 3277 queue->pop_front(); |
3276 return stream_id; | 3278 return stream_id; |
3277 } | 3279 } |
3278 } | 3280 } |
3279 return 0; | 3281 return 0; |
3280 } | 3282 } |
3281 | 3283 |
3282 } // namespace net | 3284 } // namespace net |
OLD | NEW |