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

Side by Side Diff: net/spdy/spdy_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/spdy/spdy_session_unittest.cc ('k') | net/spdy/spdy_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_STREAM_H_ 5 #ifndef NET_SPDY_SPDY_STREAM_H_
6 #define NET_SPDY_SPDY_STREAM_H_ 6 #define NET_SPDY_SPDY_STREAM_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 protected: 151 protected:
152 virtual ~Delegate() {} 152 virtual ~Delegate() {}
153 153
154 private: 154 private:
155 DISALLOW_COPY_AND_ASSIGN(Delegate); 155 DISALLOW_COPY_AND_ASSIGN(Delegate);
156 }; 156 };
157 157
158 // SpdyStream constructor 158 // SpdyStream constructor
159 SpdyStream(SpdyStreamType type, 159 SpdyStream(SpdyStreamType type,
160 SpdySession* session, 160 const base::WeakPtr<SpdySession>& session,
161 const GURL& url, 161 const GURL& url,
162 RequestPriority priority, 162 RequestPriority priority,
163 int32 initial_send_window_size, 163 int32 initial_send_window_size,
164 int32 initial_recv_window_size, 164 int32 initial_recv_window_size,
165 const BoundNetLog& net_log); 165 const BoundNetLog& net_log);
166 166
167 ~SpdyStream(); 167 ~SpdyStream();
168 168
169 // Set the delegate, which must not be NULL. Must not be called more 169 // Set the delegate, which must not be NULL. Must not be called more
170 // than once. For push streams, calling this may cause buffered data 170 // than once. For push streams, calling this may cause buffered data
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 void LogStreamError(int status, const std::string& description); 327 void LogStreamError(int status, const std::string& description);
328 328
329 // If this stream is active, reset it, and close it otherwise. In 329 // If this stream is active, reset it, and close it otherwise. In
330 // either case the stream is deleted. 330 // either case the stream is deleted.
331 void Cancel(); 331 void Cancel();
332 332
333 // Close this stream without sending a RST_STREAM and delete 333 // Close this stream without sending a RST_STREAM and delete
334 // it. 334 // it.
335 void Close(); 335 void Close();
336 336
337 // Must be used only by the SpdySession. 337 // Must be used only by |session_|.
338 base::WeakPtr<SpdyStream> GetWeakPtr(); 338 base::WeakPtr<SpdyStream> GetWeakPtr();
339 339
340 // Interface for the delegate to use. 340 // Interface for the delegate to use.
341 341
342 // Only one send can be in flight at a time, except for push 342 // Only one send can be in flight at a time, except for push
343 // streams, which must not send anything. 343 // streams, which must not send anything.
344 344
345 // Sends the request headers. The delegate is called back via 345 // Sends the request headers. The delegate is called back via
346 // OnRequestHeadersSent() when the request headers have completed 346 // OnRequestHeadersSent() when the request headers have completed
347 // sending. |send_status| must be MORE_DATA_TO_SEND for 347 // sending. |send_status| must be MORE_DATA_TO_SEND for
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 size_t slot_; 483 size_t slot_;
484 484
485 // Flow control variables. 485 // Flow control variables.
486 bool send_stalled_by_flow_control_; 486 bool send_stalled_by_flow_control_;
487 int32 send_window_size_; 487 int32 send_window_size_;
488 int32 recv_window_size_; 488 int32 recv_window_size_;
489 int32 unacked_recv_window_bytes_; 489 int32 unacked_recv_window_bytes_;
490 490
491 ScopedBandwidthMetrics metrics_; 491 ScopedBandwidthMetrics metrics_;
492 492
493 scoped_refptr<SpdySession> session_; 493 const base::WeakPtr<SpdySession> session_;
494 494
495 // The transaction should own the delegate. 495 // The transaction should own the delegate.
496 SpdyStream::Delegate* delegate_; 496 SpdyStream::Delegate* delegate_;
497 497
498 // Whether or not we have more data to send on this stream. 498 // Whether or not we have more data to send on this stream.
499 SpdySendStatus send_status_; 499 SpdySendStatus send_status_;
500 500
501 // The headers for the request to send. 501 // The headers for the request to send.
502 // 502 //
503 // TODO(akalin): Hang onto this only until we send it. This 503 // TODO(akalin): Hang onto this only until we send it. This
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 // When OnFrameWriteComplete() is called, these variables are set. 543 // When OnFrameWriteComplete() is called, these variables are set.
544 SpdyFrameType just_completed_frame_type_; 544 SpdyFrameType just_completed_frame_type_;
545 size_t just_completed_frame_size_; 545 size_t just_completed_frame_size_;
546 546
547 DISALLOW_COPY_AND_ASSIGN(SpdyStream); 547 DISALLOW_COPY_AND_ASSIGN(SpdyStream);
548 }; 548 };
549 549
550 } // namespace net 550 } // namespace net
551 551
552 #endif // NET_SPDY_SPDY_STREAM_H_ 552 #endif // NET_SPDY_SPDY_STREAM_H_
OLDNEW
« no previous file with comments | « net/spdy/spdy_session_unittest.cc ('k') | net/spdy/spdy_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698