OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/linked_ptr.h" | 8 #include "base/linked_ptr.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 bool no_pending_create_streams = true; | 355 bool no_pending_create_streams = true; |
356 for (int i = 0;i < NUM_PRIORITIES;++i) { | 356 for (int i = 0;i < NUM_PRIORITIES;++i) { |
357 if (!create_stream_queues_[i].empty()) { | 357 if (!create_stream_queues_[i].empty()) { |
358 PendingCreateStream pending_create = create_stream_queues_[i].front(); | 358 PendingCreateStream pending_create = create_stream_queues_[i].front(); |
359 create_stream_queues_[i].pop(); | 359 create_stream_queues_[i].pop(); |
360 no_pending_create_streams = false; | 360 no_pending_create_streams = false; |
361 int error = CreateStreamImpl(*pending_create.url, | 361 int error = CreateStreamImpl(*pending_create.url, |
362 pending_create.priority, | 362 pending_create.priority, |
363 pending_create.spdy_stream, | 363 pending_create.spdy_stream, |
364 *pending_create.stream_net_log); | 364 *pending_create.stream_net_log); |
365 pending_create.callback->Run(error); | 365 MessageLoop::current()->PostTask( |
| 366 FROM_HERE, |
| 367 method_factory_.NewRunnableMethod( |
| 368 &SpdySession::InvokeUserStreamCreationCallback, |
| 369 pending_create.callback, error)); |
366 break; | 370 break; |
367 } | 371 } |
368 } | 372 } |
369 if (no_pending_create_streams) | 373 if (no_pending_create_streams) |
370 return; // there were no streams in any queue | 374 return; // there were no streams in any queue |
371 } | 375 } |
372 } | 376 } |
373 | 377 |
374 void SpdySession::CancelPendingCreateStreams( | 378 void SpdySession::CancelPendingCreateStreams( |
375 const scoped_refptr<SpdyStream>* spdy_stream) { | 379 const scoped_refptr<SpdyStream>* spdy_stream) { |
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1291 case spdy::SETTINGS_DOWNLOAD_RETRANS_RATE: | 1295 case spdy::SETTINGS_DOWNLOAD_RETRANS_RATE: |
1292 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdySettingsRetransRate", | 1296 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.SpdySettingsRetransRate", |
1293 setting.second, | 1297 setting.second, |
1294 1, 100, 50); | 1298 1, 100, 50); |
1295 break; | 1299 break; |
1296 } | 1300 } |
1297 } | 1301 } |
1298 } | 1302 } |
1299 } | 1303 } |
1300 | 1304 |
| 1305 void SpdySession::InvokeUserStreamCreationCallback( |
| 1306 CompletionCallback* callback, int rv) { |
| 1307 callback->Run(rv); |
| 1308 } |
| 1309 |
1301 } // namespace net | 1310 } // namespace net |
OLD | NEW |