Bug 1378680 - Refactor usage fallible alloc in url-classifier r=francois

MozReview-Commit-ID: HHG1ByeIwZv
This commit is contained in:
Thomas Nguyen
2017-07-20 16:20:27 +08:00
parent 46fb70612a
commit 41442f215a
9 changed files with 105 additions and 46 deletions

View File

@@ -970,8 +970,12 @@ ProtocolParserProtobuf::ProcessRawRemoval(TableUpdateV4& aTableUpdate,
PARSER_LOG(("* Raw removal"));
PARSER_LOG((" - # of removal: %d", indices.size()));
aTableUpdate.NewRemovalIndices((const uint32_t*)indices.data(),
indices.size());
nsresult rv = aTableUpdate.NewRemovalIndices((const uint32_t*)indices.data(),
indices.size());
if (NS_FAILED(rv)) {
PARSER_LOG(("Failed to create new removal indices."));
return rv;
}
return NS_OK;
}
@@ -1104,7 +1108,11 @@ ProtocolParserProtobuf::ProcessEncodedRemoval(TableUpdateV4& aTableUpdate,
}
// The encoded prefixes are always 4 bytes.
aTableUpdate.NewRemovalIndices(&decoded[0], decoded.Length());
rv = aTableUpdate.NewRemovalIndices(&decoded[0], decoded.Length());
if (NS_FAILED(rv)) {
PARSER_LOG(("Failed to create new removal indices."));
return rv;
}
return NS_OK;
}