| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include <stdio.h> | 5 #include <stdio.h> |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <winsock2.h> | 8 #include <winsock2.h> |
| 9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
| 10 #include <arpa/inet.h> | 10 #include <arpa/inet.h> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 namespace http_server { | 43 namespace http_server { |
| 44 | 44 |
| 45 class Connection; | 45 class Connection; |
| 46 | 46 |
| 47 typedef base::Callback<void(HttpRequestPtr, Connection*)> HandleRequestCallback; | 47 typedef base::Callback<void(HttpRequestPtr, Connection*)> HandleRequestCallback; |
| 48 | 48 |
| 49 const char* GetHttpReasonPhrase(uint32_t code_in) { | 49 const char* GetHttpReasonPhrase(uint32_t code_in) { |
| 50 switch (code_in) { | 50 switch (code_in) { |
| 51 #define HTTP_STATUS(label, code, reason) case code: return reason; | 51 #define HTTP_STATUS(label, code, reason) case code: return reason; |
| 52 #include "net/http/http_status_code_list.h" | 52 #include "services/http_server/http_status_code_list.h" |
| 53 #undef HTTP_STATUS | 53 #undef HTTP_STATUS |
| 54 | 54 |
| 55 default: | 55 default: |
| 56 NOTREACHED() << "unknown HTTP status code " << code_in; | 56 NOTREACHED() << "unknown HTTP status code " << code_in; |
| 57 } | 57 } |
| 58 | 58 |
| 59 return ""; | 59 return ""; |
| 60 } | 60 } |
| 61 | 61 |
| 62 // Represents one connection to a client. This connection will manage its own | 62 // Represents one connection to a client. This connection will manage its own |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 | 421 |
| 422 ScopedVector<Handler> handlers_; | 422 ScopedVector<Handler> handlers_; |
| 423 }; | 423 }; |
| 424 | 424 |
| 425 } // namespace http_server | 425 } // namespace http_server |
| 426 | 426 |
| 427 MojoResult MojoMain(MojoHandle shell_handle) { | 427 MojoResult MojoMain(MojoHandle shell_handle) { |
| 428 mojo::ApplicationRunner runner(new http_server::HttpServerApp); | 428 mojo::ApplicationRunner runner(new http_server::HttpServerApp); |
| 429 return runner.Run(shell_handle); | 429 return runner.Run(shell_handle); |
| 430 } | 430 } |
| OLD | NEW |