OLD | NEW |
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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/memory/linked_ptr.h" | 13 #include "base/memory/linked_ptr.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "net/base/net_export.h" | 15 #include "net/base/net_export.h" |
16 #include "net/spdy/spdy_framer.h" | 16 #include "net/spdy/spdy_framer.h" |
17 #include "net/spdy/spdy_protocol.h" | 17 #include "net/spdy/spdy_protocol.h" |
18 | 18 |
19 namespace net { | 19 namespace net { |
20 | 20 |
21 class NET_EXPORT_PRIVATE BufferedSpdyFramerVisitorInterface { | 21 class NET_EXPORT_PRIVATE BufferedSpdyFramerVisitorInterface { |
22 public: | 22 public: |
23 BufferedSpdyFramerVisitorInterface() {} | 23 BufferedSpdyFramerVisitorInterface() {} |
24 virtual ~BufferedSpdyFramerVisitorInterface() {} | |
25 | 24 |
26 // Called if an error is detected in the SpdyFrame protocol. | 25 // Called if an error is detected in the SpdyFrame protocol. |
27 virtual void OnError(SpdyFramer::SpdyError error_code) = 0; | 26 virtual void OnError(SpdyFramer::SpdyError error_code) = 0; |
28 | 27 |
29 // Called if an error is detected in a SPDY stream. | 28 // Called if an error is detected in a SPDY stream. |
30 virtual void OnStreamError(SpdyStreamId stream_id, | 29 virtual void OnStreamError(SpdyStreamId stream_id, |
31 const std::string& description) = 0; | 30 const std::string& description) = 0; |
32 | 31 |
33 // Called after all the header data for SYN_STREAM control frame is received. | 32 // Called after all the header data for SYN_STREAM control frame is received. |
34 virtual void OnSynStream(const SpdySynStreamControlFrame& frame, | 33 virtual void OnSynStream(const SpdySynStreamControlFrame& frame, |
(...skipping 27 matching lines...) Expand all Loading... |
62 // When the other side has finished sending data on this stream, | 61 // When the other side has finished sending data on this stream, |
63 // this method will be called with a zero-length buffer. | 62 // this method will be called with a zero-length buffer. |
64 virtual void OnStreamFrameData(SpdyStreamId stream_id, | 63 virtual void OnStreamFrameData(SpdyStreamId stream_id, |
65 const char* data, | 64 const char* data, |
66 size_t len) = 0; | 65 size_t len) = 0; |
67 | 66 |
68 // Called when an individual setting within a SETTINGS frame has been parsed | 67 // Called when an individual setting within a SETTINGS frame has been parsed |
69 // and validated. | 68 // and validated. |
70 virtual void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) = 0; | 69 virtual void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) = 0; |
71 | 70 |
| 71 protected: |
| 72 virtual ~BufferedSpdyFramerVisitorInterface() {} |
| 73 |
72 private: | 74 private: |
73 DISALLOW_COPY_AND_ASSIGN(BufferedSpdyFramerVisitorInterface); | 75 DISALLOW_COPY_AND_ASSIGN(BufferedSpdyFramerVisitorInterface); |
74 }; | 76 }; |
75 | 77 |
76 class NET_EXPORT_PRIVATE BufferedSpdyFramer | 78 class NET_EXPORT_PRIVATE BufferedSpdyFramer |
77 : public SpdyFramerVisitorInterface { | 79 : public SpdyFramerVisitorInterface { |
78 public: | 80 public: |
79 explicit BufferedSpdyFramer(int version); | 81 explicit BufferedSpdyFramer(int version); |
80 virtual ~BufferedSpdyFramer(); | 82 virtual ~BufferedSpdyFramer(); |
81 | 83 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 SpdyStreamId header_stream_id_; | 165 SpdyStreamId header_stream_id_; |
164 scoped_ptr<SpdyFrame> control_frame_; | 166 scoped_ptr<SpdyFrame> control_frame_; |
165 int frames_received_; | 167 int frames_received_; |
166 | 168 |
167 DISALLOW_COPY_AND_ASSIGN(BufferedSpdyFramer); | 169 DISALLOW_COPY_AND_ASSIGN(BufferedSpdyFramer); |
168 }; | 170 }; |
169 | 171 |
170 } // namespace net | 172 } // namespace net |
171 | 173 |
172 #endif // NET_SPDY_BUFFERED_SPDY_FRAMER_H_ | 174 #endif // NET_SPDY_BUFFERED_SPDY_FRAMER_H_ |
OLD | NEW |