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

Unified Diff: components/subresource_filter/core/common/first_party_origin.h

Issue 2668213002: Remove Origin->GURL conversion in DocumentSubresourceFilter (Closed)
Patch Set: reviews (std::string::assign + comment) Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/subresource_filter/core/common/first_party_origin.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/subresource_filter/core/common/first_party_origin.h
diff --git a/components/subresource_filter/core/common/first_party_origin.h b/components/subresource_filter/core/common/first_party_origin.h
index b05dcf1165d9305b1469479197890bad8928b840..fad33eed399998b75da85928d6515f93f3eedbec 100644
--- a/components/subresource_filter/core/common/first_party_origin.h
+++ b/components/subresource_filter/core/common/first_party_origin.h
@@ -33,19 +33,14 @@ class FirstPartyOrigin {
const url::Origin& first_party_origin);
private:
- url::Origin document_origin_;
-
- // NOTE: GURL is needed to work around the slightly inefficient interfaces of
- // net::registry_controlled_domains.
- GURL document_origin_as_gurl_;
+ const url::Origin document_origin_;
// One-entry cache that stores input/output of the last IsThirdParty
- // call.
- //
- // NOTE: registry_controlled_domains::SameDomainOrHost takes GURLs as inputs,
- // but the cache entry stores only the host part of a GURL. It is assumed that
- // SameDomainOrHost will return the same result for a GURL which has the same
- // non-empty host part as the cached one.
+ // call. To improve performance, the cache stores only the host part of the
+ // last checked URL. Checking only the host part before returning the cached
+ // result is correct, because registry_controlled_domains::SameDomainOrHost
+ // would return the same result for any GURL that has the same non-empty
+ // host part as the last checked URL.
mutable std::string last_checked_host_;
mutable bool last_checked_host_was_third_party_ = false;
};
« no previous file with comments | « no previous file | components/subresource_filter/core/common/first_party_origin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698