| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SERVER_HTTP_SERVER_H_ | 5 #ifndef NET_SERVER_HTTP_SERVER_H_ |
| 6 #define NET_SERVER_HTTP_SERVER_H_ | 6 #define NET_SERVER_HTTP_SERVER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> |
| 9 #include <stdint.h> |
| 10 |
| 8 #include <map> | 11 #include <map> |
| 9 #include <string> | 12 #include <string> |
| 10 | 13 |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/macros.h" | 14 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 15 #include "net/http/http_status_code.h" | 17 #include "net/http/http_status_code.h" |
| 16 | 18 |
| 17 namespace net { | 19 namespace net { |
| 18 | 20 |
| 19 class HttpConnection; | 21 class HttpConnection; |
| 20 class HttpServerRequestInfo; | 22 class HttpServerRequestInfo; |
| 21 class HttpServerResponseInfo; | 23 class HttpServerResponseInfo; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 const std::string& data, | 66 const std::string& data, |
| 65 const std::string& mime_type); | 67 const std::string& mime_type); |
| 66 void Send200(int connection_id, | 68 void Send200(int connection_id, |
| 67 const std::string& data, | 69 const std::string& data, |
| 68 const std::string& mime_type); | 70 const std::string& mime_type); |
| 69 void Send404(int connection_id); | 71 void Send404(int connection_id); |
| 70 void Send500(int connection_id, const std::string& message); | 72 void Send500(int connection_id, const std::string& message); |
| 71 | 73 |
| 72 void Close(int connection_id); | 74 void Close(int connection_id); |
| 73 | 75 |
| 74 void SetReceiveBufferSize(int connection_id, int32 size); | 76 void SetReceiveBufferSize(int connection_id, int32_t size); |
| 75 void SetSendBufferSize(int connection_id, int32 size); | 77 void SetSendBufferSize(int connection_id, int32_t size); |
| 76 | 78 |
| 77 // Copies the local address to |address|. Returns a network error code. | 79 // Copies the local address to |address|. Returns a network error code. |
| 78 int GetLocalAddress(IPEndPoint* address); | 80 int GetLocalAddress(IPEndPoint* address); |
| 79 | 81 |
| 80 private: | 82 private: |
| 81 friend class HttpServerTest; | 83 friend class HttpServerTest; |
| 82 | 84 |
| 83 typedef std::map<int, HttpConnection*> IdToConnectionMap; | 85 typedef std::map<int, HttpConnection*> IdToConnectionMap; |
| 84 | 86 |
| 85 void DoAcceptLoop(); | 87 void DoAcceptLoop(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 115 IdToConnectionMap id_to_connection_; | 117 IdToConnectionMap id_to_connection_; |
| 116 | 118 |
| 117 base::WeakPtrFactory<HttpServer> weak_ptr_factory_; | 119 base::WeakPtrFactory<HttpServer> weak_ptr_factory_; |
| 118 | 120 |
| 119 DISALLOW_COPY_AND_ASSIGN(HttpServer); | 121 DISALLOW_COPY_AND_ASSIGN(HttpServer); |
| 120 }; | 122 }; |
| 121 | 123 |
| 122 } // namespace net | 124 } // namespace net |
| 123 | 125 |
| 124 #endif // NET_SERVER_HTTP_SERVER_H_ | 126 #endif // NET_SERVER_HTTP_SERVER_H_ |
| OLD | NEW |