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

Issue 2497753002: Invert host/domain checks in SameDomainOrHost (Closed)

Created:
4 years, 1 month ago by Charlie Harrison
Modified:
4 years, 1 month ago
Reviewers:
Peter Kasting
CC:
chromium-reviews, cbentzel+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Invert host/domain checks in SameDomainOrHost Checking for domains in the DAFSA is slow. Let's check if hosts are identical first as a quick fast path for URLs with the same host. The lookup in the fixed string set takes ~10% of RDHI::ContinuePendingBeginRequest and ~7.5% of URLRequest::Start. BUG=664174 Committed: https://crrev.com/11d71cb74a864e5459c97a701a1e2f8eadb694c8 Cr-Commit-Position: refs/heads/master@{#432047}

Patch Set 1 #

Total comments: 1

Patch Set 2 : pkasting review #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -17 lines) Patch
M net/base/registry_controlled_domains/registry_controlled_domain.h View 1 1 chunk +1 line, -1 line 2 comments Download
M net/base/registry_controlled_domains/registry_controlled_domain.cc View 1 1 chunk +13 lines, -16 lines 0 comments Download

Messages

Total messages: 20 (10 generated)
Charlie Harrison
pkasting, PTAL. AFAICT semantics are completely preserved with this inversion.
4 years, 1 month ago (2016-11-14 22:01:03 UTC) #6
Charlie Harrison
Note: this code is rather subtle, so I'm not 100% confident there are no edge ...
4 years, 1 month ago (2016-11-14 22:17:39 UTC) #7
Peter Kasting
https://codereview.chromium.org/2497753002/diff/1/net/base/registry_controlled_domains/registry_controlled_domain.cc File net/base/registry_controlled_domains/registry_controlled_domain.cc (right): https://codereview.chromium.org/2497753002/diff/1/net/base/registry_controlled_domains/registry_controlled_domain.cc#newcode349 net/base/registry_controlled_domains/registry_controlled_domain.cc:349: return false; I think a slightly faster, and hopefully ...
4 years, 1 month ago (2016-11-14 23:00:25 UTC) #8
Peter Kasting
To answer your concerns: possibly_invalid_spec() accesses the same thing (|spec_|) as host_piece(), so the simpler ...
4 years, 1 month ago (2016-11-14 23:02:37 UTC) #9
Charlie Harrison
Ah thank you for the comments. I have incorporated your suggestions into the new PS ...
4 years, 1 month ago (2016-11-14 23:17:07 UTC) #12
Peter Kasting
LGTM Yes, I think the StringPiece APIs to GURL postdate this code. https://codereview.chromium.org/2497753002/diff/20001/net/base/registry_controlled_domains/registry_controlled_domain.h File net/base/registry_controlled_domains/registry_controlled_domain.h ...
4 years, 1 month ago (2016-11-14 23:21:03 UTC) #13
Charlie Harrison
https://codereview.chromium.org/2497753002/diff/20001/net/base/registry_controlled_domains/registry_controlled_domain.h File net/base/registry_controlled_domains/registry_controlled_domain.h (right): https://codereview.chromium.org/2497753002/diff/20001/net/base/registry_controlled_domains/registry_controlled_domain.h#newcode195 net/base/registry_controlled_domains/registry_controlled_domain.h:195: // URLs. Note that this means the trailing dot, ...
4 years, 1 month ago (2016-11-14 23:48:23 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2497753002/20001
4 years, 1 month ago (2016-11-14 23:49:53 UTC) #17
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 1 month ago (2016-11-15 01:45:35 UTC) #18
commit-bot: I haz the power
4 years, 1 month ago (2016-11-15 01:52:09 UTC) #20
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/11d71cb74a864e5459c97a701a1e2f8eadb694c8
Cr-Commit-Position: refs/heads/master@{#432047}

Powered by Google App Engine
This is Rietveld 408576698