| Index: net/base/ip_pattern.cc
|
| diff --git a/net/base/ip_pattern.cc b/net/base/ip_pattern.cc
|
| index f67d3a0ba64b9d590cc7dcd57800290b3d356e14..73dbca2b8c94f8145f528b5693832e128e2077ef 100644
|
| --- a/net/base/ip_pattern.cc
|
| +++ b/net/base/ip_pattern.cc
|
| @@ -35,7 +35,8 @@ class IPPattern::ComponentPattern {
|
| DISALLOW_COPY_AND_ASSIGN(ComponentPattern);
|
| };
|
|
|
| -IPPattern::ComponentPattern::ComponentPattern() {}
|
| +IPPattern::ComponentPattern::ComponentPattern() {
|
| +}
|
|
|
| void IPPattern::ComponentPattern::AppendRange(uint32 min, uint32 max) {
|
| ranges_.push_back(Range(min, max));
|
| @@ -45,14 +46,16 @@ bool IPPattern::ComponentPattern::Match(uint32 value) const {
|
| // Simple linear search should be fine, as we usually only have very few
|
| // distinct ranges to test.
|
| for (RangeVector::const_iterator range_it = ranges_.begin();
|
| - range_it != ranges_.end(); ++range_it) {
|
| + range_it != ranges_.end();
|
| + ++range_it) {
|
| if (range_it->maximum >= value && range_it->minimum <= value)
|
| return true;
|
| }
|
| return false;
|
| }
|
|
|
| -IPPattern::IPPattern() : is_ipv4_(true) {}
|
| +IPPattern::IPPattern() : is_ipv4_(true) {
|
| +}
|
|
|
| IPPattern::~IPPattern() {
|
| STLDeleteElements(&component_patterns_);
|
| @@ -99,7 +102,8 @@ bool IPPattern::ParsePattern(const std::string& ip_pattern) {
|
| return false;
|
| }
|
| for (Strings::iterator component_it = components.begin();
|
| - component_it != components.end(); ++component_it) {
|
| + component_it != components.end();
|
| + ++component_it) {
|
| if (component_it->empty()) {
|
| DVLOG(1) << "Empty component: " << ip_pattern;
|
| return false;
|
| @@ -129,7 +133,8 @@ bool IPPattern::ParsePattern(const std::string& ip_pattern) {
|
| scoped_ptr<ComponentPattern> component_pattern(new ComponentPattern);
|
| // Trim leading and trailing bracket before calling for parsing.
|
| if (!ParseComponentPattern(base::StringPiece(component_it->data() + 1,
|
| - component_it->size() - 2), component_pattern.get())) {
|
| + component_it->size() - 2),
|
| + component_pattern.get())) {
|
| return false;
|
| }
|
| ip_mask_.push_back(false);
|
| @@ -144,8 +149,8 @@ bool IPPattern::ParseComponentPattern(const base::StringPiece& text,
|
| // constants.
|
| Strings ranges;
|
| base::SplitString(text.as_string(), ',', &ranges);
|
| - for (Strings::iterator range_it = ranges.begin();
|
| - range_it != ranges.end(); ++range_it) {
|
| + for (Strings::iterator range_it = ranges.begin(); range_it != ranges.end();
|
| + ++range_it) {
|
| base::StringTokenizer range_pair(*range_it, "-");
|
| uint32 min = 0;
|
| range_pair.GetNext();
|
| @@ -168,8 +173,8 @@ bool IPPattern::ParseComponentPattern(const base::StringPiece& text,
|
|
|
| bool IPPattern::ValueTextToInt(const base::StringPiece& input,
|
| uint32* output) const {
|
| - bool ok = is_ipv4_ ? base::StringToUint(input, output) :
|
| - base::HexStringToUInt(input, output);
|
| + bool ok = is_ipv4_ ? base::StringToUint(input, output)
|
| + : base::HexStringToUInt(input, output);
|
| if (!ok) {
|
| DVLOG(1) << "Could not convert value to number: " << input;
|
| return false;
|
|
|