| 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_SM_CONNECTION_H_ | 5 #ifndef NET_TOOLS_FLIP_SERVER_SM_CONNECTION_H_ | 
| 6 #define NET_TOOLS_FLIP_SERVER_SM_CONNECTION_H_ | 6 #define NET_TOOLS_FLIP_SERVER_SM_CONNECTION_H_ | 
| 7 | 7 | 
| 8 #include <arpa/inet.h>  // in_addr_t | 8 #include <arpa/inet.h>  // in_addr_t | 
| 9 #include <time.h> | 9 #include <time.h> | 
| 10 | 10 | 
| (...skipping 27 matching lines...) Expand all  Loading... | 
| 38 | 38 | 
| 39 typedef std::list<DataFrame*> OutputList; | 39 typedef std::list<DataFrame*> OutputList; | 
| 40 | 40 | 
| 41 class SMConnection : public SMConnectionInterface, | 41 class SMConnection : public SMConnectionInterface, | 
| 42                      public EpollCallbackInterface, | 42                      public EpollCallbackInterface, | 
| 43                      public NotifierInterface { | 43                      public NotifierInterface { | 
| 44  public: | 44  public: | 
| 45   virtual ~SMConnection(); | 45   virtual ~SMConnection(); | 
| 46 | 46 | 
| 47   static SMConnection* NewSMConnection(EpollServer* epoll_server, | 47   static SMConnection* NewSMConnection(EpollServer* epoll_server, | 
| 48                                        SSLState *ssl_state, | 48                                        SSLState* ssl_state, | 
| 49                                        MemoryCache* memory_cache, | 49                                        MemoryCache* memory_cache, | 
| 50                                        FlipAcceptor *acceptor, | 50                                        FlipAcceptor* acceptor, | 
| 51                                        std::string log_prefix); | 51                                        std::string log_prefix); | 
| 52 | 52 | 
| 53   // TODO(mbelshe): Make these private. | 53   // TODO(mbelshe): Make these private. | 
| 54   time_t last_read_time_; | 54   time_t last_read_time_; | 
| 55   std::string server_ip_; | 55   std::string server_ip_; | 
| 56   std::string server_port_; | 56   std::string server_port_; | 
| 57 | 57 | 
| 58   virtual EpollServer* epoll_server() OVERRIDE; | 58   virtual EpollServer* epoll_server() OVERRIDE; | 
| 59   OutputList* output_list() { return &output_list_; } | 59   OutputList* output_list() { return &output_list_; } | 
| 60   MemoryCache* memory_cache() { return memory_cache_; } | 60   MemoryCache* memory_cache() { return memory_cache_; } | 
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 117   friend std::ostream& operator<<(std::ostream& os, const SMConnection& c) { | 117   friend std::ostream& operator<<(std::ostream& os, const SMConnection& c) { | 
| 118     os << &c << "\n"; | 118     os << &c << "\n"; | 
| 119     return os; | 119     return os; | 
| 120   } | 120   } | 
| 121 | 121 | 
| 122   SMConnection(EpollServer* epoll_server, | 122   SMConnection(EpollServer* epoll_server, | 
| 123                SSLState* ssl_state, | 123                SSLState* ssl_state, | 
| 124                MemoryCache* memory_cache, | 124                MemoryCache* memory_cache, | 
| 125                FlipAcceptor* acceptor, | 125                FlipAcceptor* acceptor, | 
| 126                std::string log_prefix); | 126                std::string log_prefix); | 
|  | 127 | 
| 127  private: | 128  private: | 
| 128   int fd_; | 129   int fd_; | 
| 129   int events_; | 130   int events_; | 
| 130 | 131 | 
| 131   bool registered_in_epoll_server_; | 132   bool registered_in_epoll_server_; | 
| 132   bool initialized_; | 133   bool initialized_; | 
| 133   bool protocol_detected_; | 134   bool protocol_detected_; | 
| 134   bool connection_complete_; | 135   bool connection_complete_; | 
| 135 | 136 | 
| 136   SMConnectionPoolInterface* connection_pool_; | 137   SMConnectionPoolInterface* connection_pool_; | 
| 137 | 138 | 
| 138   EpollServer *epoll_server_; | 139   EpollServer* epoll_server_; | 
| 139   SSLState *ssl_state_; | 140   SSLState* ssl_state_; | 
| 140   MemoryCache* memory_cache_; | 141   MemoryCache* memory_cache_; | 
| 141   FlipAcceptor *acceptor_; | 142   FlipAcceptor* acceptor_; | 
| 142   std::string client_ip_; | 143   std::string client_ip_; | 
| 143 | 144 | 
| 144   RingBuffer read_buffer_; | 145   RingBuffer read_buffer_; | 
| 145 | 146 | 
| 146   OutputList output_list_; | 147   OutputList output_list_; | 
| 147   SMInterface* sm_spdy_interface_; | 148   SMInterface* sm_spdy_interface_; | 
| 148   SMInterface* sm_http_interface_; | 149   SMInterface* sm_http_interface_; | 
| 149   SMInterface* sm_streamer_interface_; | 150   SMInterface* sm_streamer_interface_; | 
| 150   SMInterface* sm_interface_; | 151   SMInterface* sm_interface_; | 
| 151   std::string log_prefix_; | 152   std::string log_prefix_; | 
| 152 | 153 | 
| 153   size_t max_bytes_sent_per_dowrite_; | 154   size_t max_bytes_sent_per_dowrite_; | 
| 154 | 155 | 
| 155   SSL* ssl_; | 156   SSL* ssl_; | 
| 156 | 157 | 
| 157   static bool force_spdy_; | 158   static bool force_spdy_; | 
| 158 }; | 159 }; | 
| 159 | 160 | 
| 160 }  // namespace net | 161 }  // namespace net | 
| 161 | 162 | 
| 162 #endif  // NET_TOOLS_FLIP_SERVER_SM_CONNECTION_H_ | 163 #endif  // NET_TOOLS_FLIP_SERVER_SM_CONNECTION_H_ | 
| OLD | NEW | 
|---|