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

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

Issue 485833002: HTTP2 draft 14 support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add ignore_result(). Created 6 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/socket/ssl_client_socket.cc ('k') | net/spdy/buffered_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_BUFFERED_SPDY_FRAMER_H_ 5 #ifndef NET_SPDY_BUFFERED_SPDY_FRAMER_H_
6 #define NET_SPDY_BUFFERED_SPDY_FRAMER_H_ 6 #define NET_SPDY_BUFFERED_SPDY_FRAMER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 virtual void OnSettings(bool clear_persisted) = 0; 74 virtual void OnSettings(bool clear_persisted) = 0;
75 75
76 // Called when an individual setting within a SETTINGS frame has been parsed 76 // Called when an individual setting within a SETTINGS frame has been parsed
77 // and validated. 77 // and validated.
78 virtual void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) = 0; 78 virtual void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) = 0;
79 79
80 // Called when a SETTINGS frame is received with the ACK flag set. 80 // Called when a SETTINGS frame is received with the ACK flag set.
81 virtual void OnSettingsAck() {} 81 virtual void OnSettingsAck() {}
82 82
83 // Called at the completion of parsing SETTINGS id and value tuples. 83 // Called at the completion of parsing SETTINGS id and value tuples.
84 virtual void OnSettingsEnd() {}; 84 virtual void OnSettingsEnd() {}
85 85
86 // Called when a PING frame has been parsed. 86 // Called when a PING frame has been parsed.
87 virtual void OnPing(SpdyPingId unique_id, bool is_ack) = 0; 87 virtual void OnPing(SpdyPingId unique_id, bool is_ack) = 0;
88 88
89 // Called when a RST_STREAM frame has been parsed. 89 // Called when a RST_STREAM frame has been parsed.
90 virtual void OnRstStream(SpdyStreamId stream_id, 90 virtual void OnRstStream(SpdyStreamId stream_id,
91 SpdyRstStreamStatus status) = 0; 91 SpdyRstStreamStatus status) = 0;
92 92
93 // Called when a GOAWAY frame has been parsed. 93 // Called when a GOAWAY frame has been parsed.
94 virtual void OnGoAway(SpdyStreamId last_accepted_stream_id, 94 virtual void OnGoAway(SpdyStreamId last_accepted_stream_id,
95 SpdyGoAwayStatus status) = 0; 95 SpdyGoAwayStatus status) = 0;
96 96
97 // Called when a WINDOW_UPDATE frame has been parsed. 97 // Called when a WINDOW_UPDATE frame has been parsed.
98 virtual void OnWindowUpdate(SpdyStreamId stream_id, 98 virtual void OnWindowUpdate(SpdyStreamId stream_id,
99 uint32 delta_window_size) = 0; 99 uint32 delta_window_size) = 0;
100 100
101 // Called when a PUSH_PROMISE frame has been parsed. 101 // Called when a PUSH_PROMISE frame has been parsed.
102 virtual void OnPushPromise(SpdyStreamId stream_id, 102 virtual void OnPushPromise(SpdyStreamId stream_id,
103 SpdyStreamId promised_stream_id, 103 SpdyStreamId promised_stream_id,
104 const SpdyHeaderBlock& headers) = 0; 104 const SpdyHeaderBlock& headers) = 0;
105 105
106 // Called when a frame type we don't recognize is received.
107 // Return true if this appears to be a valid extension frame, false otherwise.
108 // We distinguish between extension frames and nonsense by checking
109 // whether the stream id is valid.
110 virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) = 0;
111
106 protected: 112 protected:
107 virtual ~BufferedSpdyFramerVisitorInterface() {} 113 virtual ~BufferedSpdyFramerVisitorInterface() {}
108 114
109 private: 115 private:
110 DISALLOW_COPY_AND_ASSIGN(BufferedSpdyFramerVisitorInterface); 116 DISALLOW_COPY_AND_ASSIGN(BufferedSpdyFramerVisitorInterface);
111 }; 117 };
112 118
113 class NET_EXPORT_PRIVATE BufferedSpdyFramer 119 class NET_EXPORT_PRIVATE BufferedSpdyFramer
114 : public SpdyFramerVisitorInterface { 120 : public SpdyFramerVisitorInterface {
115 public: 121 public:
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 SpdyGoAwayStatus status) OVERRIDE; 162 SpdyGoAwayStatus status) OVERRIDE;
157 virtual void OnWindowUpdate(SpdyStreamId stream_id, 163 virtual void OnWindowUpdate(SpdyStreamId stream_id,
158 uint32 delta_window_size) OVERRIDE; 164 uint32 delta_window_size) OVERRIDE;
159 virtual void OnPushPromise(SpdyStreamId stream_id, 165 virtual void OnPushPromise(SpdyStreamId stream_id,
160 SpdyStreamId promised_stream_id, 166 SpdyStreamId promised_stream_id,
161 bool end) OVERRIDE; 167 bool end) OVERRIDE;
162 virtual void OnDataFrameHeader(SpdyStreamId stream_id, 168 virtual void OnDataFrameHeader(SpdyStreamId stream_id,
163 size_t length, 169 size_t length,
164 bool fin) OVERRIDE; 170 bool fin) OVERRIDE;
165 virtual void OnContinuation(SpdyStreamId stream_id, bool end) OVERRIDE; 171 virtual void OnContinuation(SpdyStreamId stream_id, bool end) OVERRIDE;
172 virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) OVERRIDE;
166 173
167 // SpdyFramer methods. 174 // SpdyFramer methods.
168 size_t ProcessInput(const char* data, size_t len); 175 size_t ProcessInput(const char* data, size_t len);
169 SpdyMajorVersion protocol_version(); 176 SpdyMajorVersion protocol_version();
170 void Reset(); 177 void Reset();
171 SpdyFramer::SpdyError error_code() const; 178 SpdyFramer::SpdyError error_code() const;
172 SpdyFramer::SpdyState state() const; 179 SpdyFramer::SpdyState state() const;
173 bool MessageFullyRead(); 180 bool MessageFullyRead();
174 bool HasError(); 181 bool HasError();
175 SpdyFrame* CreateSynStream(SpdyStreamId stream_id, 182 SpdyFrame* CreateSynStream(SpdyStreamId stream_id,
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 bool unidirectional; 270 bool unidirectional;
264 }; 271 };
265 scoped_ptr<ControlFrameFields> control_frame_fields_; 272 scoped_ptr<ControlFrameFields> control_frame_fields_;
266 273
267 DISALLOW_COPY_AND_ASSIGN(BufferedSpdyFramer); 274 DISALLOW_COPY_AND_ASSIGN(BufferedSpdyFramer);
268 }; 275 };
269 276
270 } // namespace net 277 } // namespace net
271 278
272 #endif // NET_SPDY_BUFFERED_SPDY_FRAMER_H_ 279 #endif // NET_SPDY_BUFFERED_SPDY_FRAMER_H_
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket.cc ('k') | net/spdy/buffered_spdy_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698