From 955093110ad64d5ec6f5426991efaa4a680b5d6f Mon Sep 17 00:00:00 2001 From: brettw Date: Thu, 16 Jul 2015 16:57:33 -0700 Subject: Remove legacy StartsWithASCII function. This replaces it with base::StartsWith and the appropriate case flag. Since the existing version only ever did case-insensitive tests in ASCII, there should be no behavior change. BUG=506255 TBR=jam Review URL: https://codereview.chromium.org/1242023005 Cr-Commit-Position: refs/heads/master@{#339175} --- rlz/lib/rlz_lib.cc | 14 ++++++++------ rlz/win/lib/machine_deal.cc | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'rlz') diff --git a/rlz/lib/rlz_lib.cc b/rlz/lib/rlz_lib.cc index 4a3cfde..c5403f6 100644 --- a/rlz/lib/rlz_lib.cc +++ b/rlz/lib/rlz_lib.cc @@ -422,7 +422,8 @@ bool IsPingResponseValid(const char* response, int* checksum_idx) { return false; } else { checksum_param = "crc32: "; // Empty response case. - if (!base::StartsWithASCII(response_string, checksum_param, true)) + if (!base::StartsWith(response_string, checksum_param, + base::CompareCase::SENSITIVE)) return false; checksum_index = 0; @@ -534,8 +535,8 @@ bool ParsePingResponse(Product product, const char* response) { std::string response_line; response_line = response_string.substr(line_begin, line_end - line_begin); - if (base::StartsWithASCII(response_line, kRlzCgiVariable, - true)) { // An RLZ. + if (base::StartsWith(response_line, kRlzCgiVariable, + base::CompareCase::SENSITIVE)) { // An RLZ. int separator_index = -1; if ((separator_index = response_line.find(": ")) < 0) continue; // Not a valid key-value pair. @@ -561,7 +562,8 @@ bool ParsePingResponse(Product product, const char* response) { if (IsAccessPointSupported(point)) SetAccessPointRlz(point, rlz_value.substr(0, rlz_length).c_str()); - } else if (base::StartsWithASCII(response_line, events_variable, true)) { + } else if (base::StartsWith(response_line, events_variable, + base::CompareCase::SENSITIVE)) { // Clear events which server parsed. std::vector event_array; GetEventsFromResponseString(response_line, events_variable, &event_array); @@ -569,8 +571,8 @@ bool ParsePingResponse(Product product, const char* response) { ClearProductEvent(product, event_array[i].access_point, event_array[i].event_type); } - } else if (base::StartsWithASCII(response_line, stateful_events_variable, - true)) { + } else if (base::StartsWith(response_line, stateful_events_variable, + base::CompareCase::SENSITIVE)) { // Record any stateful events the server send over. std::vector event_array; GetEventsFromResponseString(response_line, stateful_events_variable, diff --git a/rlz/win/lib/machine_deal.cc b/rlz/win/lib/machine_deal.cc index 7c8bbaa..8d6d369e 100644 --- a/rlz/win/lib/machine_deal.cc +++ b/rlz/win/lib/machine_deal.cc @@ -103,7 +103,8 @@ bool GetResponseValue(const std::string& response_line, value->clear(); - if (!base::StartsWithASCII(response_line, response_key, true)) + if (!base::StartsWith(response_line, response_key, + base::CompareCase::SENSITIVE)) return false; std::vector tokens; -- cgit v1.1