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

Side by Side Diff: net/tools/flip_server/http_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
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_HTTP_INTERFACE_H_ 5 #ifndef NET_TOOLS_FLIP_SERVER_HTTP_INTERFACE_H_
6 #define NET_TOOLS_FLIP_SERVER_HTTP_INTERFACE_H_ 6 #define NET_TOOLS_FLIP_SERVER_HTTP_INTERFACE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 10 matching lines...) Expand all
21 class EpollServer; 21 class EpollServer;
22 class FlipAcceptor; 22 class FlipAcceptor;
23 class MemoryCache; 23 class MemoryCache;
24 24
25 class HttpSM : public BalsaVisitorInterface, public SMInterface { 25 class HttpSM : public BalsaVisitorInterface, public SMInterface {
26 public: 26 public:
27 HttpSM(SMConnection* connection, 27 HttpSM(SMConnection* connection,
28 SMInterface* sm_spdy_interface, 28 SMInterface* sm_spdy_interface,
29 MemoryCache* memory_cache, 29 MemoryCache* memory_cache,
30 FlipAcceptor* acceptor); 30 FlipAcceptor* acceptor);
31 virtual ~HttpSM(); 31 ~HttpSM() override;
32 32
33 private: 33 private:
34 // BalsaVisitorInterface: 34 // BalsaVisitorInterface:
35 virtual void ProcessBodyInput(const char* input, size_t size) override {} 35 void ProcessBodyInput(const char* input, size_t size) override {}
36 virtual void ProcessBodyData(const char* input, size_t size) override; 36 void ProcessBodyData(const char* input, size_t size) override;
37 virtual void ProcessHeaderInput(const char* input, size_t size) override {} 37 void ProcessHeaderInput(const char* input, size_t size) override {}
38 virtual void ProcessTrailerInput(const char* input, size_t size) override {} 38 void ProcessTrailerInput(const char* input, size_t size) override {}
39 virtual void ProcessHeaders(const BalsaHeaders& headers) override; 39 void ProcessHeaders(const BalsaHeaders& headers) override;
40 virtual void ProcessRequestFirstLine(const char* line_input, 40 void ProcessRequestFirstLine(const char* line_input,
41 size_t line_length, 41 size_t line_length,
42 const char* method_input, 42 const char* method_input,
43 size_t method_length, 43 size_t method_length,
44 const char* request_uri_input, 44 const char* request_uri_input,
45 size_t request_uri_length, 45 size_t request_uri_length,
46 const char* version_input, 46 const char* version_input,
47 size_t version_length) override {} 47 size_t version_length) override {}
48 virtual void ProcessResponseFirstLine(const char* line_input, 48 void ProcessResponseFirstLine(const char* line_input,
49 size_t line_length, 49 size_t line_length,
50 const char* version_input, 50 const char* version_input,
51 size_t version_length, 51 size_t version_length,
52 const char* status_input, 52 const char* status_input,
53 size_t status_length, 53 size_t status_length,
54 const char* reason_input, 54 const char* reason_input,
55 size_t reason_length) override {} 55 size_t reason_length) override {}
56 virtual void ProcessChunkLength(size_t chunk_length) override {} 56 void ProcessChunkLength(size_t chunk_length) override {}
57 virtual void ProcessChunkExtensions(const char* input, size_t size) override { 57 void ProcessChunkExtensions(const char* input, size_t size) override {}
58 } 58 void HeaderDone() override {}
59 virtual void HeaderDone() override {} 59 void MessageDone() override;
60 virtual void MessageDone() override; 60 void HandleHeaderError(BalsaFrame* framer) override;
61 virtual void HandleHeaderError(BalsaFrame* framer) override; 61 void HandleHeaderWarning(BalsaFrame* framer) override {}
62 virtual void HandleHeaderWarning(BalsaFrame* framer) override {} 62 void HandleChunkingError(BalsaFrame* framer) override;
63 virtual void HandleChunkingError(BalsaFrame* framer) override; 63 void HandleBodyError(BalsaFrame* framer) override;
64 virtual void HandleBodyError(BalsaFrame* framer) override;
65 64
66 void HandleError(); 65 void HandleError();
67 66
68 public: 67 public:
69 void AddToOutputOrder(const MemCacheIter& mci); 68 void AddToOutputOrder(const MemCacheIter& mci);
70 BalsaFrame* spdy_framer() { return http_framer_; } 69 BalsaFrame* spdy_framer() { return http_framer_; }
71 virtual void set_is_request() override {} 70 void set_is_request() override {}
72 const OutputOrdering& output_ordering() const { return output_ordering_; } 71 const OutputOrdering& output_ordering() const { return output_ordering_; }
73 72
74 // SMInterface: 73 // SMInterface:
75 virtual void InitSMInterface(SMInterface* sm_spdy_interface, 74 void InitSMInterface(SMInterface* sm_spdy_interface,
76 int32 server_idx) override; 75 int32 server_idx) override;
77 virtual void InitSMConnection(SMConnectionPoolInterface* connection_pool, 76 void InitSMConnection(SMConnectionPoolInterface* connection_pool,
78 SMInterface* sm_interface, 77 SMInterface* sm_interface,
79 EpollServer* epoll_server, 78 EpollServer* epoll_server,
80 int fd, 79 int fd,
81 std::string server_ip, 80 std::string server_ip,
82 std::string server_port, 81 std::string server_port,
83 std::string remote_ip, 82 std::string remote_ip,
84 bool use_ssl) override; 83 bool use_ssl) override;
85 virtual size_t ProcessReadInput(const char* data, size_t len) override; 84 size_t ProcessReadInput(const char* data, size_t len) override;
86 virtual size_t ProcessWriteInput(const char* data, size_t len) override; 85 size_t ProcessWriteInput(const char* data, size_t len) override;
87 virtual bool MessageFullyRead() const override; 86 bool MessageFullyRead() const override;
88 virtual void SetStreamID(uint32 stream_id) override; 87 void SetStreamID(uint32 stream_id) override;
89 virtual bool Error() const override; 88 bool Error() const override;
90 virtual const char* ErrorAsString() const override; 89 const char* ErrorAsString() const override;
91 virtual void Reset() override; 90 void Reset() override;
92 virtual void ResetForNewInterface(int32 server_idx) override {} 91 void ResetForNewInterface(int32 server_idx) override {}
93 virtual void ResetForNewConnection() override; 92 void ResetForNewConnection() override;
94 virtual void Cleanup() override; 93 void Cleanup() override;
95 virtual int PostAcceptHook() override; 94 int PostAcceptHook() override;
96 95
97 virtual void NewStream(uint32 stream_id, 96 void NewStream(uint32 stream_id,
98 uint32 priority, 97 uint32 priority,
99 const std::string& filename) override; 98 const std::string& filename) override;
100 virtual void SendEOF(uint32 stream_id) override; 99 void SendEOF(uint32 stream_id) override;
101 virtual void SendErrorNotFound(uint32 stream_id) override; 100 void SendErrorNotFound(uint32 stream_id) override;
102 virtual size_t SendSynStream(uint32 stream_id, 101 size_t SendSynStream(uint32 stream_id, const BalsaHeaders& headers) override;
103 const BalsaHeaders& headers) override; 102 size_t SendSynReply(uint32 stream_id, const BalsaHeaders& headers) override;
104 virtual size_t SendSynReply(uint32 stream_id, 103 void SendDataFrame(uint32 stream_id,
105 const BalsaHeaders& headers) override; 104 const char* data,
106 virtual void SendDataFrame(uint32 stream_id, 105 int64 len,
107 const char* data, 106 uint32 flags,
108 int64 len, 107 bool compress) override;
109 uint32 flags,
110 bool compress) override;
111 108
112 private: 109 private:
113 void SendEOFImpl(uint32 stream_id); 110 void SendEOFImpl(uint32 stream_id);
114 void SendErrorNotFoundImpl(uint32 stream_id); 111 void SendErrorNotFoundImpl(uint32 stream_id);
115 void SendOKResponseImpl(uint32 stream_id, const std::string& output); 112 void SendOKResponseImpl(uint32 stream_id, const std::string& output);
116 size_t SendSynReplyImpl(uint32 stream_id, const BalsaHeaders& headers); 113 size_t SendSynReplyImpl(uint32 stream_id, const BalsaHeaders& headers);
117 size_t SendSynStreamImpl(uint32 stream_id, const BalsaHeaders& headers); 114 size_t SendSynStreamImpl(uint32 stream_id, const BalsaHeaders& headers);
118 void SendDataFrameImpl(uint32 stream_id, 115 void SendDataFrameImpl(uint32 stream_id,
119 const char* data, 116 const char* data,
120 int64 len, 117 int64 len,
121 uint32 flags, 118 uint32 flags,
122 bool compress); 119 bool compress);
123 void EnqueueDataFrame(DataFrame* df); 120 void EnqueueDataFrame(DataFrame* df);
124 virtual void GetOutput() override; 121 void GetOutput() override;
125 122
126 private: 123 private:
127 BalsaFrame* http_framer_; 124 BalsaFrame* http_framer_;
128 BalsaHeaders headers_; 125 BalsaHeaders headers_;
129 uint32 stream_id_; 126 uint32 stream_id_;
130 int32 server_idx_; 127 int32 server_idx_;
131 128
132 SMConnection* connection_; 129 SMConnection* connection_;
133 SMInterface* sm_spdy_interface_; 130 SMInterface* sm_spdy_interface_;
134 OutputList* output_list_; 131 OutputList* output_list_;
135 OutputOrdering output_ordering_; 132 OutputOrdering output_ordering_;
136 MemoryCache* memory_cache_; 133 MemoryCache* memory_cache_;
137 FlipAcceptor* acceptor_; 134 FlipAcceptor* acceptor_;
138 }; 135 };
139 136
140 } // namespace net 137 } // namespace net
141 138
142 #endif // NET_TOOLS_FLIP_SERVER_HTTP_INTERFACE_H_ 139 #endif // NET_TOOLS_FLIP_SERVER_HTTP_INTERFACE_H_
OLDNEW
« no previous file with comments | « net/tools/flip_server/flip_in_mem_edsm_server.cc ('k') | net/tools/flip_server/http_interface_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698