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

Unified Diff: net/spdy/spdy_protocol.h

Issue 1141473003: Pass StringPiece by value instead of const ref in SpdyFramer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | net/spdy/spdy_protocol.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_protocol.h
diff --git a/net/spdy/spdy_protocol.h b/net/spdy/spdy_protocol.h
index 1837feb2c87150e84980dcb5a8fe0417b5450e7d..b8fa93caf682fad0c3352f11de91b04558425f5b 100644
--- a/net/spdy/spdy_protocol.h
+++ b/net/spdy/spdy_protocol.h
@@ -614,8 +614,7 @@ class NET_EXPORT_PRIVATE SpdyFrameWithNameValueBlockIR
// Deep copy.
name_value_block_ = name_value_block;
}
- void SetHeader(const base::StringPiece& name,
- const base::StringPiece& value) {
+ void SetHeader(base::StringPiece name, base::StringPiece value) {
name_value_block_[name.as_string()] = value.as_string();
}
SpdyNameValueBlock* mutable_name_value_block() {
@@ -636,7 +635,7 @@ class NET_EXPORT_PRIVATE SpdyDataIR
: public NON_EXPORTED_BASE(SpdyFrameWithFinIR) {
public:
// Performs deep copy on data.
- SpdyDataIR(SpdyStreamId stream_id, const base::StringPiece& data);
+ SpdyDataIR(SpdyStreamId stream_id, base::StringPiece data);
// Use in conjunction with SetDataShallow() for shallow-copy on data.
explicit SpdyDataIR(SpdyStreamId stream_id);
@@ -658,13 +657,13 @@ class NET_EXPORT_PRIVATE SpdyDataIR
}
// Deep-copy of data (keep private copy).
- void SetDataDeep(const base::StringPiece& data) {
+ void SetDataDeep(base::StringPiece data) {
data_store_.reset(new std::string(data.data(), data.length()));
data_ = *(data_store_.get());
}
// Shallow-copy of data (do not keep private copy).
- void SetDataShallow(const base::StringPiece& data) {
+ void SetDataShallow(base::StringPiece data) {
data_store_.reset();
data_ = data;
}
@@ -814,8 +813,9 @@ class NET_EXPORT_PRIVATE SpdyPingIR : public SpdyFrameIR {
class NET_EXPORT_PRIVATE SpdyGoAwayIR : public SpdyFrameIR {
public:
- SpdyGoAwayIR(SpdyStreamId last_good_stream_id, SpdyGoAwayStatus status,
- const base::StringPiece& description);
+ SpdyGoAwayIR(SpdyStreamId last_good_stream_id,
+ SpdyGoAwayStatus status,
+ base::StringPiece description);
~SpdyGoAwayIR() override;
SpdyStreamId last_good_stream_id() const { return last_good_stream_id_; }
void set_last_good_stream_id(SpdyStreamId last_good_stream_id) {
« no previous file with comments | « no previous file | net/spdy/spdy_protocol.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698