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

Unified Diff: net/quic/quic_spdy_stream.cc

Issue 2100213002: Make QuicSpdyStream::ParseHeaderStatusCode() inparam const. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_spdy_stream.h ('k') | net/quic/quic_spdy_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_spdy_stream.cc
diff --git a/net/quic/quic_spdy_stream.cc b/net/quic/quic_spdy_stream.cc
index f1a21d4e8dc568c295117ecb3c7bbceecab0e2f3..ac09e9f8e7e812cd7beb5a7c22614d6bbc5a7704 100644
--- a/net/quic/quic_spdy_stream.cc
+++ b/net/quic/quic_spdy_stream.cc
@@ -12,8 +12,8 @@
#include "net/quic/quic_write_blocked_list.h"
#include "net/quic/spdy_utils.h"
+using base::IntToString;
using base::StringPiece;
-using net::SpdyPriority;
using std::min;
using std::string;
@@ -101,9 +101,9 @@ size_t QuicSpdyStream::WriteTrailers(
DVLOG(1) << "Inserting trailer: (" << kFinalOffsetHeaderKey << ", "
<< stream_bytes_written() + queued_data_bytes() << ")";
SpdyHeaderBlock trailer_block_with_offset(trailer_block);
- trailer_block_with_offset.insert(std::make_pair(
- kFinalOffsetHeaderKey,
- base::IntToString(stream_bytes_written() + queued_data_bytes())));
+ trailer_block_with_offset.insert(
+ std::make_pair(kFinalOffsetHeaderKey,
+ IntToString(stream_bytes_written() + queued_data_bytes())));
// Write the trailing headers with a FIN, and close stream for writing:
// trailers are the last thing to be sent on a stream.
@@ -361,9 +361,13 @@ bool QuicSpdyStream::FinishedReadingHeaders() const {
header_list_.empty();
}
-bool QuicSpdyStream::ParseHeaderStatusCode(SpdyHeaderBlock* header,
+bool QuicSpdyStream::ParseHeaderStatusCode(const SpdyHeaderBlock& header,
int* status_code) const {
- StringPiece status = (*header)[":status"];
+ SpdyHeaderBlock::const_iterator it = header.find(":status");
+ if (it == header.end()) {
+ return false;
+ }
+ const StringPiece status(it->second);
if (status.size() != 3) {
return false;
}
« no previous file with comments | « net/quic/quic_spdy_stream.h ('k') | net/quic/quic_spdy_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698