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 2663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2915 NetLog::TYPE_SPDY_SESSION_SENT_WINDOW_UPDATE_FRAME, | 2915 NetLog::TYPE_SPDY_SESSION_SENT_WINDOW_UPDATE_FRAME, |
2916 base::Bind(&NetLogSpdyWindowUpdateFrameCallback, | 2916 base::Bind(&NetLogSpdyWindowUpdateFrameCallback, |
2917 stream_id, delta_window_size)); | 2917 stream_id, delta_window_size)); |
2918 | 2918 |
2919 DCHECK(buffered_spdy_framer_.get()); | 2919 DCHECK(buffered_spdy_framer_.get()); |
2920 scoped_ptr<SpdyFrame> window_update_frame( | 2920 scoped_ptr<SpdyFrame> window_update_frame( |
2921 buffered_spdy_framer_->CreateWindowUpdate(stream_id, delta_window_size)); | 2921 buffered_spdy_framer_->CreateWindowUpdate(stream_id, delta_window_size)); |
2922 EnqueueSessionWrite(priority, WINDOW_UPDATE, window_update_frame.Pass()); | 2922 EnqueueSessionWrite(priority, WINDOW_UPDATE, window_update_frame.Pass()); |
2923 } | 2923 } |
2924 | 2924 |
2925 void SpdySession::WritePingFrame(uint32 unique_id, bool is_ack) { | 2925 void SpdySession::WritePingFrame(SpdyPingId unique_id, bool is_ack) { |
2926 DCHECK(buffered_spdy_framer_.get()); | 2926 DCHECK(buffered_spdy_framer_.get()); |
2927 scoped_ptr<SpdyFrame> ping_frame( | 2927 scoped_ptr<SpdyFrame> ping_frame( |
2928 buffered_spdy_framer_->CreatePingFrame(unique_id, is_ack)); | 2928 buffered_spdy_framer_->CreatePingFrame(unique_id, is_ack)); |
2929 EnqueueSessionWrite(HIGHEST, PING, ping_frame.Pass()); | 2929 EnqueueSessionWrite(HIGHEST, PING, ping_frame.Pass()); |
2930 | 2930 |
2931 if (net_log().IsLogging()) { | 2931 if (net_log().IsLogging()) { |
2932 net_log().AddEvent( | 2932 net_log().AddEvent( |
2933 NetLog::TYPE_SPDY_SESSION_PING, | 2933 NetLog::TYPE_SPDY_SESSION_PING, |
2934 base::Bind(&NetLogSpdyPingCallback, unique_id, is_ack, "sent")); | 2934 base::Bind(&NetLogSpdyPingCallback, unique_id, is_ack, "sent")); |
2935 } | 2935 } |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3274 if (!queue->empty()) { | 3274 if (!queue->empty()) { |
3275 SpdyStreamId stream_id = queue->front(); | 3275 SpdyStreamId stream_id = queue->front(); |
3276 queue->pop_front(); | 3276 queue->pop_front(); |
3277 return stream_id; | 3277 return stream_id; |
3278 } | 3278 } |
3279 } | 3279 } |
3280 return 0; | 3280 return 0; |
3281 } | 3281 } |
3282 | 3282 |
3283 } // namespace net | 3283 } // namespace net |
OLD | NEW |