| Index: chrome/browser/browsing_data/origin_filter_builder.h
|
| diff --git a/chrome/browser/browsing_data/origin_filter_builder.h b/chrome/browser/browsing_data/origin_filter_builder.h
|
| index 092ec42b161422ee8c87132d9a155c3d8e2fe4f7..945de0fb5aa36dd0c1a00f7c3efc80095c1e875a 100644
|
| --- a/chrome/browser/browsing_data/origin_filter_builder.h
|
| +++ b/chrome/browser/browsing_data/origin_filter_builder.h
|
| @@ -13,12 +13,16 @@
|
| #include "url/gurl.h"
|
| #include "url/origin.h"
|
|
|
| +class ContentSettingsPattern;
|
| +
|
| // A class that constructs URL deletion filters (represented as GURL->bool
|
| // predicates) that match certain origins.
|
| class OriginFilterBuilder {
|
| public:
|
| enum Mode {
|
| + // This means that only the origins given will be deleted.
|
| WHITELIST,
|
| + // This means that the origins given will NOT be deleted.
|
| BLACKLIST
|
| };
|
|
|
| @@ -33,10 +37,18 @@ class OriginFilterBuilder {
|
| // Sets the |mode| of the filter.
|
| void SetMode(Mode mode);
|
|
|
| + // Returns if we're an empty blacklist, where we delete everything.
|
| + bool IsEmptyBlacklist() const;
|
| +
|
| // Builds a filter that matches URLs whose origins are in the whitelist,
|
| // or aren't in the blacklist.
|
| base::Callback<bool(const GURL&)> BuildSameOriginFilter() const;
|
|
|
| + // Builds a filter that matches ContentSettingsPatterns whose origins are in
|
| + // the whitelist, or aren't in the blacklist.
|
| + base::Callback<bool(const ContentSettingsPattern& pattern)>
|
| + BuildSameOriginContentSettingsFilter() const;
|
| +
|
| // Build a filter that matches URLs whose origins, or origins obtained by
|
| // replacing the host with any superdomain, are listed in the whitelist,
|
| // or are not listed in the blacklist.
|
| @@ -52,6 +64,14 @@ class OriginFilterBuilder {
|
| static bool MatchesURL(
|
| std::set<url::Origin>* origins, Mode mode, const GURL& url);
|
|
|
| + // True if the origin of pattern is in the whitelist, or isn't in the
|
| + // blacklist.
|
| + // The whitelist or blacklist is represented as |origins| and |mode|.
|
| + static bool MatchesContentSettingsPattern(
|
| + std::set<url::Origin>* origins,
|
| + Mode mode,
|
| + const ContentSettingsPattern& pattern);
|
| +
|
| // True if any origin [scheme, host, port], such that |url| has the same
|
| // scheme and port, and |url|'s host is the same or a subdomain of that host,
|
| // is in the whitelist, or isn't in the blacklist. The whitelist or blacklist
|
|
|