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

Unified Diff: net/http/http_stream_factory_impl.cc

Issue 18546008: [SPDY] Use WeakPtr<SpdySession> everywhere but SpdySessionPool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test, other minor formatting/comment changes 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_stream_factory_impl.h ('k') | net/http/http_stream_factory_impl_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_factory_impl.cc
diff --git a/net/http/http_stream_factory_impl.cc b/net/http/http_stream_factory_impl.cc
index c54d92e0c89a73647c312f1c17c626b87b543f1c..35d94d779f8cefbac1cc7eed79f1c250a44cfca7 100644
--- a/net/http/http_stream_factory_impl.cc
+++ b/net/http/http_stream_factory_impl.cc
@@ -263,7 +263,7 @@ void HttpStreamFactoryImpl::OrphanJob(Job* job, const Request* request) {
}
void HttpStreamFactoryImpl::OnNewSpdySessionReady(
- scoped_refptr<SpdySession> spdy_session,
+ const base::WeakPtr<SpdySession>& spdy_session,
bool direct,
const SSLConfig& used_ssl_config,
const ProxyInfo& used_proxy_info,
@@ -271,15 +271,16 @@ void HttpStreamFactoryImpl::OnNewSpdySessionReady(
NextProto protocol_negotiated,
bool using_spdy,
const BoundNetLog& net_log) {
- const SpdySessionKey& spdy_session_key =
- spdy_session->spdy_session_key();
- while (!spdy_session->IsClosed()) {
- // Each iteration may empty out the RequestSet for |spdy_session_key_ in
+ while (true) {
+ if (!spdy_session)
+ break;
+ const SpdySessionKey& spdy_session_key = spdy_session->spdy_session_key();
+ // Each iteration may empty out the RequestSet for |spdy_session_key| in
// |spdy_session_request_map_|. So each time, check for RequestSet and use
// the first one.
//
// TODO(willchan): If it's important, switch RequestSet out for a FIFO
- // pqueue (Order by priority first, then FIFO within same priority). Unclear
+ // queue (Order by priority first, then FIFO within same priority). Unclear
// that it matters here.
if (!ContainsKey(spdy_session_request_map_, spdy_session_key))
break;
@@ -297,14 +298,14 @@ void HttpStreamFactoryImpl::OnNewSpdySessionReady(
NULL,
used_ssl_config,
used_proxy_info,
- factory->CreateSpdyStream(spdy_session.get(), use_relative_url));
+ factory->CreateSpdyStream(spdy_session, use_relative_url));
} else {
bool use_relative_url = direct || request->url().SchemeIs("https");
request->OnStreamReady(
NULL,
used_ssl_config,
used_proxy_info,
- new SpdyHttpStream(spdy_session.get(), use_relative_url));
+ new SpdyHttpStream(spdy_session, use_relative_url));
}
}
// TODO(mbelshe): Alert other valid requests.
« no previous file with comments | « net/http/http_stream_factory_impl.h ('k') | net/http/http_stream_factory_impl_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698