| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 dict->SetInteger("status", status); | 231 dict->SetInteger("status", status); |
| 232 dict->SetString("description", *description); | 232 dict->SetString("description", *description); |
| 233 return dict; | 233 return dict; |
| 234 } | 234 } |
| 235 | 235 |
| 236 base::Value* NetLogSpdyPingCallback(SpdyPingId unique_id, | 236 base::Value* NetLogSpdyPingCallback(SpdyPingId unique_id, |
| 237 bool is_ack, | 237 bool is_ack, |
| 238 const char* type, | 238 const char* type, |
| 239 NetLog::LogLevel /* log_level */) { | 239 NetLog::LogLevel /* log_level */) { |
| 240 base::DictionaryValue* dict = new base::DictionaryValue(); | 240 base::DictionaryValue* dict = new base::DictionaryValue(); |
| 241 dict->SetInteger("unique_id", unique_id); | 241 dict->SetInteger("unique_id", static_cast<int>(unique_id)); |
| 242 dict->SetString("type", type); | 242 dict->SetString("type", type); |
| 243 dict->SetBoolean("is_ack", is_ack); | 243 dict->SetBoolean("is_ack", is_ack); |
| 244 return dict; | 244 return dict; |
| 245 } | 245 } |
| 246 | 246 |
| 247 base::Value* NetLogSpdyGoAwayCallback(SpdyStreamId last_stream_id, | 247 base::Value* NetLogSpdyGoAwayCallback(SpdyStreamId last_stream_id, |
| 248 int active_streams, | 248 int active_streams, |
| 249 int unclaimed_streams, | 249 int unclaimed_streams, |
| 250 SpdyGoAwayStatus status, | 250 SpdyGoAwayStatus status, |
| 251 NetLog::LogLevel /* log_level */) { | 251 NetLog::LogLevel /* log_level */) { |
| (...skipping 2662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2914 NetLog::TYPE_SPDY_SESSION_SENT_WINDOW_UPDATE_FRAME, | 2914 NetLog::TYPE_SPDY_SESSION_SENT_WINDOW_UPDATE_FRAME, |
| 2915 base::Bind(&NetLogSpdyWindowUpdateFrameCallback, | 2915 base::Bind(&NetLogSpdyWindowUpdateFrameCallback, |
| 2916 stream_id, delta_window_size)); | 2916 stream_id, delta_window_size)); |
| 2917 | 2917 |
| 2918 DCHECK(buffered_spdy_framer_.get()); | 2918 DCHECK(buffered_spdy_framer_.get()); |
| 2919 scoped_ptr<SpdyFrame> window_update_frame( | 2919 scoped_ptr<SpdyFrame> window_update_frame( |
| 2920 buffered_spdy_framer_->CreateWindowUpdate(stream_id, delta_window_size)); | 2920 buffered_spdy_framer_->CreateWindowUpdate(stream_id, delta_window_size)); |
| 2921 EnqueueSessionWrite(priority, WINDOW_UPDATE, window_update_frame.Pass()); | 2921 EnqueueSessionWrite(priority, WINDOW_UPDATE, window_update_frame.Pass()); |
| 2922 } | 2922 } |
| 2923 | 2923 |
| 2924 void SpdySession::WritePingFrame(uint32 unique_id, bool is_ack) { | 2924 void SpdySession::WritePingFrame(SpdyPingId unique_id, bool is_ack) { |
| 2925 DCHECK(buffered_spdy_framer_.get()); | 2925 DCHECK(buffered_spdy_framer_.get()); |
| 2926 scoped_ptr<SpdyFrame> ping_frame( | 2926 scoped_ptr<SpdyFrame> ping_frame( |
| 2927 buffered_spdy_framer_->CreatePingFrame(unique_id, is_ack)); | 2927 buffered_spdy_framer_->CreatePingFrame(unique_id, is_ack)); |
| 2928 EnqueueSessionWrite(HIGHEST, PING, ping_frame.Pass()); | 2928 EnqueueSessionWrite(HIGHEST, PING, ping_frame.Pass()); |
| 2929 | 2929 |
| 2930 if (net_log().IsLogging()) { | 2930 if (net_log().IsLogging()) { |
| 2931 net_log().AddEvent( | 2931 net_log().AddEvent( |
| 2932 NetLog::TYPE_SPDY_SESSION_PING, | 2932 NetLog::TYPE_SPDY_SESSION_PING, |
| 2933 base::Bind(&NetLogSpdyPingCallback, unique_id, is_ack, "sent")); | 2933 base::Bind(&NetLogSpdyPingCallback, unique_id, is_ack, "sent")); |
| 2934 } | 2934 } |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3272 if (!queue->empty()) { | 3272 if (!queue->empty()) { |
| 3273 SpdyStreamId stream_id = queue->front(); | 3273 SpdyStreamId stream_id = queue->front(); |
| 3274 queue->pop_front(); | 3274 queue->pop_front(); |
| 3275 return stream_id; | 3275 return stream_id; |
| 3276 } | 3276 } |
| 3277 } | 3277 } |
| 3278 return 0; | 3278 return 0; |
| 3279 } | 3279 } |
| 3280 | 3280 |
| 3281 } // namespace net | 3281 } // namespace net |
| OLD | NEW |