| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 namespace { | 55 namespace { |
| 56 | 56 |
| 57 const int kReadBufferSize = 8 * 1024; | 57 const int kReadBufferSize = 8 * 1024; |
| 58 const int kDefaultConnectionAtRiskOfLossSeconds = 10; | 58 const int kDefaultConnectionAtRiskOfLossSeconds = 10; |
| 59 const int kHungIntervalSeconds = 10; | 59 const int kHungIntervalSeconds = 10; |
| 60 | 60 |
| 61 // Minimum seconds that unclaimed pushed streams will be kept in memory. | 61 // Minimum seconds that unclaimed pushed streams will be kept in memory. |
| 62 const int kMinPushedStreamLifetimeSeconds = 300; | 62 const int kMinPushedStreamLifetimeSeconds = 300; |
| 63 | 63 |
| 64 std::unique_ptr<base::ListValue> SpdyHeaderBlockToListValue( | |
| 65 const SpdyHeaderBlock& headers, | |
| 66 NetLogCaptureMode capture_mode) { | |
| 67 std::unique_ptr<base::ListValue> headers_list(new base::ListValue()); | |
| 68 for (SpdyHeaderBlock::const_iterator it = headers.begin(); | |
| 69 it != headers.end(); ++it) { | |
| 70 headers_list->AppendString( | |
| 71 it->first.as_string() + ": " + | |
| 72 ElideHeaderValueForNetLog(capture_mode, it->first.as_string(), | |
| 73 it->second.as_string())); | |
| 74 } | |
| 75 return headers_list; | |
| 76 } | |
| 77 | |
| 78 std::unique_ptr<base::Value> NetLogSpdySynStreamSentCallback( | 64 std::unique_ptr<base::Value> NetLogSpdySynStreamSentCallback( |
| 79 const SpdyHeaderBlock* headers, | 65 const SpdyHeaderBlock* headers, |
| 80 bool fin, | 66 bool fin, |
| 81 bool unidirectional, | 67 bool unidirectional, |
| 82 SpdyPriority spdy_priority, | 68 SpdyPriority spdy_priority, |
| 83 SpdyStreamId stream_id, | 69 SpdyStreamId stream_id, |
| 84 NetLogCaptureMode capture_mode) { | 70 NetLogCaptureMode capture_mode) { |
| 85 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 71 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 86 dict->Set("headers", SpdyHeaderBlockToListValue(*headers, capture_mode)); | 72 dict->Set("headers", SpdyHeaderBlockToListValue(*headers, capture_mode)); |
| 87 dict->SetBoolean("fin", fin); | 73 dict->SetBoolean("fin", fin); |
| (...skipping 3241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3329 if (!queue->empty()) { | 3315 if (!queue->empty()) { |
| 3330 SpdyStreamId stream_id = queue->front(); | 3316 SpdyStreamId stream_id = queue->front(); |
| 3331 queue->pop_front(); | 3317 queue->pop_front(); |
| 3332 return stream_id; | 3318 return stream_id; |
| 3333 } | 3319 } |
| 3334 } | 3320 } |
| 3335 return 0; | 3321 return 0; |
| 3336 } | 3322 } |
| 3337 | 3323 |
| 3338 } // namespace net | 3324 } // namespace net |
| OLD | NEW |