Chromium Code Reviews| 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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 497 #endif | 497 #endif |
| 498 | 498 |
| 499 net_log_.AddEvent( | 499 net_log_.AddEvent( |
| 500 NetLog::TYPE_SPDY_SESSION_INITIALIZED, | 500 NetLog::TYPE_SPDY_SESSION_INITIALIZED, |
| 501 connection_->socket()->NetLog().source().ToEventParametersCallback()); | 501 connection_->socket()->NetLog().source().ToEventParametersCallback()); |
| 502 | 502 |
| 503 int error = DoLoop(OK); | 503 int error = DoLoop(OK); |
| 504 if (error == ERR_IO_PENDING) | 504 if (error == ERR_IO_PENDING) |
| 505 error = OK; | 505 error = OK; |
| 506 if (error == OK) { | 506 if (error == OK) { |
| 507 connection_->AddLayeredPool(this); | 507 connection_->AddHigherLayeredPool(this); |
| 508 SendInitialSettings(); | 508 SendInitialSettings(); |
| 509 // Write out any data that we might have to send, such as the | 509 // Write out any data that we might have to send, such as the |
| 510 // settings frame. | 510 // settings frame. |
| 511 WriteSocketLater(); | 511 WriteSocketLater(); |
| 512 spdy_session_pool_ = spdy_session_pool; | 512 spdy_session_pool_ = spdy_session_pool; |
| 513 } | 513 } |
| 514 return static_cast<Error>(error); | 514 return static_cast<Error>(error); |
| 515 } | 515 } |
| 516 | 516 |
| 517 bool SpdySession::VerifyDomainAuthentication(const std::string& domain) { | 517 bool SpdySession::VerifyDomainAuthentication(const std::string& domain) { |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 991 unclaimed_pushed_streams_.erase(it2); | 991 unclaimed_pushed_streams_.erase(it2); |
| 992 break; | 992 break; |
| 993 } | 993 } |
| 994 } | 994 } |
| 995 } | 995 } |
| 996 | 996 |
| 997 scoped_ptr<SpdyStream> owned_stream(it->second.stream); | 997 scoped_ptr<SpdyStream> owned_stream(it->second.stream); |
| 998 active_streams_.erase(it); | 998 active_streams_.erase(it); |
| 999 | 999 |
| 1000 DeleteStream(owned_stream.Pass(), status); | 1000 DeleteStream(owned_stream.Pass(), status); |
| 1001 | |
| 1002 // If there are no active streams, and the socket pool is stalled, try to free | |
| 1003 // up a socket slot. | |
| 1004 if (active_streams_.empty() && connection_->IsPoolStalled()) | |
| 1005 RemoveFromPool(); | |
|
Ryan Hamilton
2013/07/21 14:53:54
akalin has been refactoring SpdySession quite a bi
mmenke
2013/07/22 20:13:33
Yea, this completely doesn't work now. Removing f
| |
| 1001 } | 1006 } |
| 1002 | 1007 |
| 1003 void SpdySession::CloseCreatedStreamIterator(CreatedStreamSet::iterator it, | 1008 void SpdySession::CloseCreatedStreamIterator(CreatedStreamSet::iterator it, |
| 1004 int status) { | 1009 int status) { |
| 1005 scoped_ptr<SpdyStream> owned_stream(*it); | 1010 scoped_ptr<SpdyStream> owned_stream(*it); |
| 1006 created_streams_.erase(it); | 1011 created_streams_.erase(it); |
| 1007 DeleteStream(owned_stream.Pass(), status); | 1012 DeleteStream(owned_stream.Pass(), status); |
| 1008 } | 1013 } |
| 1009 | 1014 |
| 1010 void SpdySession::ResetStreamIterator(ActiveStreamMap::iterator it, | 1015 void SpdySession::ResetStreamIterator(ActiveStreamMap::iterator it, |
| (...skipping 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2602 if (!queue->empty()) { | 2607 if (!queue->empty()) { |
| 2603 SpdyStreamId stream_id = queue->front(); | 2608 SpdyStreamId stream_id = queue->front(); |
| 2604 queue->pop_front(); | 2609 queue->pop_front(); |
| 2605 return stream_id; | 2610 return stream_id; |
| 2606 } | 2611 } |
| 2607 } | 2612 } |
| 2608 return 0; | 2613 return 0; |
| 2609 } | 2614 } |
| 2610 | 2615 |
| 2611 } // namespace net | 2616 } // namespace net |
| OLD | NEW |