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

Unified Diff: net/quic/quic_headers_stream.cc

Issue 1009543004: Create a Perspective enum to use instead of a bool is_server to improve (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added NET_EXPORT_PRIVATE to fix compiler error Created 5 years, 9 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_framer_test.cc ('k') | net/quic/quic_headers_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_headers_stream.cc
diff --git a/net/quic/quic_headers_stream.cc b/net/quic/quic_headers_stream.cc
index b40142db16605874f568b555e1d94f0dfe3643b9..435267b7d67e7c76524bb80e14c8e055faf0b9f3 100644
--- a/net/quic/quic_headers_stream.cc
+++ b/net/quic/quic_headers_stream.cc
@@ -222,7 +222,7 @@ size_t QuicHeadersStream::WriteHeaders(
QuicAckNotifier::DelegateInterface* ack_notifier_delegate) {
scoped_ptr<SpdySerializedFrame> frame;
if (spdy_framer_->protocol_version() == SPDY3) {
- if (session()->is_server()) {
+ if (session()->perspective() == Perspective::IS_SERVER) {
SpdySynReplyIR syn_reply(stream_id);
syn_reply.set_name_value_block(headers);
syn_reply.set_fin(fin);
@@ -238,7 +238,7 @@ size_t QuicHeadersStream::WriteHeaders(
SpdyHeadersIR headers_frame(stream_id);
headers_frame.set_name_value_block(headers);
headers_frame.set_fin(fin);
- if (!session()->is_server()) {
+ if (session()->perspective() == Perspective::IS_CLIENT) {
headers_frame.set_has_priority(true);
headers_frame.set_priority(priority);
}
@@ -275,7 +275,7 @@ void QuicHeadersStream::InitializeFramer(QuicVersion version) {
void QuicHeadersStream::OnSynStream(SpdyStreamId stream_id,
SpdyPriority priority,
bool fin) {
- if (!session()->is_server()) {
+ if (session()->perspective() == Perspective::IS_CLIENT) {
CloseConnectionWithDetails(
QUIC_INVALID_HEADERS_STREAM_DATA,
"SPDY SYN_STREAM frame received at the client");
@@ -288,7 +288,7 @@ void QuicHeadersStream::OnSynStream(SpdyStreamId stream_id,
}
void QuicHeadersStream::OnSynReply(SpdyStreamId stream_id, bool fin) {
- if (session()->is_server()) {
+ if (session()->perspective() == Perspective::IS_SERVER) {
CloseConnectionWithDetails(
QUIC_INVALID_HEADERS_STREAM_DATA,
"SPDY SYN_REPLY frame received at the server");
« no previous file with comments | « net/quic/quic_framer_test.cc ('k') | net/quic/quic_headers_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698