| Index: net/cookies/canonical_cookie.cc
|
| diff --git a/net/cookies/canonical_cookie.cc b/net/cookies/canonical_cookie.cc
|
| index de2fbbe6c65f03826722b05646936e95ad0ae536..649937ce1b8163a9191c71408cc9b82dcd41604e 100644
|
| --- a/net/cookies/canonical_cookie.cc
|
| +++ b/net/cookies/canonical_cookie.cc
|
| @@ -92,7 +92,7 @@ std::string CanonPathWithString(const GURL& url,
|
| // Set-Cookie response, up to, but not including, the
|
| // right-most /."""
|
| // How would this work for a cookie on /? We will include it then.
|
| - const std::string& url_path = url.path();
|
| + base::StringPiece url_path = url.path();
|
|
|
| size_t idx = url_path.find_last_of('/');
|
|
|
| @@ -101,7 +101,7 @@ std::string CanonPathWithString(const GURL& url,
|
| return std::string("/");
|
|
|
| // Return up to the rightmost '/'.
|
| - return url_path.substr(0, idx);
|
| + return url_path.as_string().substr(0, idx);
|
| }
|
|
|
| // Compares cookies using name, domain and path, so that "equivalent" cookies
|
| @@ -310,8 +310,7 @@ bool CanonicalCookie::IsEquivalentForSecureCookieMatching(
|
| ecc.IsOnPath(Path()));
|
| }
|
|
|
| -bool CanonicalCookie::IsOnPath(const std::string& url_path) const {
|
| -
|
| +bool CanonicalCookie::IsOnPath(const base::StringPiece& url_path) const {
|
| // A zero length would be unsafe for our trailing '/' checks, and
|
| // would also make no sense for our prefix match. The code that
|
| // creates a CanonicalCookie should make sure the path is never zero length,
|
|
|