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

Side by Side Diff: net/spdy/spdy_http_stream.h

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/socket/ssl_client_socket_pool_unittest.cc ('k') | net/spdy/spdy_http_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef NET_SPDY_SPDY_HTTP_STREAM_H_ 5 #ifndef NET_SPDY_SPDY_HTTP_STREAM_H_
6 #define NET_SPDY_SPDY_HTTP_STREAM_H_ 6 #define NET_SPDY_SPDY_HTTP_STREAM_H_
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 13 matching lines...) Expand all
24 class HttpResponseInfo; 24 class HttpResponseInfo;
25 class IOBuffer; 25 class IOBuffer;
26 class SpdySession; 26 class SpdySession;
27 class UploadDataStream; 27 class UploadDataStream;
28 28
29 // The SpdyHttpStream is a HTTP-specific type of stream known to a SpdySession. 29 // The SpdyHttpStream is a HTTP-specific type of stream known to a SpdySession.
30 class NET_EXPORT_PRIVATE SpdyHttpStream : public SpdyStream::Delegate, 30 class NET_EXPORT_PRIVATE SpdyHttpStream : public SpdyStream::Delegate,
31 public HttpStream { 31 public HttpStream {
32 public: 32 public:
33 // |spdy_session| must not be NULL. 33 // |spdy_session| must not be NULL.
34 SpdyHttpStream(SpdySession* spdy_session, bool direct); 34 SpdyHttpStream(const base::WeakPtr<SpdySession>& spdy_session, bool direct);
35 virtual ~SpdyHttpStream(); 35 virtual ~SpdyHttpStream();
36 36
37 SpdyStream* stream() { return stream_.get(); } 37 SpdyStream* stream() { return stream_.get(); }
38 38
39 // Cancels any callbacks from being invoked and deletes the stream. 39 // Cancels any callbacks from being invoked and deletes the stream.
40 void Cancel(); 40 void Cancel();
41 41
42 // HttpStream implementation. 42 // HttpStream implementation.
43 43
44 virtual int InitializeStream(const HttpRequestInfo* request_info, 44 virtual int InitializeStream(const HttpRequestInfo* request_info,
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 void DoCallback(int rv); 102 void DoCallback(int rv);
103 103
104 void ScheduleBufferedReadCallback(); 104 void ScheduleBufferedReadCallback();
105 105
106 // Returns true if the callback is invoked. 106 // Returns true if the callback is invoked.
107 bool DoBufferedReadCallback(); 107 bool DoBufferedReadCallback();
108 bool ShouldWaitForMoreBufferedData() const; 108 bool ShouldWaitForMoreBufferedData() const;
109 109
110 base::WeakPtrFactory<SpdyHttpStream> weak_factory_; 110 base::WeakPtrFactory<SpdyHttpStream> weak_factory_;
111 111
112 const scoped_refptr<SpdySession> spdy_session_; 112 const base::WeakPtr<SpdySession> spdy_session_;
113 bool is_reused_;
113 SpdyStreamRequest stream_request_; 114 SpdyStreamRequest stream_request_;
114 base::WeakPtr<SpdyStream> stream_; 115 base::WeakPtr<SpdyStream> stream_;
115 116
116 bool stream_closed_; 117 bool stream_closed_;
117 118
118 // Set only when |stream_closed_| is true. 119 // Set only when |stream_closed_| is true.
119 int closed_stream_status_; 120 int closed_stream_status_;
120 SpdyStreamId closed_stream_id_; 121 SpdyStreamId closed_stream_id_;
122 bool closed_stream_has_load_timing_info_;
123 LoadTimingInfo closed_stream_load_timing_info_;
121 124
122 // The request to send. 125 // The request to send.
123 const HttpRequestInfo* request_info_; 126 const HttpRequestInfo* request_info_;
124 127
125 // |response_info_| is the HTTP response data object which is filled in 128 // |response_info_| is the HTTP response data object which is filled in
126 // when a SYN_REPLY comes in for the stream. 129 // when a SYN_REPLY comes in for the stream.
127 // It is not owned by this stream object, or point to |push_response_info_|. 130 // It is not owned by this stream object, or point to |push_response_info_|.
128 HttpResponseInfo* response_info_; 131 HttpResponseInfo* response_info_;
129 132
130 scoped_ptr<HttpResponseInfo> push_response_info_; 133 scoped_ptr<HttpResponseInfo> push_response_info_;
(...skipping 23 matching lines...) Expand all
154 157
155 // Is this spdy stream direct to the origin server (or to a proxy). 158 // Is this spdy stream direct to the origin server (or to a proxy).
156 bool direct_; 159 bool direct_;
157 160
158 DISALLOW_COPY_AND_ASSIGN(SpdyHttpStream); 161 DISALLOW_COPY_AND_ASSIGN(SpdyHttpStream);
159 }; 162 };
160 163
161 } // namespace net 164 } // namespace net
162 165
163 #endif // NET_SPDY_SPDY_HTTP_STREAM_H_ 166 #endif // NET_SPDY_SPDY_HTTP_STREAM_H_
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket_pool_unittest.cc ('k') | net/spdy/spdy_http_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698