| Index: net/base/sdch_dictionary.cc
|
| diff --git a/net/base/sdch_dictionary.cc b/net/base/sdch_dictionary.cc
|
| index b8faf552390601da1e31dfe13d229ab60cded96e..4cef2bdabe9b20a8795be48f0512460de62a8b2e 100644
|
| --- a/net/base/sdch_dictionary.cc
|
| +++ b/net/base/sdch_dictionary.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "net/base/sdch_dictionary.h"
|
|
|
| +#include "base/strings/string_util.h"
|
| #include "base/time/clock.h"
|
| #include "base/time/default_clock.h"
|
| #include "base/values.h"
|
| @@ -140,8 +141,8 @@ SdchProblemCode SdchDictionary::CanUse(const GURL& target_url) const {
|
| }
|
|
|
| // static
|
| -bool SdchDictionary::PathMatch(const std::string& path,
|
| - const std::string& restriction) {
|
| +bool SdchDictionary::PathMatch(const base::StringPiece& path,
|
| + const base::StringPiece& restriction) {
|
| /* Must be either:
|
| * 1. P2 is equal to P1
|
| * 2. P2 is a prefix of P1 and either the final character in P2 is "/"
|
| @@ -152,7 +153,7 @@ bool SdchDictionary::PathMatch(const std::string& path,
|
| size_t prefix_length = restriction.size();
|
| if (prefix_length > path.size())
|
| return false; // Can't be a prefix.
|
| - if (0 != path.compare(0, prefix_length, restriction))
|
| + if (!base::StartsWith(path, restriction, base::CompareCase::SENSITIVE))
|
| return false;
|
| return restriction[prefix_length - 1] == '/' || path[prefix_length] == '/';
|
| }
|
|
|