Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: chrome/test/chromedriver/server/http_handler.cc

Issue 101203012: [chromedriver] Add an error autoreporting feature that automatically raises errors from browser logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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("IsAutoReportingEnabled",
526 base::Bind(&ExecuteIsAutoReportingEnabled))),
527 CommandMapping(kPost,
528 "session/:sessionId/autoreport",
529 WrapToCommand(
530 "SetAutoReportingEnabled",
chrisgao (Use stgao instead) 2014/01/09 22:11:55 "SetAutoReporting" ? It could be both enabled and
samuong 2014/01/16 00:29:28 Done.
531 base::Bind(&ExecuteSetAutoReportingEnabled))),
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
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(&params); 731 out_params->MergeDictionary(&params);
723 return true; 732 return true;
724 } 733 }
725 734
726 } // namespace internal 735 } // namespace internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698