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

Side by Side Diff: chrome/browser/browsing_data/registrable_domain_filter_builder.h

Issue 2261673002: Move static RegistrableDomainFilterBuilder methods to an anonymous namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: BindRepeating Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/browsing_data/registrable_domain_filter_builder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_BROWSING_DATA_REGISTRABLE_DOMAIN_FILTER_BUILDER_H_ 5 #ifndef CHROME_BROWSER_BROWSING_DATA_REGISTRABLE_DOMAIN_FILTER_BUILDER_H_
6 #define CHROME_BROWSER_BROWSING_DATA_REGISTRABLE_DOMAIN_FILTER_BUILDER_H_ 6 #define CHROME_BROWSER_BROWSING_DATA_REGISTRABLE_DOMAIN_FILTER_BUILDER_H_
7 7
8 #include <ostream> 8 #include <ostream>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 base::Callback<bool(const std::string& site)> 90 base::Callback<bool(const std::string& site)>
91 BuildPluginFilter() const override; 91 BuildPluginFilter() const override;
92 92
93 // Used for testing. 93 // Used for testing.
94 bool operator==(const RegistrableDomainFilterBuilder& other) const; 94 bool operator==(const RegistrableDomainFilterBuilder& other) const;
95 95
96 protected: 96 protected:
97 bool IsEmpty() const override; 97 bool IsEmpty() const override;
98 98
99 private: 99 private:
100 // True if the domain of |url| is in the whitelist, or isn't in the blacklist. 100 // The set of domains that constitute the whitelist or the blacklist,
101 // The whitelist or blacklist is represented as |registerable_domains| 101 // depending on mode().
102 // and |mode|. 102 std::set<std::string> domains_;
103 static bool MatchesURL(std::set<std::string>* registerable_domains,
104 Mode mode,
105 const GURL& url);
106
107 // True if the pattern something in the whitelist, or doesn't match something
108 // in the blacklist.
109 // The whitelist or blacklist is represented as |patterns|, and |mode|.
110 static bool MatchesWebsiteSettingsPattern(
111 std::vector<ContentSettingsPattern>* patterns,
112 Mode mode,
113 const ContentSettingsPattern& pattern);
114
115 // True if no domains can see the given cookie and we're a blacklist, or any
116 // domains can see the cookie and we're a whitelist.
117 // The whitelist or blacklist is represented as |domains_and_ips| and |mode|.
118 static bool MatchesCookieForRegisterableDomainsAndIPs(
119 std::set<std::string>* domains_and_ips,
120 Mode mode,
121 const net::CanonicalCookie& cookie);
122
123 // True if none of the supplied domains matches this Channel ID's server ID
124 // and we're a blacklist, or one of them does and we're a whitelist.
125 // The whitelist or blacklist is represented as |domains_and_ips| and |mode|.
126 static bool MatchesChannelIDForRegisterableDomainsAndIPs(
127 std::set<std::string>* domains_and_ips,
128 Mode mode,
129 const std::string& channel_id_server_id);
130
131 // True if none of the supplied domains matches this plugin's |site| and we're
132 // a blacklist, or one of them does and we're a whitelist. The whitelist or
133 // blacklist is represented by |domains_and_ips| and |mode|.
134 static bool MatchesPluginSiteForRegisterableDomainsAndIPs(
135 std::set<std::string>* domains_and_ips,
136 Mode mode,
137 const std::string& site);
138
139 // The list of domains and whether they should be interpreted as a whitelist
140 // or blacklist.
141 std::set<std::string> domain_list_;
142 103
143 DISALLOW_COPY_AND_ASSIGN(RegistrableDomainFilterBuilder); 104 DISALLOW_COPY_AND_ASSIGN(RegistrableDomainFilterBuilder);
144 }; 105 };
145 106
146 #endif // CHROME_BROWSER_BROWSING_DATA_REGISTRABLE_DOMAIN_FILTER_BUILDER_H_ 107 #endif // CHROME_BROWSER_BROWSING_DATA_REGISTRABLE_DOMAIN_FILTER_BUILDER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browsing_data/registrable_domain_filter_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698