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

Unified Diff: net/quic/core/quic_stream.cc

Issue 2580393003: Replace QuicAckListenerInterface* with scoped_refptr<QuicAckListenerInterface>. (Closed)
Patch Set: Created 4 years 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/quic/core/quic_stream.h ('k') | net/quic/core/quic_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_stream.cc
diff --git a/net/quic/core/quic_stream.cc b/net/quic/core/quic_stream.cc
index 651a9906dd445c3e5a078a277cec0337c23fc234..766d0e06fc41e6cbd1588c7351da9e62c1fc9b4e 100644
--- a/net/quic/core/quic_stream.cc
+++ b/net/quic/core/quic_stream.cc
@@ -41,9 +41,12 @@ size_t GetReceivedFlowControlWindow(QuicSession* session) {
} // namespace
-QuicStream::PendingData::PendingData(string data_in,
- QuicAckListenerInterface* ack_listener_in)
- : data(std::move(data_in)), offset(0), ack_listener(ack_listener_in) {}
+QuicStream::PendingData::PendingData(
+ string data_in,
+ scoped_refptr<QuicAckListenerInterface> ack_listener_in)
+ : data(std::move(data_in)),
+ offset(0),
+ ack_listener(std::move(ack_listener_in)) {}
QuicStream::PendingData::~PendingData() {}
@@ -176,9 +179,10 @@ void QuicStream::CloseConnectionWithDetails(QuicErrorCode error,
error, details, ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
}
-void QuicStream::WriteOrBufferData(StringPiece data,
- bool fin,
- QuicAckListenerInterface* ack_listener) {
+void QuicStream::WriteOrBufferData(
+ StringPiece data,
+ bool fin,
+ const scoped_refptr<QuicAckListenerInterface>& ack_listener) {
if (data.empty() && !fin) {
QUIC_BUG << "data.empty() && !fin";
return;
@@ -215,7 +219,8 @@ void QuicStream::OnCanWrite() {
bool fin = false;
while (!queued_data_.empty()) {
PendingData* pending_data = &queued_data_.front();
- QuicAckListenerInterface* ack_listener = pending_data->ack_listener.get();
+ const scoped_refptr<QuicAckListenerInterface>& ack_listener =
+ pending_data->ack_listener;
if (queued_data_.size() == 1 && fin_buffered_) {
fin = true;
}
@@ -265,7 +270,7 @@ QuicConsumedData QuicStream::WritevData(
const struct iovec* iov,
int iov_count,
bool fin,
- QuicAckListenerInterface* ack_listener) {
+ const scoped_refptr<QuicAckListenerInterface>& ack_listener) {
if (write_side_closed_) {
DLOG(ERROR) << ENDPOINT << "Attempt to write when the write side is closed";
return QuicConsumedData(0, false);
@@ -346,7 +351,7 @@ QuicConsumedData QuicStream::WritevDataInner(
QuicIOVector iov,
QuicStreamOffset offset,
bool fin,
- QuicAckListenerInterface* ack_notifier_delegate) {
+ const scoped_refptr<QuicAckListenerInterface>& ack_notifier_delegate) {
return session()->WritevData(this, id(), iov, offset, fin,
ack_notifier_delegate);
}
« no previous file with comments | « net/quic/core/quic_stream.h ('k') | net/quic/core/quic_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698