| OLD | NEW |
| 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 <stddef.h> |
| 9 #include <stdint.h> |
| 10 |
| 8 #include <string> | 11 #include <string> |
| 9 | 12 |
| 10 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 11 #include "net/tools/balsa/balsa_headers.h" | 14 #include "net/tools/balsa/balsa_headers.h" |
| 12 #include "net/tools/balsa/balsa_visitor_interface.h" | 15 #include "net/tools/balsa/balsa_visitor_interface.h" |
| 13 #include "net/tools/flip_server/output_ordering.h" | 16 #include "net/tools/flip_server/output_ordering.h" |
| 14 #include "net/tools/flip_server/sm_connection.h" | 17 #include "net/tools/flip_server/sm_connection.h" |
| 15 #include "net/tools/flip_server/sm_interface.h" | 18 #include "net/tools/flip_server/sm_interface.h" |
| 16 | 19 |
| 17 namespace net { | 20 namespace net { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 void HandleError(); | 68 void HandleError(); |
| 66 | 69 |
| 67 public: | 70 public: |
| 68 void AddToOutputOrder(const MemCacheIter& mci); | 71 void AddToOutputOrder(const MemCacheIter& mci); |
| 69 BalsaFrame* spdy_framer() { return http_framer_; } | 72 BalsaFrame* spdy_framer() { return http_framer_; } |
| 70 void set_is_request() override {} | 73 void set_is_request() override {} |
| 71 const OutputOrdering& output_ordering() const { return output_ordering_; } | 74 const OutputOrdering& output_ordering() const { return output_ordering_; } |
| 72 | 75 |
| 73 // SMInterface: | 76 // SMInterface: |
| 74 void InitSMInterface(SMInterface* sm_spdy_interface, | 77 void InitSMInterface(SMInterface* sm_spdy_interface, |
| 75 int32 server_idx) override; | 78 int32_t server_idx) override; |
| 76 void InitSMConnection(SMConnectionPoolInterface* connection_pool, | 79 void InitSMConnection(SMConnectionPoolInterface* connection_pool, |
| 77 SMInterface* sm_interface, | 80 SMInterface* sm_interface, |
| 78 EpollServer* epoll_server, | 81 EpollServer* epoll_server, |
| 79 int fd, | 82 int fd, |
| 80 std::string server_ip, | 83 std::string server_ip, |
| 81 std::string server_port, | 84 std::string server_port, |
| 82 std::string remote_ip, | 85 std::string remote_ip, |
| 83 bool use_ssl) override; | 86 bool use_ssl) override; |
| 84 size_t ProcessReadInput(const char* data, size_t len) override; | 87 size_t ProcessReadInput(const char* data, size_t len) override; |
| 85 size_t ProcessWriteInput(const char* data, size_t len) override; | 88 size_t ProcessWriteInput(const char* data, size_t len) override; |
| 86 bool MessageFullyRead() const override; | 89 bool MessageFullyRead() const override; |
| 87 void SetStreamID(uint32 stream_id) override; | 90 void SetStreamID(uint32_t stream_id) override; |
| 88 bool Error() const override; | 91 bool Error() const override; |
| 89 const char* ErrorAsString() const override; | 92 const char* ErrorAsString() const override; |
| 90 void Reset() override; | 93 void Reset() override; |
| 91 void ResetForNewInterface(int32 server_idx) override {} | 94 void ResetForNewInterface(int32_t server_idx) override {} |
| 92 void ResetForNewConnection() override; | 95 void ResetForNewConnection() override; |
| 93 void Cleanup() override; | 96 void Cleanup() override; |
| 94 int PostAcceptHook() override; | 97 int PostAcceptHook() override; |
| 95 | 98 |
| 96 void NewStream(uint32 stream_id, | 99 void NewStream(uint32_t stream_id, |
| 97 uint32 priority, | 100 uint32_t priority, |
| 98 const std::string& filename) override; | 101 const std::string& filename) override; |
| 99 void SendEOF(uint32 stream_id) override; | 102 void SendEOF(uint32_t stream_id) override; |
| 100 void SendErrorNotFound(uint32 stream_id) override; | 103 void SendErrorNotFound(uint32_t stream_id) override; |
| 101 size_t SendSynStream(uint32 stream_id, const BalsaHeaders& headers) override; | 104 size_t SendSynStream(uint32_t stream_id, |
| 102 size_t SendSynReply(uint32 stream_id, const BalsaHeaders& headers) override; | 105 const BalsaHeaders& headers) override; |
| 103 void SendDataFrame(uint32 stream_id, | 106 size_t SendSynReply(uint32_t stream_id, const BalsaHeaders& headers) override; |
| 107 void SendDataFrame(uint32_t stream_id, |
| 104 const char* data, | 108 const char* data, |
| 105 int64 len, | 109 int64_t len, |
| 106 uint32 flags, | 110 uint32_t flags, |
| 107 bool compress) override; | 111 bool compress) override; |
| 108 | 112 |
| 109 private: | 113 private: |
| 110 void SendEOFImpl(uint32 stream_id); | 114 void SendEOFImpl(uint32_t stream_id); |
| 111 void SendErrorNotFoundImpl(uint32 stream_id); | 115 void SendErrorNotFoundImpl(uint32_t stream_id); |
| 112 void SendOKResponseImpl(uint32 stream_id, const std::string& output); | 116 void SendOKResponseImpl(uint32_t stream_id, const std::string& output); |
| 113 size_t SendSynReplyImpl(uint32 stream_id, const BalsaHeaders& headers); | 117 size_t SendSynReplyImpl(uint32_t stream_id, const BalsaHeaders& headers); |
| 114 size_t SendSynStreamImpl(uint32 stream_id, const BalsaHeaders& headers); | 118 size_t SendSynStreamImpl(uint32_t stream_id, const BalsaHeaders& headers); |
| 115 void SendDataFrameImpl(uint32 stream_id, | 119 void SendDataFrameImpl(uint32_t stream_id, |
| 116 const char* data, | 120 const char* data, |
| 117 int64 len, | 121 int64_t len, |
| 118 uint32 flags, | 122 uint32_t flags, |
| 119 bool compress); | 123 bool compress); |
| 120 void EnqueueDataFrame(DataFrame* df); | 124 void EnqueueDataFrame(DataFrame* df); |
| 121 void GetOutput() override; | 125 void GetOutput() override; |
| 122 | 126 |
| 123 private: | 127 private: |
| 124 BalsaFrame* http_framer_; | 128 BalsaFrame* http_framer_; |
| 125 BalsaHeaders headers_; | 129 BalsaHeaders headers_; |
| 126 uint32 stream_id_; | 130 uint32_t stream_id_; |
| 127 int32 server_idx_; | 131 int32_t server_idx_; |
| 128 | 132 |
| 129 SMConnection* connection_; | 133 SMConnection* connection_; |
| 130 SMInterface* sm_spdy_interface_; | 134 SMInterface* sm_spdy_interface_; |
| 131 OutputList* output_list_; | 135 OutputList* output_list_; |
| 132 OutputOrdering output_ordering_; | 136 OutputOrdering output_ordering_; |
| 133 MemoryCache* memory_cache_; | 137 MemoryCache* memory_cache_; |
| 134 FlipAcceptor* acceptor_; | 138 FlipAcceptor* acceptor_; |
| 135 }; | 139 }; |
| 136 | 140 |
| 137 } // namespace net | 141 } // namespace net |
| 138 | 142 |
| 139 #endif // NET_TOOLS_FLIP_SERVER_HTTP_INTERFACE_H_ | 143 #endif // NET_TOOLS_FLIP_SERVER_HTTP_INTERFACE_H_ |
| OLD | NEW |