Commit 7e6d5a9e authored by Justin Donnelly's avatar Justin Donnelly Committed by Commit Bot

[Project Code Inclusion] Remove use of "whitelist" in components/omnibox

Bug: 1149562
Change-Id: Iaf0d7104fd0f90100e7c112d65baa602638163bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2542044Reviewed-by: default avatarOrin Jaworski <orinj@chromium.org>
Commit-Queue: Justin Donnelly <jdonnelly@chromium.org>
Cr-Commit-Position: refs/heads/master@{#827958}
parent cfe2227f
......@@ -27,23 +27,22 @@
using in_memory_url_index::InMemoryURLIndexCacheItem;
// Initializes a whitelist of URL schemes.
void InitializeSchemeWhitelist(
SchemeSet* whitelist,
const SchemeSet& client_schemes_to_whitelist) {
DCHECK(whitelist);
if (!whitelist->empty())
// Initializes a allowlist of URL schemes.
void InitializeSchemeAllowlist(SchemeSet* allowlist,
const SchemeSet& client_schemes_to_allowlist) {
DCHECK(allowlist);
if (!allowlist->empty())
return; // Nothing to do, already initialized.
whitelist->insert(client_schemes_to_whitelist.begin(),
client_schemes_to_whitelist.end());
allowlist->insert(client_schemes_to_allowlist.begin(),
client_schemes_to_allowlist.end());
whitelist->insert(std::string(url::kAboutScheme));
whitelist->insert(std::string(url::kFileScheme));
whitelist->insert(std::string(url::kFtpScheme));
whitelist->insert(std::string(url::kHttpScheme));
whitelist->insert(std::string(url::kHttpsScheme));
whitelist->insert(std::string(url::kMailToScheme));
allowlist->insert(std::string(url::kAboutScheme));
allowlist->insert(std::string(url::kFileScheme));
allowlist->insert(std::string(url::kFtpScheme));
allowlist->insert(std::string(url::kHttpScheme));
allowlist->insert(std::string(url::kHttpsScheme));
allowlist->insert(std::string(url::kMailToScheme));
}
// Restore/SaveCacheObserver ---------------------------------------------------
......@@ -57,18 +56,14 @@ InMemoryURLIndex::SaveCacheObserver::~SaveCacheObserver() {
// RebuildPrivateDataFromHistoryDBTask -----------------------------------------
InMemoryURLIndex::RebuildPrivateDataFromHistoryDBTask::
RebuildPrivateDataFromHistoryDBTask(
InMemoryURLIndex* index,
const SchemeSet& scheme_whitelist)
: index_(index),
scheme_whitelist_(scheme_whitelist),
succeeded_(false) {
}
RebuildPrivateDataFromHistoryDBTask(InMemoryURLIndex* index,
const SchemeSet& scheme_allowlist)
: index_(index), scheme_allowlist_(scheme_allowlist), succeeded_(false) {}
bool InMemoryURLIndex::RebuildPrivateDataFromHistoryDBTask::RunOnDBThread(
history::HistoryBackend* backend,
history::HistoryDatabase* db) {
data_ = URLIndexPrivateData::RebuildFromHistory(db, scheme_whitelist_);
data_ = URLIndexPrivateData::RebuildFromHistory(db, scheme_allowlist_);
succeeded_ = data_.get() && !data_->Empty();
if (!succeeded_ && data_.get())
data_->Clear();
......@@ -90,7 +85,7 @@ InMemoryURLIndex::InMemoryURLIndex(bookmarks::BookmarkModel* bookmark_model,
history::HistoryService* history_service,
TemplateURLService* template_url_service,
const base::FilePath& history_dir,
const SchemeSet& client_schemes_to_whitelist)
const SchemeSet& client_schemes_to_allowlist)
: bookmark_model_(bookmark_model),
history_service_(history_service),
template_url_service_(template_url_service),
......@@ -104,7 +99,7 @@ InMemoryURLIndex::InMemoryURLIndex(bookmarks::BookmarkModel* bookmark_model,
restored_(false),
needs_to_be_cached_(false),
listen_to_history_service_loaded_(false) {
InitializeSchemeWhitelist(&scheme_whitelist_, client_schemes_to_whitelist);
InitializeSchemeAllowlist(&scheme_allowlist_, client_schemes_to_allowlist);
// TODO(mrossetti): Register for language change notifications.
if (history_service_)
history_service_->AddObserver(this);
......@@ -173,7 +168,7 @@ void InMemoryURLIndex::OnURLVisited(history::HistoryService* history_service,
return;
}
needs_to_be_cached_ |= private_data_->UpdateURL(
history_service_, row, scheme_whitelist_, &private_data_tracker_);
history_service_, row, scheme_allowlist_, &private_data_tracker_);
}
void InMemoryURLIndex::OnURLsModified(history::HistoryService* history_service,
......@@ -192,7 +187,7 @@ void InMemoryURLIndex::OnURLsModified(history::HistoryService* history_service,
continue;
}
needs_to_be_cached_ |= private_data_->UpdateURL(
history_service_, row, scheme_whitelist_, &private_data_tracker_);
history_service_, row, scheme_allowlist_, &private_data_tracker_);
}
}
......@@ -238,7 +233,7 @@ bool InMemoryURLIndex::OnMemoryDump(
base::trace_event::ProcessMemoryDump* process_memory_dump) {
size_t res = 0;
res += base::trace_event::EstimateMemoryUsage(scheme_whitelist_);
res += base::trace_event::EstimateMemoryUsage(scheme_allowlist_);
// TODO(dyaroshev): Add support for scoped_refptr in
// base::trace_event::EstimateMemoryUsage.
......@@ -348,7 +343,7 @@ void InMemoryURLIndex::ScheduleRebuildFromHistory() {
FROM_HERE,
std::unique_ptr<history::HistoryDBTask>(
new InMemoryURLIndex::RebuildPrivateDataFromHistoryDBTask(
this, scheme_whitelist_)),
this, scheme_allowlist_)),
&cache_reader_tracker_);
}
......@@ -373,8 +368,8 @@ void InMemoryURLIndex::DoneRebuidingPrivateDataFromHistoryDB(
void InMemoryURLIndex::RebuildFromHistory(
history::HistoryDatabase* history_db) {
private_data_tracker_.TryCancelAll();
private_data_ = URLIndexPrivateData::RebuildFromHistory(history_db,
scheme_whitelist_);
private_data_ =
URLIndexPrivateData::RebuildFromHistory(history_db, scheme_allowlist_);
}
// Saving to Cache -------------------------------------------------------------
......
......@@ -106,7 +106,7 @@ class InMemoryURLIndex : public KeyedService,
history::HistoryService* history_service,
TemplateURLService* template_url_service,
const base::FilePath& history_dir,
const SchemeSet& client_schemes_to_whitelist);
const SchemeSet& client_schemes_to_allowlist);
~InMemoryURLIndex() override;
InMemoryURLIndex(const InMemoryURLIndex&) = delete;
InMemoryURLIndex& operator=(const InMemoryURLIndex&) = delete;
......@@ -159,7 +159,8 @@ class InMemoryURLIndex : public KeyedService,
class RebuildPrivateDataFromHistoryDBTask : public history::HistoryDBTask {
public:
explicit RebuildPrivateDataFromHistoryDBTask(
InMemoryURLIndex* index, const SchemeSet& scheme_whitelist);
InMemoryURLIndex* index,
const SchemeSet& scheme_allowlist);
RebuildPrivateDataFromHistoryDBTask(
const RebuildPrivateDataFromHistoryDBTask&) = delete;
RebuildPrivateDataFromHistoryDBTask& operator=(
......@@ -173,7 +174,7 @@ class InMemoryURLIndex : public KeyedService,
~RebuildPrivateDataFromHistoryDBTask() override;
InMemoryURLIndex* index_; // Call back to this index at completion.
SchemeSet scheme_whitelist_; // Schemes to be indexed.
SchemeSet scheme_allowlist_; // Schemes to be indexed.
bool succeeded_; // Indicates if the rebuild was successful.
scoped_refptr<URLIndexPrivateData> data_; // The rebuilt private data.
};
......@@ -272,8 +273,8 @@ class InMemoryURLIndex : public KeyedService,
return &private_data_tracker_;
}
// Returns the set of whitelisted schemes. For unit testing only.
const SchemeSet& scheme_whitelist() { return scheme_whitelist_; }
// Returns the set of allowlisted schemes. For unit testing only.
const SchemeSet& scheme_allowlist() { return scheme_allowlist_; }
// The BookmarkModel; may be null when testing.
bookmarks::BookmarkModel* bookmark_model_;
......@@ -290,8 +291,8 @@ class InMemoryURLIndex : public KeyedService,
// be empty.
base::FilePath history_dir_;
// Only URLs with a whitelisted scheme are indexed.
SchemeSet scheme_whitelist_;
// Only URLs with a allowlisted scheme are indexed.
SchemeSet scheme_allowlist_;
// The index's durable private data.
scoped_refptr<URLIndexPrivateData> private_data_;
......
......@@ -56,7 +56,7 @@ using base::ASCIIToUTF16;
namespace {
const size_t kInvalid = base::string16::npos;
const size_t kProviderMaxMatches = 3;
const char kClientWhitelistedScheme[] = "xyz";
const char kClientAllowlistedScheme[] = "xyz";
// TemplateURLs used to test filtering of search engine URLs.
const char kDefaultTemplateURLKeyword[] = "default-engine.com";
......@@ -162,7 +162,7 @@ class InMemoryURLIndexTest : public testing::Test {
bool GetCacheFilePath(base::FilePath* file_path) const;
void PostRestoreFromCacheFileTask();
void PostSaveToCacheFileTask();
const SchemeSet& scheme_whitelist();
const SchemeSet& scheme_allowlist();
// Pass-through functions to simplify our friendship with URLIndexPrivateData.
bool UpdateURL(const history::URLRow& row);
......@@ -219,13 +219,13 @@ void InMemoryURLIndexTest::PostSaveToCacheFileTask() {
url_index_->PostSaveToCacheFileTask();
}
const SchemeSet& InMemoryURLIndexTest::scheme_whitelist() {
return url_index_->scheme_whitelist();
const SchemeSet& InMemoryURLIndexTest::scheme_allowlist() {
return url_index_->scheme_allowlist();
}
bool InMemoryURLIndexTest::UpdateURL(const history::URLRow& row) {
return GetPrivateData()->UpdateURL(history_service_.get(), row,
url_index_->scheme_whitelist_,
url_index_->scheme_allowlist_,
GetPrivateDataTracker());
}
......@@ -312,11 +312,11 @@ bool InMemoryURLIndexTest::InitializeInMemoryURLIndexInSetUp() const {
void InMemoryURLIndexTest::InitializeInMemoryURLIndex() {
DCHECK(!url_index_);
SchemeSet client_schemes_to_whitelist;
client_schemes_to_whitelist.insert(kClientWhitelistedScheme);
SchemeSet client_schemes_to_allowlist;
client_schemes_to_allowlist.insert(kClientAllowlistedScheme);
url_index_.reset(new InMemoryURLIndex(
nullptr, history_service_.get(), template_url_service_.get(),
base::FilePath(), client_schemes_to_whitelist));
base::FilePath(), client_schemes_to_allowlist));
url_index_->Init();
RebuildFromHistory();
}
......@@ -1127,87 +1127,87 @@ TEST_F(InMemoryURLIndexTest, ExpireRow) {
.empty());
}
TEST_F(InMemoryURLIndexTest, WhitelistedURLs) {
std::string client_whitelisted_url =
base::StringPrintf("%s://foo", kClientWhitelistedScheme);
TEST_F(InMemoryURLIndexTest, AllowlistedURLs) {
std::string client_allowlisted_url =
base::StringPrintf("%s://foo", kClientAllowlistedScheme);
struct TestData {
const std::string url_spec;
const bool expected_is_whitelisted;
const bool expected_is_allowlisted;
} data[] = {
// URLs with whitelisted schemes.
{ "about:histograms", true },
{ "file://localhost/Users/joeschmoe/sekrets", true },
{ "ftp://public.mycompany.com/myfile.txt", true },
{ "http://www.google.com/translate", true },
{ "https://www.gmail.com/", true },
{ "mailto:support@google.com", true },
{ client_whitelisted_url, true },
// URLs with allowlisted schemes.
{"about:histograms", true},
{"file://localhost/Users/joeschmoe/sekrets", true},
{"ftp://public.mycompany.com/myfile.txt", true},
{"http://www.google.com/translate", true},
{"https://www.gmail.com/", true},
{"mailto:support@google.com", true},
{client_allowlisted_url, true},
// URLs with unacceptable schemes.
{ "aaa://www.dummyhost.com;frammy", false },
{ "aaas://www.dummyhost.com;frammy", false },
{ "acap://suzie@somebody.com", false },
{ "cap://cal.example.com/Company/Holidays", false },
{ "cid:foo4*foo1@bar.net", false },
{ "crid://example.com/foobar", false },
{ "data:image/png;base64,iVBORw0KGgoAAAANSUhE=", false },
{ "dict://dict.org/d:shortcake:", false },
{ "dns://192.168.1.1/ftp.example.org?type=A", false },
{ "fax:+358.555.1234567", false },
{ "geo:13.4125,103.8667", false },
{ "go:Mercedes%20Benz", false },
{ "gopher://farnsworth.ca:666/gopher", false },
{ "h323:farmer-john;sixpence", false },
{ "iax:johnQ@example.com/12022561414", false },
{ "icap://icap.net/service?mode=translate&lang=french", false },
{ "im:fred@example.com", false },
{ "imap://michael@minbari.org/users.*", false },
{ "info:ddc/22/eng//004.678", false },
{ "ipp://example.com/printer/fox", false },
{ "iris:dreg1//example.com/local/myhosts", false },
{ "iris.beep:dreg1//example.com/local/myhosts", false },
{ "iris.lws:dreg1//example.com/local/myhosts", false },
{ "iris.xpc:dreg1//example.com/local/myhosts", false },
{ "iris.xpcs:dreg1//example.com/local/myhosts", false },
{ "ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US", false },
{ "mid:foo4%25foo1@bar.net", false },
{ "modem:+3585551234567;type=v32b?7e1;type=v110", false },
{ "msrp://atlanta.example.com:7654/jshA7weztas;tcp", false },
{ "msrps://atlanta.example.com:7654/jshA7weztas;tcp", false },
{ "news:colorectal.info.banned", false },
{ "nfs://server/d/e/f", false },
{ "nntp://www.example.com:6543/info.comp.lies/1234", false },
{ "pop://rg;AUTH=+APOP@mail.mycompany.com:8110", false },
{ "pres:fred@example.com", false },
{ "prospero://host.dom//pros/name", false },
{ "rsync://syler@lost.com/Source", false },
{ "rtsp://media.example.com:554/twister/audiotrack", false },
{ "acap://some.where.net;authentication=KERBEROSV4", false },
{ "shttp://www.terces.com/secret", false },
{ "sieve://example.com//script", false },
{ "sip:+1-212-555-1212:1234@gateway.com;user=phone", false },
{ "sips:+1-212-555-1212:1234@gateway.com;user=phone", false },
{ "sms:+15105551212?body=hello%20there", false },
{ "snmp://tester5@example.com:8161/bridge1;800002b804616263", false },
{ "soap.beep://stockquoteserver.example.com/StockQuote", false },
{ "soap.beeps://stockquoteserver.example.com/StockQuote", false },
{ "tag:blogger.com,1999:blog-555", false },
{ "tel:+358-555-1234567;postd=pp22", false },
{ "telnet://mayor_margie:one2rule4All@www.mycity.com:6789/", false },
{ "tftp://example.com/mystartupfile", false },
{ "tip://123.123.123.123/?urn:xopen:xid", false },
{ "tv:nbc.com", false },
{ "urn:foo:A123,456", false },
{ "vemmi://zeus.mctel.fr/demo", false },
{ "wais://www.mydomain.net:8765/mydatabase", false },
{ "xmpp:node@example.com", false },
{ "xmpp://guest@example.com", false },
{"aaa://www.dummyhost.com;frammy", false},
{"aaas://www.dummyhost.com;frammy", false},
{"acap://suzie@somebody.com", false},
{"cap://cal.example.com/Company/Holidays", false},
{"cid:foo4*foo1@bar.net", false},
{"crid://example.com/foobar", false},
{"data:image/png;base64,iVBORw0KGgoAAAANSUhE=", false},
{"dict://dict.org/d:shortcake:", false},
{"dns://192.168.1.1/ftp.example.org?type=A", false},
{"fax:+358.555.1234567", false},
{"geo:13.4125,103.8667", false},
{"go:Mercedes%20Benz", false},
{"gopher://farnsworth.ca:666/gopher", false},
{"h323:farmer-john;sixpence", false},
{"iax:johnQ@example.com/12022561414", false},
{"icap://icap.net/service?mode=translate&lang=french", false},
{"im:fred@example.com", false},
{"imap://michael@minbari.org/users.*", false},
{"info:ddc/22/eng//004.678", false},
{"ipp://example.com/printer/fox", false},
{"iris:dreg1//example.com/local/myhosts", false},
{"iris.beep:dreg1//example.com/local/myhosts", false},
{"iris.lws:dreg1//example.com/local/myhosts", false},
{"iris.xpc:dreg1//example.com/local/myhosts", false},
{"iris.xpcs:dreg1//example.com/local/myhosts", false},
{"ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US", false},
{"mid:foo4%25foo1@bar.net", false},
{"modem:+3585551234567;type=v32b?7e1;type=v110", false},
{"msrp://atlanta.example.com:7654/jshA7weztas;tcp", false},
{"msrps://atlanta.example.com:7654/jshA7weztas;tcp", false},
{"news:colorectal.info.banned", false},
{"nfs://server/d/e/f", false},
{"nntp://www.example.com:6543/info.comp.lies/1234", false},
{"pop://rg;AUTH=+APOP@mail.mycompany.com:8110", false},
{"pres:fred@example.com", false},
{"prospero://host.dom//pros/name", false},
{"rsync://syler@lost.com/Source", false},
{"rtsp://media.example.com:554/twister/audiotrack", false},
{"acap://some.where.net;authentication=KERBEROSV4", false},
{"shttp://www.terces.com/secret", false},
{"sieve://example.com//script", false},
{"sip:+1-212-555-1212:1234@gateway.com;user=phone", false},
{"sips:+1-212-555-1212:1234@gateway.com;user=phone", false},
{"sms:+15105551212?body=hello%20there", false},
{"snmp://tester5@example.com:8161/bridge1;800002b804616263", false},
{"soap.beep://stockquoteserver.example.com/StockQuote", false},
{"soap.beeps://stockquoteserver.example.com/StockQuote", false},
{"tag:blogger.com,1999:blog-555", false},
{"tel:+358-555-1234567;postd=pp22", false},
{"telnet://mayor_margie:one2rule4All@www.mycity.com:6789/", false},
{"tftp://example.com/mystartupfile", false},
{"tip://123.123.123.123/?urn:xopen:xid", false},
{"tv:nbc.com", false},
{"urn:foo:A123,456", false},
{"vemmi://zeus.mctel.fr/demo", false},
{"wais://www.mydomain.net:8765/mydatabase", false},
{"xmpp:node@example.com", false},
{"xmpp://guest@example.com", false},
};
const SchemeSet& whitelist(scheme_whitelist());
const SchemeSet& allowlist(scheme_allowlist());
for (size_t i = 0; i < base::size(data); ++i) {
GURL url(data[i].url_spec);
EXPECT_EQ(data[i].expected_is_whitelisted,
URLIndexPrivateData::URLSchemeIsWhitelisted(url, whitelist));
EXPECT_EQ(data[i].expected_is_allowlisted,
URLIndexPrivateData::URLSchemeIsAllowlisted(url, allowlist));
}
}
......
......@@ -273,7 +273,7 @@ ScoredHistoryMatches URLIndexPrivateData::HistoryItemsForTerms(
bool URLIndexPrivateData::UpdateURL(
history::HistoryService* history_service,
const history::URLRow& row,
const std::set<std::string>& scheme_whitelist,
const std::set<std::string>& scheme_allowlist,
base::CancelableTaskTracker* tracker) {
// The row may or may not already be in our index. If it is not already
// indexed and it qualifies then it gets indexed. If it is already
......@@ -288,7 +288,7 @@ bool URLIndexPrivateData::UpdateURL(
new_row.set_id(row_id);
row_was_updated =
RowQualifiesAsSignificant(new_row, base::Time()) &&
IndexRow(nullptr, history_service, new_row, scheme_whitelist, tracker);
IndexRow(nullptr, history_service, new_row, scheme_allowlist, tracker);
} else if (RowQualifiesAsSignificant(row, base::Time())) {
// This indexed row still qualifies and will be re-indexed.
// The url won't have changed but the title, visit count, etc.
......@@ -427,7 +427,7 @@ scoped_refptr<URLIndexPrivateData> URLIndexPrivateData::RestoreFromFile(
// static
scoped_refptr<URLIndexPrivateData> URLIndexPrivateData::RebuildFromHistory(
history::HistoryDatabase* history_db,
const std::set<std::string>& scheme_whitelist) {
const std::set<std::string>& scheme_allowlist) {
if (!history_db)
return nullptr;
......@@ -452,7 +452,7 @@ scoped_refptr<URLIndexPrivateData> URLIndexPrivateData::RebuildFromHistory(
for (history::URLRow row; history_enum.GetNextURL(&row);) {
DCHECK(RowQualifiesAsSignificant(row, base::Time()));
// Do not use >= to account for case of -1 for unlimited urls.
if (rebuilt_data->IndexRow(history_db, nullptr, row, scheme_whitelist,
if (rebuilt_data->IndexRow(history_db, nullptr, row, scheme_allowlist,
nullptr) &&
num_urls_indexed++ == max_urls_indexed) {
break;
......@@ -822,12 +822,12 @@ bool URLIndexPrivateData::IndexRow(
history::HistoryDatabase* history_db,
history::HistoryService* history_service,
const history::URLRow& row,
const std::set<std::string>& scheme_whitelist,
const std::set<std::string>& scheme_allowlist,
base::CancelableTaskTracker* tracker) {
const GURL& gurl(row.url());
// Index only URLs with a whitelisted scheme.
if (!URLSchemeIsWhitelisted(gurl, scheme_whitelist))
// Index only URLs with a allowlisted scheme.
if (!URLSchemeIsAllowlisted(gurl, scheme_allowlist))
return false;
const history::URLID row_id = row.id();
......@@ -1297,10 +1297,10 @@ bool URLIndexPrivateData::RestoreWordStartsMap(
}
// static
bool URLIndexPrivateData::URLSchemeIsWhitelisted(
bool URLIndexPrivateData::URLSchemeIsAllowlisted(
const GURL& gurl,
const std::set<std::string>& whitelist) {
return whitelist.find(gurl.scheme()) != whitelist.end();
const std::set<std::string>& allowlist) {
return allowlist.find(gurl.scheme()) != allowlist.end();
}
bool URLIndexPrivateData::ShouldFilter(
......
......@@ -85,12 +85,12 @@ class URLIndexPrivateData
// exist and it meets the minimum 'quick' criteria. If the row already exists
// in the index then the index will be updated if the row still meets the
// criteria, otherwise the row will be removed from the index. Returns true
// if the index was actually updated. |scheme_whitelist| is used to filter
// if the index was actually updated. |scheme_allowlist| is used to filter
// non-qualifying schemes. |history_service| is used to schedule an update to
// the recent visits component of this URL's entry in the index.
bool UpdateURL(history::HistoryService* history_service,
const history::URLRow& row,
const std::set<std::string>& scheme_whitelist,
const std::set<std::string>& scheme_allowlist,
base::CancelableTaskTracker* tracker);
// Updates the entry for |url_id| in the index, replacing its
......@@ -125,7 +125,7 @@ class URLIndexPrivateData
// success will contain the rebuilt data but upon failure will be empty.
static scoped_refptr<URLIndexPrivateData> RebuildFromHistory(
history::HistoryDatabase* history_db,
const std::set<std::string>& scheme_whitelist);
const std::set<std::string>& scheme_allowlist);
// Writes |private_data| as a cache file to |file_path| and returns success.
static bool WritePrivateDataToCacheFileTask(
......@@ -174,7 +174,7 @@ class URLIndexPrivateData
FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, TitleSearch);
FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, TrimHistoryIds);
FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, TypedCharacterCaching);
FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, WhitelistedURLs);
FRIEND_TEST_ALL_PREFIXES(InMemoryURLIndexTest, AllowlistedURLs);
FRIEND_TEST_ALL_PREFIXES(LimitedInMemoryURLIndexTest, Initialization);
// Support caching of term results so that we can optimize searches which
......@@ -262,7 +262,7 @@ class URLIndexPrivateData
WordStarts* terms_to_word_starts_offsets);
// Indexes one URL history item as described by |row|. Returns true if the
// row was actually indexed. |scheme_whitelist| is used to filter
// row was actually indexed. |scheme_allowlist| is used to filter
// non-qualifying schemes. If |history_db| is not NULL then this function
// uses the history database synchronously to get the URL's recent visits
// information. This mode should/ only be used on the historyDB thread.
......@@ -272,7 +272,7 @@ class URLIndexPrivateData
bool IndexRow(history::HistoryDatabase* history_db,
history::HistoryService* history_service,
const history::URLRow& row,
const std::set<std::string>& scheme_whitelist,
const std::set<std::string>& scheme_allowlist,
base::CancelableTaskTracker* tracker);
// Parses and indexes the words in the URL and page title of |row| and
......@@ -333,9 +333,9 @@ class URLIndexPrivateData
bool RestoreWordStartsMap(
const in_memory_url_index::InMemoryURLIndexCacheItem& cache);
// Determines if |gurl| has a whitelisted scheme and returns true if so.
static bool URLSchemeIsWhitelisted(const GURL& gurl,
const std::set<std::string>& whitelist);
// Determines if |gurl| has a allowlisted scheme and returns true if so.
static bool URLSchemeIsAllowlisted(const GURL& gurl,
const std::set<std::string>& allowlist);
// Returns true if the URL associated with |history_id| is missing, malformed,
// or otherwise should not be displayed. (Results from the default search
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment