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

Unified Diff: net/cert/crl_set.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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: net/cert/crl_set.cc
diff --git a/net/cert/crl_set.cc b/net/cert/crl_set.cc
index de0651666d86050961e4d4a2c9ceb73581e3e3c4..b9cca26ec84c6d19d4d9ccc43e6412cac67848a8 100644
--- a/net/cert/crl_set.cc
+++ b/net/cert/crl_set.cc
@@ -39,14 +39,12 @@ static bool DecompressZlib(uint8* out, int out_len, base::StringPiece in) {
goto err;
ret = true;
- err:
+err:
inflateEnd(&z);
return ret;
}
-CRLSet::CRLSet()
- : sequence_(0),
- not_after_(0) {
+CRLSet::CRLSet() : sequence_(0), not_after_(0) {
}
CRLSet::~CRLSet() {
@@ -133,8 +131,8 @@ static base::DictionaryValue* ReadHeader(base::StringPiece* data) {
const base::StringPiece header_bytes(data->data(), header_len);
data->remove_prefix(header_len);
- scoped_ptr<base::Value> header(base::JSONReader::Read(
- header_bytes, base::JSON_ALLOW_TRAILING_COMMAS));
+ scoped_ptr<base::Value> header(
+ base::JSONReader::Read(header_bytes, base::JSON_ALLOW_TRAILING_COMMAS));
if (header.get() == NULL)
return NULL;
@@ -147,7 +145,8 @@ static base::DictionaryValue* ReadHeader(base::StringPiece* data) {
// currently implement.
static const int kCurrentFileVersion = 0;
-static bool ReadCRL(base::StringPiece* data, std::string* out_parent_spki_hash,
+static bool ReadCRL(base::StringPiece* data,
+ std::string* out_parent_spki_hash,
std::vector<std::string>* out_serials) {
if (data->size() < crypto::kSHA256Length)
return false;
@@ -200,14 +199,14 @@ bool CRLSet::CopyBlockedSPKIsFromHeader(base::DictionaryValue* header_dict) {
// static
bool CRLSet::Parse(base::StringPiece data, scoped_refptr<CRLSet>* out_crl_set) {
- // Other parts of Chrome assume that we're little endian, so we don't lose
- // anything by doing this.
+// Other parts of Chrome assume that we're little endian, so we don't lose
+// anything by doing this.
#if defined(__BYTE_ORDER)
// Linux check
COMPILE_ASSERT(__BYTE_ORDER == __LITTLE_ENDIAN, assumes_little_endian);
#elif defined(__BIG_ENDIAN__)
- // Mac check
- #error assumes little endian
+// Mac check
+#error assumes little endian
#endif
scoped_ptr<base::DictionaryValue> header_dict(ReadHeader(&data));
@@ -307,7 +306,8 @@ bool ReadDeltaCRL(base::StringPiece* data,
size_t i = 0;
for (std::vector<uint8>::const_iterator k = changes.begin();
- k != changes.end(); ++k) {
+ k != changes.end();
+ ++k) {
if (*k == SYMBOL_SAME) {
if (i >= old_serials.size())
return false;
@@ -362,8 +362,7 @@ bool CRLSet::ApplyDelta(const base::StringPiece& in_data,
int sequence, delta_from;
if (!header_dict->GetInteger("Sequence", &sequence) ||
- !header_dict->GetInteger("DeltaFrom", &delta_from) ||
- delta_from < 0 ||
+ !header_dict->GetInteger("DeltaFrom", &delta_from) || delta_from < 0 ||
static_cast<uint32>(delta_from) != sequence_) {
return false;
}
@@ -390,7 +389,8 @@ bool CRLSet::ApplyDelta(const base::StringPiece& in_data,
size_t i = 0, j = 0;
for (std::vector<uint8>::const_iterator k = crl_changes.begin();
- k != crl_changes.end(); ++k) {
+ k != crl_changes.end();
+ ++k) {
if (*k == SYMBOL_SAME) {
if (i >= crls_.size())
return false;
@@ -471,7 +471,8 @@ std::string CRLSet::Serialize() const {
static_cast<unsigned>(crls_.size()));
for (std::vector<std::string>::const_iterator i = blocked_spkis_.begin();
- i != blocked_spkis_.end(); ++i) {
+ i != blocked_spkis_.end();
+ ++i) {
std::string spki_hash_base64;
base::Base64Encode(*i, &spki_hash_base64);
@@ -489,7 +490,8 @@ std::string CRLSet::Serialize() const {
for (CRLList::const_iterator i = crls_.begin(); i != crls_.end(); ++i) {
len += i->first.size() + 4 /* num serials */;
for (std::vector<std::string>::const_iterator j = i->second.begin();
- j != i->second.end(); ++j) {
+ j != i->second.end();
+ ++j) {
len += 1 /* serial length */ + j->size();
}
}
@@ -510,7 +512,8 @@ std::string CRLSet::Serialize() const {
off += sizeof(num_serials);
for (std::vector<std::string>::const_iterator j = i->second.begin();
- j != i->second.end(); ++j) {
+ j != i->second.end();
+ ++j) {
out[off++] = j->size();
memcpy(out + off, j->data(), j->size());
off += j->size();
@@ -523,7 +526,8 @@ std::string CRLSet::Serialize() const {
CRLSet::Result CRLSet::CheckSPKI(const base::StringPiece& spki_hash) const {
for (std::vector<std::string>::const_iterator i = blocked_spkis_.begin();
- i != blocked_spkis_.end(); ++i) {
+ i != blocked_spkis_.end();
+ ++i) {
if (spki_hash.size() == i->size() &&
memcmp(spki_hash.data(), i->data(), i->size()) == 0) {
return REVOKED;
@@ -555,7 +559,8 @@ CRLSet::Result CRLSet::CheckSerial(
const std::vector<std::string>& serials = crls_[i->second].second;
for (std::vector<std::string>::const_iterator i = serials.begin();
- i != serials.end(); ++i) {
+ i != serials.end();
+ ++i) {
if (base::StringPiece(*i) == serial)
return REVOKED;
}

Powered by Google App Engine
This is Rietveld 408576698