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

Unified Diff: net/spdy/spdy_alt_svc_wire_format.h

Issue 1171183002: Use struct AlternativeService in OnAltSvc() and OnSpdyAltSvc() methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/spdy/mock_spdy_framer_visitor.h ('k') | net/spdy/spdy_alt_svc_wire_format.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_alt_svc_wire_format.h
diff --git a/net/spdy/spdy_alt_svc_wire_format.h b/net/spdy/spdy_alt_svc_wire_format.h
index eb79f8afa60d3829c37a7cf25784d3adb9a0a762..b86141f37ed4809c84a34bdd4526b13c6fd4fd72 100644
--- a/net/spdy/spdy_alt_svc_wire_format.h
+++ b/net/spdy/spdy_alt_svc_wire_format.h
@@ -24,18 +24,24 @@ class SpdyAltSvcWireFormatPeer;
class NET_EXPORT_PRIVATE SpdyAltSvcWireFormat {
public:
+ struct AlternativeService {
+ std::string protocol_id;
+ std::string host;
+ uint16 port = 0;
+ uint32 max_age = 0;
+ double p = 1.0;
+
+ bool operator==(const AlternativeService& other) const {
+ return protocol_id == other.protocol_id && host == other.host &&
+ port == other.port && max_age == other.max_age && p == other.p;
+ }
+ };
+
friend class test::SpdyAltSvcWireFormatPeer;
static bool ParseHeaderFieldValue(StringPiece value,
- std::string* protocol_id,
- std::string* host,
- uint16* port,
- uint32* max_age,
- double* p);
- static std::string SerializeHeaderFieldValue(const std::string& protocol_id,
- const std::string& host,
- uint16 port,
- uint32 max_age,
- double p);
+ AlternativeService* altsvc);
+ static std::string SerializeHeaderFieldValue(
+ const AlternativeService& altsvc);
private:
static void SkipWhiteSpace(StringPiece::const_iterator* c,
« no previous file with comments | « net/spdy/mock_spdy_framer_visitor.h ('k') | net/spdy/spdy_alt_svc_wire_format.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698