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

Side by Side Diff: net/spdy/spdy_framer.h

Issue 1263803002: Replace SpdyNameValueBlock typedef with SpdyHeaderBlock. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « net/spdy/hpack_round_trip_test.cc ('k') | net/spdy/spdy_framer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_SPDY_SPDY_FRAMER_H_ 5 #ifndef NET_SPDY_SPDY_FRAMER_H_
6 #define NET_SPDY_SPDY_FRAMER_H_ 6 #define NET_SPDY_SPDY_FRAMER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 class SpdyFramer; 42 class SpdyFramer;
43 class SpdyFrameBuilder; 43 class SpdyFrameBuilder;
44 44
45 namespace test { 45 namespace test {
46 46
47 class TestSpdyVisitor; 47 class TestSpdyVisitor;
48 class SpdyFramerPeer; 48 class SpdyFramerPeer;
49 49
50 } // namespace test 50 } // namespace test
51 51
52 // A datastructure for holding a set of headers from a HEADERS, PUSH_PROMISE,
53 // SYN_STREAM, or SYN_REPLY frame.
54 typedef std::map<std::string, std::string> SpdyHeaderBlock;
55
56 // A datastructure for holding the ID and flag fields for SETTINGS. 52 // A datastructure for holding the ID and flag fields for SETTINGS.
57 // Conveniently handles converstion to/from wire format. 53 // Conveniently handles converstion to/from wire format.
58 class NET_EXPORT_PRIVATE SettingsFlagsAndId { 54 class NET_EXPORT_PRIVATE SettingsFlagsAndId {
59 public: 55 public:
60 static SettingsFlagsAndId FromWireFormat(SpdyMajorVersion version, 56 static SettingsFlagsAndId FromWireFormat(SpdyMajorVersion version,
61 uint32 wire); 57 uint32 wire);
62 58
63 SettingsFlagsAndId() : flags_(0), id_(0) {} 59 SettingsFlagsAndId() : flags_(0), id_(0) {}
64 60
65 // TODO(hkhalil): restrict to enums instead of free-form ints. 61 // TODO(hkhalil): restrict to enums instead of free-form ints.
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 // data (pointer and length). Returns the number of bytes 665 // data (pointer and length). Returns the number of bytes
670 // read, and: 666 // read, and:
671 // *data is advanced the number of bytes read. 667 // *data is advanced the number of bytes read.
672 // *len is reduced by the number of bytes read. 668 // *len is reduced by the number of bytes read.
673 size_t UpdateCurrentFrameBuffer(const char** data, size_t* len, 669 size_t UpdateCurrentFrameBuffer(const char** data, size_t* len,
674 size_t max_bytes); 670 size_t max_bytes);
675 671
676 void WriteHeaderBlockToZ(const SpdyHeaderBlock* headers, 672 void WriteHeaderBlockToZ(const SpdyHeaderBlock* headers,
677 z_stream* out) const; 673 z_stream* out) const;
678 674
679 void SerializeNameValueBlockWithoutCompression( 675 void SerializeHeaderBlockWithoutCompression(
680 SpdyFrameBuilder* builder, 676 SpdyFrameBuilder* builder,
681 const SpdyNameValueBlock& name_value_block) const; 677 const SpdyHeaderBlock& header_block) const;
682 678
683 // Compresses automatically according to enable_compression_. 679 // Compresses automatically according to enable_compression_.
684 void SerializeNameValueBlock( 680 void SerializeHeaderBlock(SpdyFrameBuilder* builder,
685 SpdyFrameBuilder* builder, 681 const SpdyFrameWithHeaderBlockIR& frame);
686 const SpdyFrameWithNameValueBlockIR& frame);
687 682
688 // Set the error code and moves the framer into the error state. 683 // Set the error code and moves the framer into the error state.
689 void set_error(SpdyError error); 684 void set_error(SpdyError error);
690 685
691 // The size of the control frame buffer. 686 // The size of the control frame buffer.
692 // Since this is only used for control frame headers, the maximum control 687 // Since this is only used for control frame headers, the maximum control
693 // frame header size (SYN_STREAM) is sufficient; all remaining control 688 // frame header size (SYN_STREAM) is sufficient; all remaining control
694 // frame data is streamed to the visitor. 689 // frame data is streamed to the visitor.
695 static const size_t kControlFrameBufferSize; 690 static const size_t kControlFrameBufferSize;
696 691
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 // processed. 780 // processed.
786 bool end_stream_when_done_; 781 bool end_stream_when_done_;
787 782
788 // Last acknowledged value for SETTINGS_HEADER_TABLE_SIZE. 783 // Last acknowledged value for SETTINGS_HEADER_TABLE_SIZE.
789 size_t header_table_size_bound_; 784 size_t header_table_size_bound_;
790 }; 785 };
791 786
792 } // namespace net 787 } // namespace net
793 788
794 #endif // NET_SPDY_SPDY_FRAMER_H_ 789 #endif // NET_SPDY_SPDY_FRAMER_H_
OLDNEW
« no previous file with comments | « net/spdy/hpack_round_trip_test.cc ('k') | net/spdy/spdy_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698