Commit 7eb83065 authored by Kalvin Lee's avatar Kalvin Lee Committed by Commit Bot

PpdProvider v3: use base::StartsWith()

base::StringPiece erased support for its starts_with() method
in https://crrev.com/c/2358745. This change modifies PpdMetadataManager
to use the base::StartsWith() function instead.

Bug: chromium:888189
Test: chromeos_unittests --gtest_filter='PpdMetadataManagerTest.*'
Change-Id: If8fef9b2e066f852168cadcf8a02c445033e5028
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2373387Reviewed-by: default avatarSean Kau <skau@chromium.org>
Commit-Queue: Kalvin Lee <kdlee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#802365}
parent 6fbe1359
......@@ -20,6 +20,7 @@
#include "base/strings/strcat.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/time/clock.h"
#include "base/time/time.h"
......@@ -238,8 +239,7 @@ class MetadataLocaleFinder {
// |browser_locale_|. For example, "en-GB" is a parent of "en-GB-foo."
bool IsParentOfBrowserLocale(base::StringPiece locale) const {
const std::string locale_with_trailing_hyphen = base::StrCat({locale, "-"});
return base::StringPiece(browser_locale_)
.starts_with(locale_with_trailing_hyphen);
return base::StartsWith(browser_locale_, locale_with_trailing_hyphen);
}
// Updates our |best_distant_relative_locale_| to |locale| if we find
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment