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" | |
14 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
15 #include "net/base/net_export.h" | 14 #include "net/base/net_export.h" |
16 #include "net/spdy/spdy_framer.h" | 15 #include "net/spdy/spdy_framer.h" |
17 #include "net/spdy/spdy_protocol.h" | 16 #include "net/spdy/spdy_protocol.h" |
18 | 17 |
19 namespace net { | 18 namespace net { |
20 | 19 |
21 class NET_EXPORT_PRIVATE BufferedSpdyFramerVisitorInterface { | 20 class NET_EXPORT_PRIVATE BufferedSpdyFramerVisitorInterface { |
22 public: | 21 public: |
23 BufferedSpdyFramerVisitorInterface() {} | 22 BufferedSpdyFramerVisitorInterface() {} |
24 | 23 |
25 // Called if an error is detected in the SpdyFrame protocol. | 24 // Called if an error is detected in the SpdyFrame protocol. |
26 virtual void OnError(SpdyFramer::SpdyError error_code) = 0; | 25 virtual void OnError(SpdyFramer::SpdyError error_code) = 0; |
27 | 26 |
28 // Called if an error is detected in a SPDY stream. | 27 // Called if an error is detected in a SPDY stream. |
29 virtual void OnStreamError(SpdyStreamId stream_id, | 28 virtual void OnStreamError(SpdyStreamId stream_id, |
30 const std::string& description) = 0; | 29 const std::string& description) = 0; |
31 | 30 |
32 // Called after all the header data for SYN_STREAM control frame is received. | 31 // Called after all the header data for SYN_STREAM control frame is received. |
33 virtual void OnSynStream(SpdyStreamId stream_id, | 32 virtual void OnSynStream(SpdyStreamId stream_id, |
34 SpdyStreamId associated_stream_id, | 33 SpdyStreamId associated_stream_id, |
35 SpdyPriority priority, | 34 SpdyPriority priority, |
36 uint8 credential_slot, | 35 uint8 credential_slot, |
37 bool fin, | 36 bool fin, |
38 bool unidirectional, | 37 bool unidirectional, |
39 const linked_ptr<SpdyHeaderBlock>& headers) = 0; | 38 const SpdyHeaderBlock& headers) = 0; |
40 | 39 |
41 // Called after all the header data for SYN_REPLY control frame is received. | 40 // Called after all the header data for SYN_REPLY control frame is received. |
42 virtual void OnSynReply(SpdyStreamId stream_id, | 41 virtual void OnSynReply(SpdyStreamId stream_id, |
43 bool fin, | 42 bool fin, |
44 const linked_ptr<SpdyHeaderBlock>& headers) = 0; | 43 const SpdyHeaderBlock& headers) = 0; |
45 | 44 |
46 // Called after all the header data for HEADERS control frame is received. | 45 // Called after all the header data for HEADERS control frame is received. |
47 virtual void OnHeaders(SpdyStreamId stream_id, | 46 virtual void OnHeaders(SpdyStreamId stream_id, |
48 bool fin, | 47 bool fin, |
49 const linked_ptr<SpdyHeaderBlock>& headers) = 0; | 48 const SpdyHeaderBlock& headers) = 0; |
50 | 49 |
51 // Called when data is received. | 50 // Called when data is received. |
52 // |stream_id| The stream receiving data. | 51 // |stream_id| The stream receiving data. |
53 // |data| A buffer containing the data received. | 52 // |data| A buffer containing the data received. |
54 // |len| The length of the data buffer. | 53 // |len| The length of the data buffer. |
55 // When the other side has finished sending data on this stream, | 54 // When the other side has finished sending data on this stream, |
56 // this method will be called with a zero-length buffer. | 55 // this method will be called with a zero-length buffer. |
57 virtual void OnStreamFrameData(SpdyStreamId stream_id, | 56 virtual void OnStreamFrameData(SpdyStreamId stream_id, |
58 const char* data, | 57 const char* data, |
59 size_t len) = 0; | 58 size_t len) = 0; |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 bool unidirectional; | 210 bool unidirectional; |
212 }; | 211 }; |
213 scoped_ptr<ControlFrameFields> control_frame_fields_; | 212 scoped_ptr<ControlFrameFields> control_frame_fields_; |
214 | 213 |
215 DISALLOW_COPY_AND_ASSIGN(BufferedSpdyFramer); | 214 DISALLOW_COPY_AND_ASSIGN(BufferedSpdyFramer); |
216 }; | 215 }; |
217 | 216 |
218 } // namespace net | 217 } // namespace net |
219 | 218 |
220 #endif // NET_SPDY_BUFFERED_SPDY_FRAMER_H_ | 219 #endif // NET_SPDY_BUFFERED_SPDY_FRAMER_H_ |
OLD | NEW |