OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <cstdio> | 5 #include <cstdio> |
6 #include <iostream> | 6 #include <iostream> |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
16 #include "base/synchronization/waitable_event.h" | 16 #include "base/synchronization/waitable_event.h" |
| 17 #include "chrome/test/chromedriver/chrome/version.h" |
17 #include "chrome/test/chromedriver/command_executor_impl.h" | 18 #include "chrome/test/chromedriver/command_executor_impl.h" |
18 #include "chrome/test/chromedriver/server/http_handler.h" | 19 #include "chrome/test/chromedriver/server/http_handler.h" |
19 #include "chrome/test/chromedriver/server/http_response.h" | 20 #include "chrome/test/chromedriver/server/http_response.h" |
20 #include "chrome/test/chromedriver/version.h" | |
21 #include "third_party/mongoose/mongoose.h" | 21 #include "third_party/mongoose/mongoose.h" |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 void ReadRequestBody(const struct mg_request_info* const request_info, | 25 void ReadRequestBody(const struct mg_request_info* const request_info, |
26 struct mg_connection* const connection, | 26 struct mg_connection* const connection, |
27 std::string* request_body) { | 27 std::string* request_body) { |
28 int content_length = 0; | 28 int content_length = 0; |
29 // 64 maximum header count hard-coded in mongoose.h | 29 // 64 maximum header count hard-coded in mongoose.h |
30 for (int header_index = 0; header_index < 64; ++header_index) { | 30 for (int header_index = 0; header_index < 64; ++header_index) { |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 if (!cmd_line->HasSwitch("verbose")) { | 191 if (!cmd_line->HasSwitch("verbose")) { |
192 fclose(stdout); | 192 fclose(stdout); |
193 fclose(stderr); | 193 fclose(stderr); |
194 } | 194 } |
195 | 195 |
196 // Run until we receive command to shutdown. | 196 // Run until we receive command to shutdown. |
197 shutdown_event.Wait(); | 197 shutdown_event.Wait(); |
198 | 198 |
199 return 0; | 199 return 0; |
200 } | 200 } |
OLD | NEW |