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

Unified Diff: net/spdy/spdy_session.cc

Issue 2642133002: Change WeakPtr<SpdyStream> to raw pointer in SpdyHttpStream. (Closed)
Patch Set: 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
Index: net/spdy/spdy_session.cc
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index 36793c985d025a13735ead5d75cce9792bfc29b5..7b510e1014bab9b0c7d5a85638a64364c37aa00d 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -834,12 +834,10 @@ 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)
xunjieli 2017/01/20 02:57:20 I think we need to keep the original logic to rese
Bence 2017/01/20 15:53:13 Done. I moved it to the if branch. BTW the DCHEC
xunjieli 2017/01/20 15:57:23 Acknowledged.
return ERR_CONNECTION_CLOSED;
@@ -1985,11 +1983,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 +1995,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() {

Powered by Google App Engine
This is Rietveld 408576698