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

Issue 1746303002: Replace std::string::find with base::StartsWith when comparing cookie paths. (Closed)

Created:
4 years, 9 months ago by mmenke
Modified:
4 years, 9 months ago
Reviewers:
Mike West
CC:
cbentzel+watch_chromium.org, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Replace std::string::find with base::StartsWith when comparing cookie paths. The old code was correct, and the performance benefits are minimal, but "path1.find(path2) != 0" is a bit obscure. Also switch DeleteCookie to CanonicalCookie::IsOnPath to compare cookies, to match normal cookie semantics. BUG=583482 Committed: https://crrev.com/23b6717eac3a002b02aa9951d62bec2b641fe947 Cr-Commit-Position: refs/heads/master@{#379092}

Patch Set 1 #

Patch Set 2 : Fix inverted check #

Patch Set 3 : Add test #

Patch Set 4 : Fix #

Patch Set 5 : Remove new test case #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+42 lines, -34 lines) Patch
M net/cookies/canonical_cookie.cc View 1 3 chunks +9 lines, -8 lines 3 comments Download
M net/cookies/cookie_monster.cc View 1 1 chunk +4 lines, -5 lines 2 comments Download
M net/cookies/cookie_monster_unittest.cc View 1 2 1 chunk +0 lines, -21 lines 0 comments Download
M net/cookies/cookie_store_unittest.h View 1 2 3 4 2 chunks +29 lines, -0 lines 3 comments Download

Messages

Total messages: 23 (10 generated)
mmenke
https://codereview.chromium.org/1746303002/diff/100001/net/cookies/canonical_cookie.cc File net/cookies/canonical_cookie.cc (right): https://codereview.chromium.org/1746303002/diff/100001/net/cookies/canonical_cookie.cc#newcode355 net/cookies/canonical_cookie.cc:355: if (!base::StartsWith(url_path, path_, base::CompareCase::SENSITIVE)) Does this really mean that ...
4 years, 9 months ago (2016-03-02 20:02:02 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1746303002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1746303002/100001
4 years, 9 months ago (2016-03-03 18:08:54 UTC) #6
mmenke
On 2016/03/03 18:08:54, commit-bot: I haz the power wrote: > Dry run: CQ is trying ...
4 years, 9 months ago (2016-03-03 18:26:13 UTC) #7
Mike West
And I should submit comments instead of submitting the CL to the CQ. :/ https://codereview.chromium.org/1746303002/diff/100001/net/cookies/canonical_cookie.cc ...
4 years, 9 months ago (2016-03-03 18:56:29 UTC) #8
mmenke
https://codereview.chromium.org/1746303002/diff/100001/net/cookies/canonical_cookie.cc File net/cookies/canonical_cookie.cc (right): https://codereview.chromium.org/1746303002/diff/100001/net/cookies/canonical_cookie.cc#newcode355 net/cookies/canonical_cookie.cc:355: if (!base::StartsWith(url_path, path_, base::CompareCase::SENSITIVE)) On 2016/03/03 18:56:28, Mike West ...
4 years, 9 months ago (2016-03-03 19:02:58 UTC) #9
Mike West
Based on our discussion, I think this is an accurate representation of what the spec ...
4 years, 9 months ago (2016-03-03 19:32:52 UTC) #10
mmenke
On 2016/03/03 19:32:52, Mike West wrote: > Based on our discussion, I think this is ...
4 years, 9 months ago (2016-03-03 19:34:57 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1746303002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1746303002/100001
4 years, 9 months ago (2016-03-03 19:36:55 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/183641)
4 years, 9 months ago (2016-03-03 20:34:29 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1746303002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1746303002/100001
4 years, 9 months ago (2016-03-03 20:38:05 UTC) #18
commit-bot: I haz the power
Committed patchset #5 (id:100001)
4 years, 9 months ago (2016-03-03 21:29:40 UTC) #20
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/23b6717eac3a002b02aa9951d62bec2b641fe947 Cr-Commit-Position: refs/heads/master@{#379092}
4 years, 9 months ago (2016-03-03 21:31:48 UTC) #22
benwells
4 years, 9 months ago (2016-03-04 05:00:03 UTC) #23
Message was sent while issue was closed.
A revert of this CL (patchset #5 id:100001) has been created in
https://codereview.chromium.org/1766613002/ by benwells@chromium.org.

The reason for reverting is: This CL seems to have caused a cookie test to fail
on the Mac valgrind bot. As it is a test failure, not memory error, being
reported I think it is worth investigating.

See
https://build.chromium.org/p/chromium.memory.fyi/builders/Chromium%20Mac%20%2....

Sample bot output:
CookieMonsterTest.PersisentCookieStorageTest:
../../net/cookies/cookie_monster_unittest.cc:2371: Failure
Value of: store->commands().size()
Actual: 6
Expected: 5u
Which is: 5.

Powered by Google App Engine
This is Rietveld 408576698