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 "chrome/test/chromedriver/server/http_handler.h" | 5 #include "chrome/test/chromedriver/server/http_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 &session_thread_map_)), | 513 &session_thread_map_)), |
514 CommandMapping( | 514 CommandMapping( |
515 kPost, | 515 kPost, |
516 kShutdownPath, | 516 kShutdownPath, |
517 base::Bind(&ExecuteQuitAll, | 517 base::Bind(&ExecuteQuitAll, |
518 WrapToCommand("QuitAll", base::Bind(&ExecuteQuit, true)), | 518 WrapToCommand("QuitAll", base::Bind(&ExecuteQuit, true)), |
519 &session_thread_map_)), | 519 &session_thread_map_)), |
520 CommandMapping(kGet, | 520 CommandMapping(kGet, |
521 "session/:sessionId/is_loading", | 521 "session/:sessionId/is_loading", |
522 WrapToCommand("IsLoading", base::Bind(&ExecuteIsLoading))), | 522 WrapToCommand("IsLoading", base::Bind(&ExecuteIsLoading))), |
| 523 CommandMapping(kGet, |
| 524 "session/:sessionId/autoreport", |
| 525 WrapToCommand("IsAutoReporting", |
| 526 base::Bind(&ExecuteIsAutoReporting))), |
| 527 CommandMapping(kPost, |
| 528 "session/:sessionId/autoreport", |
| 529 WrapToCommand( |
| 530 "SetAutoReporting", |
| 531 base::Bind(&ExecuteSetAutoReporting))), |
523 }; | 532 }; |
524 command_map_.reset( | 533 command_map_.reset( |
525 new CommandMap(commands, commands + arraysize(commands))); | 534 new CommandMap(commands, commands + arraysize(commands))); |
526 } | 535 } |
527 | 536 |
528 HttpHandler::~HttpHandler() {} | 537 HttpHandler::~HttpHandler() {} |
529 | 538 |
530 void HttpHandler::Handle(const net::HttpServerRequestInfo& request, | 539 void HttpHandler::Handle(const net::HttpServerRequestInfo& request, |
531 const HttpResponseSenderFunc& send_response_func) { | 540 const HttpResponseSenderFunc& send_response_func) { |
532 CHECK(thread_checker_.CalledOnValidThread()); | 541 CHECK(thread_checker_.CalledOnValidThread()); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 params.SetString(name, path_parts[i]); | 726 params.SetString(name, path_parts[i]); |
718 } else if (command_path_parts[i] != path_parts[i]) { | 727 } else if (command_path_parts[i] != path_parts[i]) { |
719 return false; | 728 return false; |
720 } | 729 } |
721 } | 730 } |
722 out_params->MergeDictionary(¶ms); | 731 out_params->MergeDictionary(¶ms); |
723 return true; | 732 return true; |
724 } | 733 } |
725 | 734 |
726 } // namespace internal | 735 } // namespace internal |
OLD | NEW |