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

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

Issue 2167653002: Make the subresource filter support subdomain anchor matching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address more comments from engedy@ Created 4 years, 5 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
Index: components/subresource_filter/core/common/string_splitter.h
diff --git a/components/subresource_filter/core/common/string_splitter.h b/components/subresource_filter/core/common/string_splitter.h
index a3103346b218f49d36c6845c81e95921fc80babb..f3b4e85b06b41b476a923462bb85f195c19bd8d3 100644
--- a/components/subresource_filter/core/common/string_splitter.h
+++ b/components/subresource_filter/core/common/string_splitter.h
@@ -29,8 +29,8 @@ class StringSplitter {
// |splitter|'s |text|, starting from |head|.
Iterator(const StringSplitter& splitter,
base::StringPiece::const_iterator head)
- : splitter_(splitter), current_(head, 0), end_(splitter.text_.end()) {
- DCHECK_GE(head, splitter_.text_.begin());
+ : splitter_(&splitter), current_(head, 0), end_(splitter.text_.end()) {
+ DCHECK_GE(head, splitter_->text_.begin());
DCHECK_LE(head, end_);
Advance();
@@ -59,15 +59,15 @@ class StringSplitter {
private:
void Advance() {
auto begin = current_.end();
- while (begin != end_ && splitter_.is_separator_(*begin))
+ while (begin != end_ && splitter_->is_separator_(*begin))
++begin;
auto end = begin;
- while (end != end_ && !splitter_.is_separator_(*end))
+ while (end != end_ && !splitter_->is_separator_(*end))
++end;
current_ = base::StringPiece(begin, end - begin);
}
- const StringSplitter& splitter_;
+ const StringSplitter* splitter_;
// Contains the token currently pointed to by the iterator.
base::StringPiece current_;

Powered by Google App Engine
This is Rietveld 408576698