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

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: Add regression 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..c97e4c89a8b14c352b45a08a6b1622daa37b78d3 100644
--- a/components/subresource_filter/core/common/unindexed_ruleset.cc
+++ b/components/subresource_filter/core/common/unindexed_ruleset.cc
@@ -51,7 +51,9 @@ 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();
engedy 2016/08/26 15:43:17 nit: Same here as above, feel free to return false
pkalinnikov1 2016/08/26 16:29:47 Done.
+ coded_stream_.Trim();
+ return success;
}
bool UnindexedRulesetWriter::WritePendingChunk() {

Powered by Google App Engine
This is Rietveld 408576698