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

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

Issue 1214183008: Update StartsWith calls to use new versions in chrome and content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 HttpHandler::~HttpHandler() {} 573 HttpHandler::~HttpHandler() {}
574 574
575 void HttpHandler::Handle(const net::HttpServerRequestInfo& request, 575 void HttpHandler::Handle(const net::HttpServerRequestInfo& request,
576 const HttpResponseSenderFunc& send_response_func) { 576 const HttpResponseSenderFunc& send_response_func) {
577 CHECK(thread_checker_.CalledOnValidThread()); 577 CHECK(thread_checker_.CalledOnValidThread());
578 578
579 if (received_shutdown_) 579 if (received_shutdown_)
580 return; 580 return;
581 581
582 std::string path = request.path; 582 std::string path = request.path;
583 if (!base::StartsWithASCII(path, url_base_, true)) { 583 if (!base::StartsWith(path, url_base_, base::CompareCase::SENSITIVE)) {
584 scoped_ptr<net::HttpServerResponseInfo> response( 584 scoped_ptr<net::HttpServerResponseInfo> response(
585 new net::HttpServerResponseInfo(net::HTTP_BAD_REQUEST)); 585 new net::HttpServerResponseInfo(net::HTTP_BAD_REQUEST));
586 response->SetBody("unhandled request", "text/plain"); 586 response->SetBody("unhandled request", "text/plain");
587 send_response_func.Run(response.Pass()); 587 send_response_func.Run(response.Pass());
588 return; 588 return;
589 } 589 }
590 590
591 path.erase(0, url_base_.length()); 591 path.erase(0, url_base_.length());
592 592
593 HandleCommand(request, path, send_response_func); 593 HandleCommand(request, path, send_response_func);
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 params.SetString(name, path_parts[i]); 762 params.SetString(name, path_parts[i]);
763 } else if (command_path_parts[i] != path_parts[i]) { 763 } else if (command_path_parts[i] != path_parts[i]) {
764 return false; 764 return false;
765 } 765 }
766 } 766 }
767 out_params->MergeDictionary(&params); 767 out_params->MergeDictionary(&params);
768 return true; 768 return true;
769 } 769 }
770 770
771 } // namespace internal 771 } // namespace internal
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/performance_logger.cc ('k') | chrome/utility/importer/bookmark_html_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698