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

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

Issue 2169503002: Remove flip_server. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/tools/flip_server/flip_test_utils.cc ('k') | net/tools/flip_server/http_interface.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NET_TOOLS_FLIP_SERVER_HTTP_INTERFACE_H_
6 #define NET_TOOLS_FLIP_SERVER_HTTP_INTERFACE_H_
7
8 #include <stddef.h>
9 #include <stdint.h>
10
11 #include <string>
12
13 #include "base/compiler_specific.h"
14 #include "net/tools/balsa/balsa_headers.h"
15 #include "net/tools/balsa/balsa_visitor_interface.h"
16 #include "net/tools/flip_server/output_ordering.h"
17 #include "net/tools/flip_server/sm_connection.h"
18 #include "net/tools/flip_server/sm_interface.h"
19
20 namespace net {
21
22 class BalsaFrame;
23 class DataFrame;
24 class EpollServer;
25 class FlipAcceptor;
26 class MemoryCache;
27
28 class HttpSM : public BalsaVisitorInterface, public SMInterface {
29 public:
30 HttpSM(SMConnection* connection,
31 SMInterface* sm_spdy_interface,
32 MemoryCache* memory_cache,
33 FlipAcceptor* acceptor);
34 ~HttpSM() override;
35
36 private:
37 // BalsaVisitorInterface:
38 void ProcessBodyInput(const char* input, size_t size) override {}
39 void ProcessBodyData(const char* input, size_t size) override;
40 void ProcessHeaderInput(const char* input, size_t size) override {}
41 void ProcessTrailerInput(const char* input, size_t size) override {}
42 void ProcessHeaders(const BalsaHeaders& headers) override;
43 void ProcessRequestFirstLine(const char* line_input,
44 size_t line_length,
45 const char* method_input,
46 size_t method_length,
47 const char* request_uri_input,
48 size_t request_uri_length,
49 const char* version_input,
50 size_t version_length) override {}
51 void ProcessResponseFirstLine(const char* line_input,
52 size_t line_length,
53 const char* version_input,
54 size_t version_length,
55 const char* status_input,
56 size_t status_length,
57 const char* reason_input,
58 size_t reason_length) override {}
59 void ProcessChunkLength(size_t chunk_length) override {}
60 void ProcessChunkExtensions(const char* input, size_t size) override {}
61 void HeaderDone() override {}
62 void MessageDone() override;
63 void HandleHeaderError(BalsaFrame* framer) override;
64 void HandleHeaderWarning(BalsaFrame* framer) override {}
65 void HandleChunkingError(BalsaFrame* framer) override;
66 void HandleBodyError(BalsaFrame* framer) override;
67
68 void HandleError();
69
70 public:
71 void AddToOutputOrder(const MemCacheIter& mci);
72 BalsaFrame* spdy_framer() { return http_framer_.get(); }
73 void set_is_request() override {}
74 const OutputOrdering& output_ordering() const { return output_ordering_; }
75
76 // SMInterface:
77 void InitSMInterface(SMInterface* sm_spdy_interface,
78 int32_t server_idx) override;
79 void InitSMConnection(SMConnectionPoolInterface* connection_pool,
80 SMInterface* sm_interface,
81 EpollServer* epoll_server,
82 int fd,
83 std::string server_ip,
84 std::string server_port,
85 std::string remote_ip,
86 bool use_ssl) override;
87 size_t ProcessReadInput(const char* data, size_t len) override;
88 size_t ProcessWriteInput(const char* data, size_t len) override;
89 bool MessageFullyRead() const override;
90 void SetStreamID(uint32_t stream_id) override;
91 bool Error() const override;
92 const char* ErrorAsString() const override;
93 void Reset() override;
94 void ResetForNewInterface(int32_t server_idx) override {}
95 void ResetForNewConnection() override;
96 void Cleanup() override;
97 int PostAcceptHook() override;
98
99 void NewStream(uint32_t stream_id,
100 uint32_t priority,
101 const std::string& filename) override;
102 void SendEOF(uint32_t stream_id) override;
103 void SendErrorNotFound(uint32_t stream_id) override;
104 size_t SendSynStream(uint32_t stream_id,
105 const BalsaHeaders& headers) override;
106 size_t SendSynReply(uint32_t stream_id, const BalsaHeaders& headers) override;
107 void SendDataFrame(uint32_t stream_id,
108 const char* data,
109 int64_t len,
110 uint32_t flags,
111 bool compress) override;
112
113 private:
114 void SendEOFImpl(uint32_t stream_id);
115 void SendErrorNotFoundImpl(uint32_t stream_id);
116 void SendOKResponseImpl(uint32_t stream_id, const std::string& output);
117 size_t SendSynReplyImpl(uint32_t stream_id, const BalsaHeaders& headers);
118 size_t SendSynStreamImpl(uint32_t stream_id, const BalsaHeaders& headers);
119 void SendDataFrameImpl(uint32_t stream_id,
120 const char* data,
121 int64_t len,
122 uint32_t flags,
123 bool compress);
124 void EnqueueDataFrame(DataFrame* df);
125 void GetOutput() override;
126
127 private:
128 std::unique_ptr<BalsaFrame> http_framer_;
129 BalsaHeaders headers_;
130 uint32_t stream_id_;
131 int32_t server_idx_;
132
133 SMConnection* connection_;
134 SMInterface* sm_spdy_interface_;
135 OutputList* output_list_;
136 OutputOrdering output_ordering_;
137 MemoryCache* memory_cache_;
138 FlipAcceptor* acceptor_;
139 };
140
141 } // namespace net
142
143 #endif // NET_TOOLS_FLIP_SERVER_HTTP_INTERFACE_H_
OLDNEW
« no previous file with comments | « net/tools/flip_server/flip_test_utils.cc ('k') | net/tools/flip_server/http_interface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698