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

Unified Diff: net/spdy/spdy_protocol.cc

Issue 2400463002: Eliminate use of StringPiece(nullptr, n) with non zero n. (Closed)
Patch Set: Created 4 years, 2 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/spdy/spdy_protocol.h ('k') | net/spdy/spdy_protocol_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_protocol.cc
diff --git a/net/spdy/spdy_protocol.cc b/net/spdy/spdy_protocol.cc
index 3dbbfde9e6df3e77612055c95ff7964e6b94a836..e8dd952fcbca8075e5354f734db086788f71728f 100644
--- a/net/spdy/spdy_protocol.cc
+++ b/net/spdy/spdy_protocol.cc
@@ -750,7 +750,11 @@ SpdyFrameWithHeaderBlockIR::SpdyFrameWithHeaderBlockIR(
SpdyFrameWithHeaderBlockIR::~SpdyFrameWithHeaderBlockIR() {}
SpdyDataIR::SpdyDataIR(SpdyStreamId stream_id, base::StringPiece data)
- : SpdyFrameWithFinIR(stream_id), padded_(false), padding_payload_len_(0) {
+ : SpdyFrameWithFinIR(stream_id),
+ data_(nullptr),
+ data_len_(0),
+ padded_(false),
+ padding_payload_len_(0) {
SetDataDeep(data);
}
@@ -760,12 +764,17 @@ SpdyDataIR::SpdyDataIR(SpdyStreamId stream_id, const char* data)
SpdyDataIR::SpdyDataIR(SpdyStreamId stream_id, std::string data)
: SpdyFrameWithFinIR(stream_id),
data_store_(base::MakeUnique<std::string>(std::move(data))),
- data_(*data_store_),
+ data_(data_store_->data()),
+ data_len_(data_store_->size()),
padded_(false),
padding_payload_len_(0) {}
SpdyDataIR::SpdyDataIR(SpdyStreamId stream_id)
- : SpdyFrameWithFinIR(stream_id), padded_(false), padding_payload_len_(0) {}
+ : SpdyFrameWithFinIR(stream_id),
+ data_(nullptr),
+ data_len_(0),
+ padded_(false),
+ padding_payload_len_(0) {}
SpdyDataIR::~SpdyDataIR() {}
« no previous file with comments | « net/spdy/spdy_protocol.h ('k') | net/spdy/spdy_protocol_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698