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

Issue 2393163002: Factor out SameHost() in registry_controlled_domains

Created:
4 years, 2 months ago by pkalinnikov
Modified:
4 years, 2 months ago
Reviewers:
engedy
CC:
chromium-reviews, cbentzel+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Factor out SameHost() in registry_controlled_domains This allows clients to replicate SameDomainOrHost functionality in a more flexible and efficient way. One example use case is when there is a fixed |gurl_0|, and many different |gurl_i|'s need to be checked against |gurl_0|. After this CL, an efficient solution will be to save |gurl_0| and |domain_and_registry_0| = GetDomainAndRegistry(gurl_0), and then for for every incoming |gurl_i|, calculate GetDomainAndRegistry(gurl_i), and fall back to SameHost(gurl_0, gurl_i) not both of them have both domains. BUG=

Patch Set 1 #

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

Depends on Patchset:

Messages

Total messages: 10 (8 generated)
pkalinnikov
Balazs, PTAL and verify the approach. This is for supporting the CL 2288023003.
4 years, 2 months ago (2016-10-05 14:16:57 UTC) #4
engedy
4 years, 2 months ago (2016-10-21 08:43:22 UTC) #10
LGTM % nit, but I'd defer to Peter.

https://codereview.chromium.org/2393163002/diff/1/net/base/registry_controlle...
File net/base/registry_controlled_domains/registry_controlled_domain.h (right):

https://codereview.chromium.org/2393163002/diff/1/net/base/registry_controlle...
net/base/registry_controlled_domains/registry_controlled_domain.h:198: //
Returns whether the hosts of the GURLs are identical.
nit: Maybe we could put this into the anonymous namespace as well, and only move
the declaration to the header once we actually start using it?

When we do that, we should clarify in one more line what identical means in this
context.

Powered by Google App Engine
This is Rietveld 408576698