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

Unified Diff: components/subresource_filter/core/common/unindexed_ruleset.cc

Issue 2279803002: Fix UnindexedRulesetWriter finishing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove redundant test. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: components/subresource_filter/core/common/unindexed_ruleset.cc
diff --git a/components/subresource_filter/core/common/unindexed_ruleset.cc b/components/subresource_filter/core/common/unindexed_ruleset.cc
index 086fb24b4fdada5b4749639604fe1fe2282c9d0a..641a73d906d1b9991db7e5364dd06921269188ad 100644
--- a/components/subresource_filter/core/common/unindexed_ruleset.cc
+++ b/components/subresource_filter/core/common/unindexed_ruleset.cc
@@ -51,7 +51,10 @@ bool UnindexedRulesetWriter::AddUrlRule(const proto::UrlRule& rule) {
bool UnindexedRulesetWriter::Finish() {
DCHECK(!had_error());
- return !pending_chunk_.url_rules_size() || WritePendingChunk();
+ const bool success = !pending_chunk_.url_rules_size() || WritePendingChunk();
+ if (success)
+ coded_stream_.Trim();
+ return success;
}
bool UnindexedRulesetWriter::WritePendingChunk() {

Powered by Google App Engine
This is Rietveld 408576698