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

Unified Diff: net/spdy/spdy_framer.cc

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/spdy_framer.h ('k') | net/spdy/spdy_framer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_framer.cc
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc
index e0dd61d055467c1a12555eb9a88266c9652a923e..44e919746acd91668ccbe8024db1a2b42288083c 100644
--- a/net/spdy/spdy_framer.cc
+++ b/net/spdy/spdy_framer.cc
@@ -11,7 +11,6 @@
#include "base/lazy_instance.h"
#include "base/memory/scoped_ptr.h"
#include "base/third_party/valgrind/memcheck.h"
-#include "net/spdy/spdy_alt_svc_wire_format.h"
#include "net/spdy/spdy_frame_builder.h"
#include "net/spdy/spdy_frame_reader.h"
#include "net/spdy/spdy_bitmasks.h"
@@ -2057,21 +2056,14 @@ size_t SpdyFramer::ProcessAltSvcFramePayload(const char* data, size_t len) {
StringPiece value(altsvc_scratch_.buffer.get() + reader.GetBytesConsumed(),
altsvc_scratch_.buffer_length - reader.GetBytesConsumed());
- string protocol_id;
- string host;
- uint16 port;
- uint32 max_age;
- double p;
- bool success = SpdyAltSvcWireFormat::ParseHeaderFieldValue(
- value, &protocol_id, &host, &port, &max_age, &p);
- if (!success || protocol_id.length() == 0) {
+ SpdyAltSvcWireFormat::AlternativeService altsvc;
+ bool success = SpdyAltSvcWireFormat::ParseHeaderFieldValue(value, &altsvc);
+ if (!success || altsvc.protocol_id.length() == 0) {
set_error(SPDY_INVALID_CONTROL_FRAME);
return 0;
}
- // TODO(bnc): Pass on |p|.
- visitor_->OnAltSvc(current_frame_stream_id_, max_age, port, protocol_id, host,
- origin);
+ visitor_->OnAltSvc(current_frame_stream_id_, origin, altsvc);
CHANGE_STATE(SPDY_AUTO_RESET);
return len;
}
@@ -2777,10 +2769,8 @@ SpdyFrame* SpdyFramer::SerializeAltSvc(const SpdyAltSvcIR& altsvc) {
size_t size = GetAltSvcMinimumSize();
size += altsvc.origin().length();
- // TODO(bnc): Add probability to SpdyAltSvcIR and pass it on.
- string value = SpdyAltSvcWireFormat::SerializeHeaderFieldValue(
- altsvc.protocol_id(), altsvc.host(), altsvc.port(), altsvc.max_age(),
- 1.0);
+ string value =
+ SpdyAltSvcWireFormat::SerializeHeaderFieldValue(altsvc.altsvc());
size += value.length();
SpdyFrameBuilder builder(size, protocol_version());
« no previous file with comments | « net/spdy/spdy_framer.h ('k') | net/spdy/spdy_framer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698