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

Unified Diff: net/quic/crypto/strike_register.cc

Issue 1227353005: Cleanup changes: Rename QuicSession::MarkWriteBlocked to (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « net/quic/crypto/strike_register.h ('k') | net/quic/crypto/strike_register_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/strike_register.cc
diff --git a/net/quic/crypto/strike_register.cc b/net/quic/crypto/strike_register.cc
index 87aae0d8fc7d906b22de8c6203450083067fa3f4..93f0e0d01a08609c3dd15487ed3b9d92dccec34b 100644
--- a/net/quic/crypto/strike_register.cc
+++ b/net/quic/crypto/strike_register.cc
@@ -115,14 +115,16 @@ StrikeRegister::~StrikeRegister() { delete[] internal_nodes_; }
void StrikeRegister::Reset() {
// Thread a free list through all of the internal nodes.
internal_node_free_head_ = 0;
- for (unsigned i = 0; i < max_entries_ - 1; i++)
+ for (unsigned i = 0; i < max_entries_ - 1; i++) {
internal_nodes_[i].SetNextPtr(i + 1);
+ }
internal_nodes_[max_entries_ - 1].SetNextPtr(kNil);
// Also thread a free list through the external nodes.
external_node_free_head_ = 0;
- for (unsigned i = 0; i < max_entries_ - 1; i++)
+ for (unsigned i = 0; i < max_entries_ - 1; i++) {
external_node_next_ptr(i) = i + 1;
+ }
external_node_next_ptr(max_entries_ - 1) = kNil;
// This is the root of the tree.
@@ -304,7 +306,7 @@ void StrikeRegister::Validate() {
if (internal_node_head_ != kNil &&
((internal_node_head_ >> 8) & kExternalFlag) == 0) {
- vector<pair<unsigned, bool> > bits;
+ vector<pair<unsigned, bool>> bits;
ValidateTree(internal_node_head_ >> 8, -1, bits, free_internal_nodes,
free_external_nodes, &used_internal_nodes,
&used_external_nodes);
@@ -441,14 +443,13 @@ void StrikeRegister::FreeInternalNode(uint32 index) {
internal_node_free_head_ = index;
}
-void StrikeRegister::ValidateTree(
- uint32 internal_node,
- int last_bit,
- const vector<pair<unsigned, bool> >& bits,
- const set<uint32>& free_internal_nodes,
- const set<uint32>& free_external_nodes,
- set<uint32>* used_internal_nodes,
- set<uint32>* used_external_nodes) {
+void StrikeRegister::ValidateTree(uint32 internal_node,
+ int last_bit,
+ const vector<pair<unsigned, bool>>& bits,
+ const set<uint32>& free_internal_nodes,
+ const set<uint32>& free_external_nodes,
+ set<uint32>* used_internal_nodes,
+ set<uint32>* used_external_nodes) {
CHECK_LT(internal_node, max_entries_);
const InternalNode* i = &internal_nodes_[internal_node];
unsigned bit = 0;
@@ -505,7 +506,7 @@ void StrikeRegister::ValidateTree(
}
} else {
uint32 inter = i->child(child);
- vector<pair<unsigned, bool> > new_bits(bits);
+ vector<pair<unsigned, bool>> new_bits(bits);
new_bits.push_back(pair<unsigned, bool>(bit, child != 0));
CHECK_EQ(free_internal_nodes.count(inter), 0u);
CHECK_EQ(used_internal_nodes->count(inter), 0u);
« no previous file with comments | « net/quic/crypto/strike_register.h ('k') | net/quic/crypto/strike_register_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698