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

Side by Side Diff: net/tools/flip_server/streamer_interface.h

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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/tools/flip_server/spdy_interface.cc ('k') | net/tools/quic/end_to_end_test.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_TOOLS_FLIP_SERVER_STREAMER_INTERFACE_H_ 5 #ifndef NET_TOOLS_FLIP_SERVER_STREAMER_INTERFACE_H_
6 #define NET_TOOLS_FLIP_SERVER_STREAMER_INTERFACE_H_ 6 #define NET_TOOLS_FLIP_SERVER_STREAMER_INTERFACE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "net/tools/balsa/balsa_headers.h" 11 #include "net/tools/balsa/balsa_headers.h"
12 #include "net/tools/balsa/balsa_visitor_interface.h" 12 #include "net/tools/balsa/balsa_visitor_interface.h"
13 #include "net/tools/flip_server/sm_interface.h" 13 #include "net/tools/flip_server/sm_interface.h"
14 14
15 namespace net { 15 namespace net {
16 16
17 class BalsaFrame; 17 class BalsaFrame;
18 class FlipAcceptor; 18 class FlipAcceptor;
19 class MemCacheIter; 19 class MemCacheIter;
20 class SMConnection; 20 class SMConnection;
21 class EpollServer; 21 class EpollServer;
22 22
23 class StreamerSM : public BalsaVisitorInterface, public SMInterface { 23 class StreamerSM : public BalsaVisitorInterface, public SMInterface {
24 public: 24 public:
25 StreamerSM(SMConnection* connection, 25 StreamerSM(SMConnection* connection,
26 SMInterface* sm_other_interface, 26 SMInterface* sm_other_interface,
27 EpollServer* epoll_server, 27 EpollServer* epoll_server,
28 FlipAcceptor* acceptor); 28 FlipAcceptor* acceptor);
29 virtual ~StreamerSM(); 29 ~StreamerSM() override;
30 30
31 void AddToOutputOrder(const MemCacheIter& mci) {} 31 void AddToOutputOrder(const MemCacheIter& mci) {}
32 32
33 virtual void InitSMInterface(SMInterface* sm_other_interface, 33 void InitSMInterface(SMInterface* sm_other_interface,
34 int32 server_idx) override; 34 int32 server_idx) override;
35 virtual void InitSMConnection(SMConnectionPoolInterface* connection_pool, 35 void InitSMConnection(SMConnectionPoolInterface* connection_pool,
36 SMInterface* sm_interface, 36 SMInterface* sm_interface,
37 EpollServer* epoll_server, 37 EpollServer* epoll_server,
38 int fd, 38 int fd,
39 std::string server_ip, 39 std::string server_ip,
40 std::string server_port, 40 std::string server_port,
41 std::string remote_ip, 41 std::string remote_ip,
42 bool use_ssl) override; 42 bool use_ssl) override;
43 43
44 virtual size_t ProcessReadInput(const char* data, size_t len) override; 44 size_t ProcessReadInput(const char* data, size_t len) override;
45 virtual size_t ProcessWriteInput(const char* data, size_t len) override; 45 size_t ProcessWriteInput(const char* data, size_t len) override;
46 virtual bool MessageFullyRead() const override; 46 bool MessageFullyRead() const override;
47 virtual void SetStreamID(uint32 stream_id) override {} 47 void SetStreamID(uint32 stream_id) override {}
48 virtual bool Error() const override; 48 bool Error() const override;
49 virtual const char* ErrorAsString() const override; 49 const char* ErrorAsString() const override;
50 virtual void Reset() override; 50 void Reset() override;
51 virtual void ResetForNewInterface(int32 server_idx) override {} 51 void ResetForNewInterface(int32 server_idx) override {}
52 virtual void ResetForNewConnection() override; 52 void ResetForNewConnection() override;
53 virtual void Cleanup() override; 53 void Cleanup() override;
54 virtual int PostAcceptHook() override; 54 int PostAcceptHook() override;
55 virtual void NewStream(uint32 stream_id, 55 void NewStream(uint32 stream_id,
56 uint32 priority, 56 uint32 priority,
57 const std::string& filename) override {} 57 const std::string& filename) override {}
58 virtual void SendEOF(uint32 stream_id) override {} 58 void SendEOF(uint32 stream_id) override {}
59 virtual void SendErrorNotFound(uint32 stream_id) override {} 59 void SendErrorNotFound(uint32 stream_id) override {}
60 virtual void SendOKResponse(uint32 stream_id, std::string output) {} 60 virtual void SendOKResponse(uint32 stream_id, std::string output) {}
61 virtual size_t SendSynStream(uint32 stream_id, 61 size_t SendSynStream(uint32 stream_id, const BalsaHeaders& headers) override;
62 const BalsaHeaders& headers) override; 62 size_t SendSynReply(uint32 stream_id, const BalsaHeaders& headers) override;
63 virtual size_t SendSynReply(uint32 stream_id, 63 void SendDataFrame(uint32 stream_id,
64 const BalsaHeaders& headers) override; 64 const char* data,
65 virtual void SendDataFrame(uint32 stream_id, 65 int64 len,
66 const char* data, 66 uint32 flags,
67 int64 len, 67 bool compress) override {}
68 uint32 flags, 68 void set_is_request() override;
69 bool compress) override {}
70 virtual void set_is_request() override;
71 static std::string forward_ip_header() { return forward_ip_header_; } 69 static std::string forward_ip_header() { return forward_ip_header_; }
72 static void set_forward_ip_header(std::string value) { 70 static void set_forward_ip_header(std::string value) {
73 forward_ip_header_ = value; 71 forward_ip_header_ = value;
74 } 72 }
75 73
76 private: 74 private:
77 void SendEOFImpl(uint32 stream_id) {} 75 void SendEOFImpl(uint32 stream_id) {}
78 void SendErrorNotFoundImpl(uint32 stream_id) {} 76 void SendErrorNotFoundImpl(uint32 stream_id) {}
79 void SendOKResponseImpl(uint32 stream_id, std::string* output) {} 77 void SendOKResponseImpl(uint32 stream_id, std::string* output) {}
80 size_t SendSynReplyImpl(uint32 stream_id, const BalsaHeaders& headers) { 78 size_t SendSynReplyImpl(uint32 stream_id, const BalsaHeaders& headers) {
81 return 0; 79 return 0;
82 } 80 }
83 size_t SendSynStreamImpl(uint32 stream_id, const BalsaHeaders& headers) { 81 size_t SendSynStreamImpl(uint32 stream_id, const BalsaHeaders& headers) {
84 return 0; 82 return 0;
85 } 83 }
86 void SendDataFrameImpl(uint32 stream_id, 84 void SendDataFrameImpl(uint32 stream_id,
87 const char* data, 85 const char* data,
88 int64 len, 86 int64 len,
89 uint32 flags, 87 uint32 flags,
90 bool compress) {} 88 bool compress) {}
91 virtual void GetOutput() override {} 89 void GetOutput() override {}
92 90
93 virtual void ProcessBodyInput(const char* input, size_t size) override; 91 void ProcessBodyInput(const char* input, size_t size) override;
94 virtual void MessageDone() override; 92 void MessageDone() override;
95 virtual void ProcessHeaders(const BalsaHeaders& headers) override; 93 void ProcessHeaders(const BalsaHeaders& headers) override;
96 virtual void ProcessBodyData(const char* input, size_t size) override {} 94 void ProcessBodyData(const char* input, size_t size) override {}
97 virtual void ProcessHeaderInput(const char* input, size_t size) override {} 95 void ProcessHeaderInput(const char* input, size_t size) override {}
98 virtual void ProcessTrailerInput(const char* input, size_t size) override {} 96 void ProcessTrailerInput(const char* input, size_t size) override {}
99 virtual void ProcessRequestFirstLine(const char* line_input, 97 void ProcessRequestFirstLine(const char* line_input,
100 size_t line_length, 98 size_t line_length,
101 const char* method_input, 99 const char* method_input,
102 size_t method_length, 100 size_t method_length,
103 const char* request_uri_input, 101 const char* request_uri_input,
104 size_t request_uri_length, 102 size_t request_uri_length,
105 const char* version_input, 103 const char* version_input,
106 size_t version_length) override {} 104 size_t version_length) override {}
107 virtual void ProcessResponseFirstLine(const char* line_input, 105 void ProcessResponseFirstLine(const char* line_input,
108 size_t line_length, 106 size_t line_length,
109 const char* version_input, 107 const char* version_input,
110 size_t version_length, 108 size_t version_length,
111 const char* status_input, 109 const char* status_input,
112 size_t status_length, 110 size_t status_length,
113 const char* reason_input, 111 const char* reason_input,
114 size_t reason_length) override {} 112 size_t reason_length) override {}
115 virtual void ProcessChunkLength(size_t chunk_length) override {} 113 void ProcessChunkLength(size_t chunk_length) override {}
116 virtual void ProcessChunkExtensions(const char* input, size_t size) override { 114 void ProcessChunkExtensions(const char* input, size_t size) override {}
117 } 115 void HeaderDone() override {}
118 virtual void HeaderDone() override {} 116 void HandleHeaderError(BalsaFrame* framer) override;
119 virtual void HandleHeaderError(BalsaFrame* framer) override; 117 void HandleHeaderWarning(BalsaFrame* framer) override {}
120 virtual void HandleHeaderWarning(BalsaFrame* framer) override {} 118 void HandleChunkingError(BalsaFrame* framer) override;
121 virtual void HandleChunkingError(BalsaFrame* framer) override; 119 void HandleBodyError(BalsaFrame* framer) override;
122 virtual void HandleBodyError(BalsaFrame* framer) override;
123 void HandleError(); 120 void HandleError();
124 121
125 SMConnection* connection_; 122 SMConnection* connection_;
126 SMInterface* sm_other_interface_; 123 SMInterface* sm_other_interface_;
127 EpollServer* epoll_server_; 124 EpollServer* epoll_server_;
128 FlipAcceptor* acceptor_; 125 FlipAcceptor* acceptor_;
129 bool is_request_; 126 bool is_request_;
130 BalsaFrame* http_framer_; 127 BalsaFrame* http_framer_;
131 BalsaHeaders headers_; 128 BalsaHeaders headers_;
132 static std::string forward_ip_header_; 129 static std::string forward_ip_header_;
133 }; 130 };
134 131
135 } // namespace net 132 } // namespace net
136 133
137 #endif // NET_TOOLS_FLIP_SERVER_STREAMER_INTERFACE_H_ 134 #endif // NET_TOOLS_FLIP_SERVER_STREAMER_INTERFACE_H_
OLDNEW
« no previous file with comments | « net/tools/flip_server/spdy_interface.cc ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698