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 #include "chrome/test/webdriver/webdriver_dispatch.h" | 5 #include "chrome/test/webdriver/webdriver_dispatch.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 if (method == "POST") { | 49 if (method == "POST") { |
50 command->ExecutePost(response); | 50 command->ExecutePost(response); |
51 } else if (method == "GET") { | 51 } else if (method == "GET") { |
52 command->ExecuteGet(response); | 52 command->ExecuteGet(response); |
53 } else if (method == "DELETE") { | 53 } else if (method == "DELETE") { |
54 command->ExecuteDelete(response); | 54 command->ExecuteDelete(response); |
55 } else { | 55 } else { |
56 NOTREACHED(); | 56 NOTREACHED(); |
57 } | 57 } |
| 58 command->Finish(); |
58 } | 59 } |
59 | 60 |
60 void Shutdown(struct mg_connection* connection, | 61 void Shutdown(struct mg_connection* connection, |
61 const struct mg_request_info* request_info, | 62 const struct mg_request_info* request_info, |
62 void* user_data) { | 63 void* user_data) { |
63 base::WaitableEvent* shutdown_event = | 64 base::WaitableEvent* shutdown_event = |
64 reinterpret_cast<base::WaitableEvent*>(user_data); | 65 reinterpret_cast<base::WaitableEvent*>(user_data); |
65 mg_printf(connection, "HTTP/1.1 200 OK\r\n\r\n"); | 66 mg_printf(connection, "HTTP/1.1 200 OK\r\n\r\n"); |
66 shutdown_event->Signal(); | 67 shutdown_event->Signal(); |
67 } | 68 } |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 void Dispatcher::SetNotImplemented(const std::string& pattern) { | 332 void Dispatcher::SetNotImplemented(const std::string& pattern) { |
332 mg_set_uri_callback(context_, (root_ + pattern).c_str(), | 333 mg_set_uri_callback(context_, (root_ + pattern).c_str(), |
333 &SendNotImplementedError, NULL); | 334 &SendNotImplementedError, NULL); |
334 } | 335 } |
335 | 336 |
336 void Dispatcher::ForbidAllOtherRequests() { | 337 void Dispatcher::ForbidAllOtherRequests() { |
337 mg_set_uri_callback(context_, "*", &SendForbidden, NULL); | 338 mg_set_uri_callback(context_, "*", &SendForbidden, NULL); |
338 } | 339 } |
339 | 340 |
340 } // namespace webdriver | 341 } // namespace webdriver |
OLD | NEW |