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

Unified Diff: net/spdy/spdy_session.cc

Issue 2642133002: Change WeakPtr<SpdyStream> to raw pointer in SpdyHttpStream. (Closed)
Patch Set: Nits. Created 3 years, 11 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/spdy/spdy_session.h ('k') | net/spdy/spdy_session_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session.cc
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index 36793c985d025a13735ead5d75cce9792bfc29b5..55c0c47d393baf5d29736df0831b5853ce296a81 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -834,14 +834,14 @@ bool SpdySession::VerifyDomainAuthentication(const std::string& domain) {
int SpdySession::GetPushStream(const GURL& url,
RequestPriority priority,
- base::WeakPtr<SpdyStream>* stream,
+ SpdyStream** stream,
const NetLogWithSource& stream_net_log) {
CHECK(!in_io_loop_);
- stream->reset();
-
- if (availability_state_ == STATE_DRAINING)
+ if (availability_state_ == STATE_DRAINING) {
+ *stream = nullptr;
return ERR_CONNECTION_CLOSED;
+ }
*stream = GetActivePushStream(url);
if (*stream) {
@@ -1985,11 +1985,11 @@ SpdyStreamId SpdySession::GetStreamIdForPush(const GURL& url) {
return unclaimed_it->second.stream_id;
}
-base::WeakPtr<SpdyStream> SpdySession::GetActivePushStream(const GURL& url) {
+SpdyStream* SpdySession::GetActivePushStream(const GURL& url) {
UnclaimedPushedStreamContainer::const_iterator unclaimed_it =
unclaimed_pushed_streams_.find(url);
if (unclaimed_it == unclaimed_pushed_streams_.end())
- return base::WeakPtr<SpdyStream>();
+ return nullptr;
SpdyStreamId stream_id = unclaimed_it->second.stream_id;
unclaimed_pushed_streams_.erase(unclaimed_it);
@@ -1997,13 +1997,13 @@ base::WeakPtr<SpdyStream> SpdySession::GetActivePushStream(const GURL& url) {
ActiveStreamMap::iterator active_it = active_streams_.find(stream_id);
if (active_it == active_streams_.end()) {
NOTREACHED();
- return base::WeakPtr<SpdyStream>();
+ return nullptr;
}
net_log_.AddEvent(NetLogEventType::HTTP2_STREAM_ADOPTED_PUSH_STREAM,
base::Bind(&NetLogSpdyAdoptedPushStreamCallback,
active_it->second->stream_id(), &url));
- return active_it->second->GetWeakPtr();
+ return active_it->second;
}
url::SchemeHostPort SpdySession::GetServer() {
« no previous file with comments | « net/spdy/spdy_session.h ('k') | net/spdy/spdy_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698