Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: net/spdy/spdy_session.cc

Issue 18796003: When an idle socket is added back to a socket pool, check for stalled jobs in lower pools (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Undo somewhat tangential change Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698