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

Side by Side Diff: content/browser/browsing_data/browsing_data_filter_builder_impl.cc

Issue 2716583003: Rename Origin.unique() to opaque().
Patch Set: Update new uses post-rebase Created 3 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #include "content/browser/browsing_data/browsing_data_filter_builder_impl.h" 5 #include "content/browser/browsing_data/browsing_data_filter_builder_impl.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 BrowsingDataFilterBuilderImpl::BrowsingDataFilterBuilderImpl(Mode mode) 126 BrowsingDataFilterBuilderImpl::BrowsingDataFilterBuilderImpl(Mode mode)
127 : mode_(mode) {} 127 : mode_(mode) {}
128 128
129 BrowsingDataFilterBuilderImpl::~BrowsingDataFilterBuilderImpl() {} 129 BrowsingDataFilterBuilderImpl::~BrowsingDataFilterBuilderImpl() {}
130 130
131 void BrowsingDataFilterBuilderImpl::AddOrigin(const url::Origin& origin) { 131 void BrowsingDataFilterBuilderImpl::AddOrigin(const url::Origin& origin) {
132 // TODO(msramek): Optimize OriginFilterBuilder for larger filters if needed. 132 // TODO(msramek): Optimize OriginFilterBuilder for larger filters if needed.
133 DCHECK_LE(origins_.size(), 10U) << "OriginFilterBuilder is only suitable " 133 DCHECK_LE(origins_.size(), 10U) << "OriginFilterBuilder is only suitable "
134 "for creating small filters."; 134 "for creating small filters.";
135 135
136 // By limiting the filter to non-unique origins, we can guarantee that 136 // By limiting the filter to non-opaque origins, we can guarantee that
137 // origin1 < origin2 && origin1 > origin2 <=> origin1.isSameOrigin(origin2). 137 // origin1 < origin2 && origin1 > origin2 <=> origin1.isSameOrigin(origin2).
138 // This means that std::set::find() will use the same semantics for 138 // This means that std::set::find() will use the same semantics for
139 // origin comparison as Origin::IsSameOriginWith(). Furthermore, this 139 // origin comparison as Origin::IsSameOriginWith(). Furthermore, this
140 // means that two filters are equal iff they are equal element-wise. 140 // means that two filters are equal iff they are equal element-wise.
141 DCHECK(!origin.unique()) << "Invalid origin passed into OriginFilter."; 141 DCHECK(!origin.opaque()) << "Invalid origin passed into OriginFilter.";
142 142
143 // TODO(msramek): All urls with file scheme currently map to the same 143 // TODO(msramek): All urls with file scheme currently map to the same
144 // origin. This is currently not a problem, but if it becomes one, 144 // origin. This is currently not a problem, but if it becomes one,
145 // consider recognizing the URL path. 145 // consider recognizing the URL path.
146 146
147 origins_.insert(origin); 147 origins_.insert(origin);
148 } 148 }
149 149
150 void BrowsingDataFilterBuilderImpl::AddRegisterableDomain( 150 void BrowsingDataFilterBuilderImpl::AddRegisterableDomain(
151 const std::string& domain) { 151 const std::string& domain) {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 // downcast |other|. 211 // downcast |other|.
212 const BrowsingDataFilterBuilderImpl* other_impl = 212 const BrowsingDataFilterBuilderImpl* other_impl =
213 static_cast<const BrowsingDataFilterBuilderImpl*>(&other); 213 static_cast<const BrowsingDataFilterBuilderImpl*>(&other);
214 214
215 return origins_ == other_impl->origins_ && 215 return origins_ == other_impl->origins_ &&
216 domains_ == other_impl->domains_ && 216 domains_ == other_impl->domains_ &&
217 mode_ == other_impl->mode_; 217 mode_ == other_impl->mode_;
218 } 218 }
219 219
220 } // namespace content 220 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698