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

Unified Diff: net/quic/quic_chromium_client_stream.cc

Issue 2102253003: Make SpdyHeaderBlock non-copyable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: iOS fix. Created 4 years, 6 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/quic/quic_chromium_client_stream.h ('k') | net/quic/quic_chromium_client_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_chromium_client_stream.cc
diff --git a/net/quic/quic_chromium_client_stream.cc b/net/quic/quic_chromium_client_stream.cc
index 9a0da07dde963110fa13578f59fadfac1ccecd48..e5cd4c337bdc05853fd519b0da5281e13c3cefe4 100644
--- a/net/quic/quic_chromium_client_stream.cc
+++ b/net/quic/quic_chromium_client_stream.cc
@@ -6,6 +6,7 @@
#include <utility>
+#include "base/bind_helpers.h"
#include "base/callback_helpers.h"
#include "base/location.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -42,7 +43,8 @@ void QuicChromiumClientStream::OnStreamHeadersComplete(bool fin,
if (decompressed_headers().empty() && !decompressed_trailers().empty()) {
DCHECK(trailers_decompressed());
// The delegate will read the trailers via a posted task.
- NotifyDelegateOfHeadersCompleteLater(received_trailers(), frame_len);
+ NotifyDelegateOfHeadersCompleteLater(received_trailers().Clone(),
+ frame_len);
} else {
DCHECK(!headers_delivered_);
SpdyHeaderBlock headers;
@@ -58,7 +60,7 @@ void QuicChromiumClientStream::OnStreamHeadersComplete(bool fin,
session_->OnInitialHeadersComplete(id(), headers);
// The delegate will read the headers via a posted task.
- NotifyDelegateOfHeadersCompleteLater(headers, frame_len);
+ NotifyDelegateOfHeadersCompleteLater(std::move(headers), frame_len);
}
}
@@ -81,7 +83,7 @@ void QuicChromiumClientStream::OnInitialHeadersComplete(
session_->OnInitialHeadersComplete(id(), header_block);
// The delegate will read the headers via a posted task.
- NotifyDelegateOfHeadersCompleteLater(header_block, frame_len);
+ NotifyDelegateOfHeadersCompleteLater(std::move(header_block), frame_len);
}
void QuicChromiumClientStream::OnTrailingHeadersComplete(
@@ -89,7 +91,7 @@ void QuicChromiumClientStream::OnTrailingHeadersComplete(
size_t frame_len,
const QuicHeaderList& header_list) {
QuicSpdyStream::OnTrailingHeadersComplete(fin, frame_len, header_list);
- NotifyDelegateOfHeadersCompleteLater(received_trailers(), frame_len);
+ NotifyDelegateOfHeadersCompleteLater(received_trailers().Clone(), frame_len);
}
void QuicChromiumClientStream::OnPromiseHeadersComplete(
@@ -245,11 +247,11 @@ bool QuicChromiumClientStream::CanWrite(const CompletionCallback& callback) {
}
void QuicChromiumClientStream::NotifyDelegateOfHeadersCompleteLater(
- const SpdyHeaderBlock& headers,
+ SpdyHeaderBlock headers,
size_t frame_len) {
- RunOrBuffer(
- base::Bind(&QuicChromiumClientStream::NotifyDelegateOfHeadersComplete,
- weak_factory_.GetWeakPtr(), headers, frame_len));
+ RunOrBuffer(base::Bind(
+ &QuicChromiumClientStream::NotifyDelegateOfHeadersComplete,
+ weak_factory_.GetWeakPtr(), base::Passed(std::move(headers)), frame_len));
}
void QuicChromiumClientStream::NotifyDelegateOfHeadersComplete(
« no previous file with comments | « net/quic/quic_chromium_client_stream.h ('k') | net/quic/quic_chromium_client_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698